]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - db/laconica.sql
add queueing variables to confirm_address
[quix0rs-gnu-social.git] / db / laconica.sql
index 03e823d50dbbdb65785cb6334cf922b3f1cb3360..6db9b6cf6bfc4265038bd05d2f26b09d742482a6 100644 (file)
@@ -24,11 +24,19 @@ create table avatar (
     url varchar(255) unique key comment 'avatar location',
     created datetime not null comment 'date this record was created',
     modified timestamp comment 'date this record was modified',
-    
+
     constraint primary key (profile_id, width, height),
     index avatar_profile_id_idx (profile_id)
 ) ENGINE=InnoDB;
 
+create table sms_carrier (
+    id integer auto_increment primary key comment 'primary key for SMS carrier',
+    name varchar(64) unique key comment 'name of the carrier',
+    email_pattern varchar(255) not null comment 'sprintf pattern for making an email address from a phone number',
+    created datetime not null comment 'date this record was created',
+    modified timestamp comment 'date this record was modified'
+) ENGINE=InnoDB;
+
 /* local users */
 
 create table user (
@@ -36,6 +44,12 @@ create table user (
     nickname varchar(64) unique key comment 'nickname or username, duped in profile',
     password varchar(255) comment 'salted password, can be null for OpenID users',
     email varchar(255) unique key comment 'email address for password recovery etc.',
+    jabber varchar(255) unique key comment 'jabber ID for notices',
+    jabbernotify tinyint default 0 comment 'whether to send notices to jabber',
+    updatefrompresence tinyint default 0 comment 'whether to record updates from Jabber presence notices',
+    sms varchar(64) unique key comment 'sms phone number',
+    carrier integer comment 'foreign key to sms_carrier' references sms_carrier (id),
+    smsnotify tinyint default 0 comment 'whether to send notices to SMS',
     uri varchar(255) unique key comment 'universally unique identifier, usually a tag URI',
     created datetime not null comment 'date this record was created',
     modified timestamp comment 'date this record was modified'
@@ -83,7 +97,7 @@ create table notice (
 create table consumer (
     consumer_key varchar(255) primary key comment 'unique identifier, root URL',
     seed char(32) not null comment 'seed for new tokens by this consumer',
-    
+
     created datetime not null comment 'date this record was created',
     modified timestamp comment 'date this record was modified'
 ) ENGINE=InnoDB;
@@ -94,10 +108,10 @@ create table token (
     secret char(32) not null comment 'secret value',
     type tinyint not null default 0 comment 'request or access',
     state tinyint default 0 comment 'for requests; 0 = initial, 1 = authorized, 2 = used',
-    
+
     created datetime not null comment 'date this record was created',
     modified timestamp comment 'date this record was modified',
-    
+
     constraint primary key (consumer_key, tok)
 ) ENGINE=InnoDB;
 
@@ -106,10 +120,10 @@ create table nonce (
     tok char(32) not null comment 'identifying value',
     nonce char(32) not null comment 'nonce',
     ts datetime not null comment 'timestamp sent',
-    
+
     created datetime not null comment 'date this record was created',
     modified timestamp comment 'date this record was modified',
-    
+
     constraint primary key (consumer_key, tok, nonce),
     constraint foreign key (consumer_key, tok) references token (consumer_key, tok)
 ) ENGINE=InnoDB;
@@ -122,7 +136,7 @@ create table user_openid (
     user_id integer not null comment 'user owning this URL' references user (id),
     created datetime not null comment 'date this record was created',
     modified timestamp comment 'date this record was modified',
-    
+
     index user_openid_user_id_idx (user_id)
 ) ENGINE=InnoDB;
 
@@ -144,3 +158,31 @@ create table oid_nonces (
     salt CHAR(40),
     UNIQUE (server_url(255), timestamp, salt)
 ) ENGINE=InnoDB;
+
+create table confirm_address (
+    code varchar(32) not null primary key comment 'good random code',
+    user_id integer not null comment 'user who requested confirmation' references user (id),
+    address varchar(255) not null comment 'address (email, Jabber, SMS, etc.)',
+    address_extra varchar(255) not null comment 'carrier ID, for SMS',
+    address_type varchar(8) not null comment 'address type ("email", "jabber", "sms")',
+    claimed datetime comment 'date this was claimed for queueing',
+    sent datetime comment 'date this was sent for queueing',
+    modified timestamp comment 'date this record was modified'
+) ENGINE=InnoDB;
+
+create table remember_me (
+    code varchar(32) not null primary key comment 'good random code',
+    user_id integer not null comment 'user who is logged in' references user (id),
+    modified timestamp comment 'date this record was modified'
+) ENGINE=InnoDB;
+
+create table queue_item (
+
+    notice_id integer not null primary key comment 'notice queued' references notice (id),
+    created datetime not null comment 'date this record was created',
+    claimed datetime comment 'date this item was claimed',
+
+    index queue_item_created_idx (created)
+    
+) ENGINE=InnoDB;
+