[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:
parent
5775f46403
commit
b4064bca6e
18
src/db.c
18
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue