]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - db/074to080_pg.sql
Merge branch 'master' of gitorious.org:statusnet/mainline into 0.9.x
[quix0rs-gnu-social.git] / db / 074to080_pg.sql
1 BEGIN;
2 create sequence design_seq;
3 create table design (
4     id bigint default nextval('design_seq') /* comment 'design ID'*/,
5     backgroundcolor integer /* comment 'main background color'*/ ,
6     contentcolor integer /*comment 'content area background color'*/ ,
7     sidebarcolor integer /*comment 'sidebar background color'*/ ,
8     textcolor integer /*comment 'text color'*/ ,
9     linkcolor integer /*comment 'link color'*/,
10     backgroundimage varchar(255) /*comment 'background image, if any'*/,
11     disposition int default 1 /*comment 'bit 1 = hide background image, bit 2 = display background image, bit 4 = tile background image'*/,
12     primary key (id)
13 );
14 alter table "user"
15      add column design_id integer references design(id);
16 alter table "user"
17      add column viewdesigns integer default 1;
18
19 alter table notice add column
20      conversation integer references notice (id);
21
22 create index notice_conversation_idx on notice(conversation);
23
24 alter table foreign_user
25      alter column id TYPE bigint;
26      
27 alter table foreign_user alter column id set not null;
28
29 alter table foreign_link
30      alter column foreign_id TYPE bigint;
31
32 alter table user_group
33       add column design_id integer;
34
35 /*attachments and URLs stuff */
36 create sequence file_seq;
37 create table file (
38     id bigint default nextval('file_seq') primary key /* comment 'unique identifier' */,
39     url varchar(255) unique, 
40     mimetype varchar(50), 
41     size integer, 
42     title varchar(255), 
43     date integer, 
44     protected integer,
45     filename text /* comment 'if a local file, name of the file' */,
46     modified timestamp default CURRENT_TIMESTAMP /* comment 'date this record was modified'*/
47 );
48
49 create sequence file_oembed_seq;
50 create table file_oembed (
51     file_id bigint default nextval('file_oembed_seq') primary key /* comment 'unique identifier' */,
52     version varchar(20),
53     type varchar(20),
54     provider varchar(50),
55     provider_url varchar(255),
56     width integer,
57     height integer,
58     html text,
59     title varchar(255),
60     author_name varchar(50), 
61     author_url varchar(255), 
62     url varchar(255) 
63 );
64
65 create sequence file_redirection_seq;
66 create table file_redirection (
67     url varchar(255) primary key, 
68     file_id bigint, 
69     redirections integer, 
70     httpcode integer
71 );
72
73 create sequence file_thumbnail_seq;
74 create table file_thumbnail (
75     file_id bigint primary key, 
76     url varchar(255) unique, 
77     width integer, 
78     height integer 
79 );
80 create sequence file_to_post_seq;
81 create table file_to_post (
82     file_id bigint, 
83     post_id bigint, 
84
85     primary key (file_id, post_id)
86 );
87
88
89 create table group_block (
90    group_id integer not null /* comment 'group profile is blocked from' */ references user_group (id),
91    blocked integer not null /* comment 'profile that is blocked' */references profile (id),
92    blocker integer not null /* comment 'user making the block'*/ references "user" (id),
93    modified timestamp /* comment 'date of blocking'*/ ,
94
95    primary key (group_id, blocked)
96 );
97
98 create table group_alias (
99
100    alias varchar(64) /* comment 'additional nickname for the group'*/ ,
101    group_id integer not null /* comment 'group profile is blocked from'*/ references user_group (id),
102    modified timestamp /* comment 'date alias was created'*/,
103    primary key (alias)
104
105 );
106 create index group_alias_group_id_idx on group_alias (group_id);
107
108 COMMIT;