]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - db/laconica_pg.sql
better logic for if-modified-since
[quix0rs-gnu-social.git] / db / laconica_pg.sql
index ff11219d5db4a67c508d5844e3c73d3df5c465f8..e784bb16996fd0b3861cd270c7cc59631b05ea13 100644 (file)
@@ -47,6 +47,8 @@ create table "user" (
     email varchar(255) unique /* comment 'email address for password recovery etc.' */,\r
     incomingemail varchar(255) unique /* comment 'email address for post-by-email' */,\r
     emailnotifysub integer default 1 /* comment 'Notify by email of subscriptions' */,\r
+    emailnotifyfav integer default 1 /* comment 'Notify by email of favorites' */,\r
+    emailnotifynudge integer default 1 /* comment 'Notify by email of nudges' */,\r
     emailmicroid integer default 1 /* comment 'whether to publish email microid' */,\r
     language varchar(50) /* comment 'preferred language' */,\r
     timezone varchar(50) /* comment 'timezone' */,\r
@@ -63,6 +65,7 @@ create table "user" (
     smsemail varchar(255) /* comment 'built from sms and carrier' */,\r
     uri varchar(255) unique /* comment 'universally unique identifier, usually a tag URI' */,\r
     autosubscribe integer default 0 /* comment 'automatically subscribe to users who subscribe to us' */,\r
+    urlshorteningservice varchar(50) default 'ur1.ca' /* comment 'service to use for auto-shortening URLs' */,\r
     created timestamp not null /* comment 'date this record was created' */,\r
     modified timestamp /* comment 'date this record was modified' */\r
 \r
@@ -218,7 +221,7 @@ create table confirm_address (
     code varchar(32) not null primary key /* comment 'good random code' */,\r
     user_id integer not null /* comment 'user who requested confirmation' */ references "user" (id),\r
     address varchar(255) not null /* comment 'address (email, Jabber, SMS, etc.)' */,\r
-    address_extra varchar(255) not null /* comment 'carrier ID, for SMS' */,\r
+    address_extra varchar(255) not null default '' /* comment 'carrier ID, for SMS' */,\r
     address_type varchar(8) not null /* comment 'address type ("email", "jabber", "sms")' */,\r
     claimed timestamp /* comment 'date this was claimed for queueing' */,\r
     sent timestamp /* comment 'date this was sent for queueing' */,\r
@@ -288,6 +291,35 @@ create table foreign_subscription (
 create index foreign_subscription_subscriber_idx on foreign_subscription using btree(subscriber);\r
 create index foreign_subscription_subscribed_idx on foreign_subscription using btree(subscribed);\r
 \r
+create table invitation (\r
+     code varchar(32) not null primary key /* comment 'random code for an invitation' */,\r
+     user_id int not null /* comment 'who sent the invitation' */ references "user" (id),\r
+     address varchar(255) not null /* comment 'invitation sent to' */,\r
+     address_type varchar(8) not null /* comment 'address type ("email", "jabber", "sms") '*/,\r
+     created timestamp not null /* comment 'date this record was created' */\r
+\r
+);\r
+create index invitation_address_idx on invitation using btree(address,address_type);\r
+create index invitation_user_id_idx on invitation using btree(user_id);\r
+\r
+create table message (\r
+\r
+    id serial primary key /* comment 'unique identifier' */,\r
+    uri varchar(255) unique /* comment 'universally unique identifier' */,\r
+    from_profile integer not null /* comment 'who the message is from' */ references profile (id),\r
+    to_profile integer not null /* comment 'who the message is to' */ references profile (id),\r
+    content varchar(140) /* comment 'message content' */,\r
+    rendered text /* comment 'HTML version of the content' */,\r
+    url varchar(255) /* comment 'URL of any attachment (image, video, bookmark, whatever)' */,\r
+    created timestamp not null /* comment 'date this record was created' */,\r
+    modified timestamp /* comment 'date this record was modified' */,\r
+    source varchar(32) /* comment 'source of comment, like "web", "im", or "clientname"' */\r
+    \r
+);\r
+create index message_from_idx on message using btree(from_profile);\r
+create index message_to_idx on message using btree(to_profile);\r
+create index message_created_idx on message using btree(created);\r
+\r
 /* Textsearch stuff */\r
 \r
 create index textsearch_idx on profile using gist(textsearch);\r