diff options
author | Holger Freyther <zecke@selfish.org> | 2009-02-23 00:50:31 +0000 |
---|---|---|
committer | Holger Freyther <zecke@selfish.org> | 2009-02-23 00:50:31 +0000 |
commit | b4064bca6eec50524c9aab4b04abcf4121f2d9c7 (patch) | |
tree | 02bb4845c70be120b7a61f65ce365489b90b5c57 /src/db.c | |
parent | 5775f46403057cf4cf03f563c46943b100dca3b3 (diff) |
[db] Introduce a table for SMS
- created for the creation of the SMS
- sent the time the message was submitted
- sender_id the subscriber for the return path/report
- receiver_id the subscriber
- header the (optional) SMS PDU header
- payload the payload (utf8), raw data
Diffstat (limited to 'src/db.c')
-rw-r--r-- | src/db.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -143,6 +143,24 @@ int db_prepare() { return 1; } dbi_result_free(result); + + result = dbi_conn_query(conn, + "CREATE TABLE IF NOT EXISTS SMS (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "created TIMESTAMP NOT NULL, " + "sent TIMESTAMP, " + "sender_id NUMERIC NOT NULL, " + "receiver_id NUMERIC NOT NULL, " + "header NUMERIC, " + "text TEXT NOT NULL " + ")" + ); + if (result==NULL) { + printf("DB: Failed to create Equipment table.\n"); + return 1; + } + dbi_result_free(result); + return 0; } |