diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/08to09.sql | 22 | ||||
-rw-r--r-- | db/08to09_pg.sql | 42 | ||||
-rw-r--r-- | db/statusnet.sql (renamed from db/laconica.sql) | 11 | ||||
-rw-r--r-- | db/statusnet_pg.sql (renamed from db/laconica_pg.sql) | 21 |
4 files changed, 94 insertions, 2 deletions
diff --git a/db/08to09.sql b/db/08to09.sql index 4d1830611..953e0e5f4 100644 --- a/db/08to09.sql +++ b/db/08to09.sql @@ -10,3 +10,25 @@ alter table profile alter table user_group modify column description text comment 'group description'; +alter table file_oembed + add column mimetype varchar(50) comment 'mime type of resource'; + +create table config ( + + section varchar(32) comment 'configuration section', + setting varchar(32) comment 'configuration setting', + value varchar(255) comment 'configuration value', + + constraint primary key (section, setting) + +) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin; + +create table user_role ( + + user_id integer not null comment 'user having the role' references user (id), + role varchar(32) not null comment 'string representing the role', + created datetime not null comment 'date the role was granted', + + constraint primary key (user_id, role) + +) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin; diff --git a/db/08to09_pg.sql b/db/08to09_pg.sql index 892df4a39..9e37314aa 100644 --- a/db/08to09_pg.sql +++ b/db/08to09_pg.sql @@ -1,2 +1,40 @@ -// SQL commands to update an 0.8.x version of Laconica -// to 0.9.x. +-- SQL commands to update an 0.8.x version of Laconica +-- to 0.9.x. + +--these are just comments +/* +alter table notice + modify column content text comment 'update content'; + +alter table message + modify column content text comment 'message content'; + +alter table profile + modify column bio text comment 'descriptive biography'; + +alter table user_group + modify column description text comment 'group description'; +*/ + +alter table file_oembed + add column mimetype varchar(50) /*comment 'mime type of resource'*/; + +create table config ( + + section varchar(32) /* comment 'configuration section'*/, + setting varchar(32) /* comment 'configuration setting'*/, + value varchar(255) /* comment 'configuration value'*/, + + primary key (section, setting) + +); + +create table user_role ( + + user_id integer not null /* comment 'user having the role'*/ references "user" (id), + role varchar(32) not null /* comment 'string representing the role'*/, + created timestamp /* not null comment 'date the role was granted'*/, + + primary key (user_id, role) + +); diff --git a/db/laconica.sql b/db/statusnet.sql index 1662ef7a8..221d60ce3 100644 --- a/db/laconica.sql +++ b/db/statusnet.sql @@ -450,6 +450,7 @@ create table file_oembed ( file_id integer primary key comment 'oEmbed for that URL/file' references file (id), version varchar(20) comment 'oEmbed spec. version', type varchar(20) comment 'oEmbed type: photo, video, link, rich', + mimetype varchar(50) comment 'mime type of resource', provider varchar(50) comment 'name of this oEmbed provider', provider_url varchar(255) comment 'URL of this oEmbed provider', width integer comment 'width of oEmbed resource when available', @@ -557,3 +558,13 @@ create table config ( constraint primary key (section, setting) ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin; + +create table user_role ( + + user_id integer not null comment 'user having the role' references user (id), + role varchar(32) not null comment 'string representing the role', + created datetime not null comment 'date the role was granted', + + constraint primary key (user_id, role) + +) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin; diff --git a/db/laconica_pg.sql b/db/statusnet_pg.sql index b5626d3f4..672877ddf 100644 --- a/db/laconica_pg.sql +++ b/db/statusnet_pg.sql @@ -465,6 +465,7 @@ create table file_oembed ( file_id bigint default nextval('file_oembed_seq') primary key /* comment 'unique identifier' */, version varchar(20), type varchar(20), + mimetype varchar(50), provider varchar(50), provider_url varchar(255), width integer, @@ -548,3 +549,23 @@ create index noticecontent_idx on notice using gist(to_tsvector('english',conten create trigger textsearchupdate before insert or update on profile for each row execute procedure tsvector_update_trigger(textsearch, 'pg_catalog.english', nickname, fullname, location, bio, homepage); + +create table config ( + + section varchar(32) /* comment 'configuration section'*/, + setting varchar(32) /* comment 'configuration setting'*/, + value varchar(255) /* comment 'configuration value'*/, + + primary key (section, setting) + +); + +create table user_role ( + + user_id integer not null /* comment 'user having the role'*/ references "user" (id), + role varchar(32) not null /* comment 'string representing the role'*/, + created timestamp /* not null comment 'date the role was granted'*/, + + primary key (user_id, role) + +); |