aboutsummaryrefslogtreecommitdiffstats
path: root/src/db.c
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2009-02-23 00:50:31 +0000
committerHolger Freyther <zecke@selfish.org>2009-02-23 00:50:31 +0000
commitb4064bca6eec50524c9aab4b04abcf4121f2d9c7 (patch)
tree02bb4845c70be120b7a61f65ce365489b90b5c57 /src/db.c
parent5775f46403057cf4cf03f563c46943b100dca3b3 (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.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/db.c b/src/db.c
index 697979467..a7c4f3d4c 100644
--- a/src/db.c
+++ b/src/db.c
@@ -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;
}