[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
This commit is contained in:
Holger Freyther 2009-02-23 00:50:31 +00:00
parent 5775f46403
commit b4064bca6e
1 changed files with 18 additions and 0 deletions

View File

@ -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;
}