]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - db/08to09.sql
Create new field in consumer table in 08to09.sql
[quix0rs-gnu-social.git] / db / 08to09.sql
1 alter table notice
2      modify column content text comment 'update content',
3      add column lat decimal(10,7) comment 'latitude',
4      add column lon decimal(10,7) comment 'longitude',
5      add column location_id integer comment 'location id if possible',
6      add column location_ns integer comment 'namespace for location',
7      add column repeat_of integer comment 'notice this is a repeat of' references notice (id),
8      drop index notice_profile_id_idx,
9      add index notice_profile_id_idx (profile_id,created,id),
10      add index notice_repeatof_idx (repeat_of);
11
12 alter table message
13      modify column content text comment 'message content';
14
15 alter table profile
16      modify column bio text comment 'descriptive biography',
17      add column lat decimal(10,7) comment 'latitude',
18      add column lon decimal(10,7) comment 'longitude',
19      add column location_id integer comment 'location id if possible',
20      add column location_ns integer comment 'namespace for location';
21
22 alter table user_group
23      modify column description text comment 'group description';
24
25 alter table file_oembed
26      add column mimetype varchar(50) comment 'mime type of resource';
27
28 alter table fave
29     drop index fave_user_id_idx,
30     add index fave_user_id_idx (user_id,modified);
31
32 alter table subscription
33     drop index subscription_subscriber_idx,
34     add index subscription_subscriber_idx (subscriber,created),
35     drop index subscription_subscribed_idx,
36     add index subscription_subscribed_idx (subscribed,created);
37
38 create table deleted_notice (
39
40     id integer primary key comment 'identity of notice',
41     profile_id integer not null comment 'author of the notice',
42     uri varchar(255) unique key comment 'universally unique identifier, usually a tag URI',
43     created datetime not null comment 'date the notice record was created',
44     deleted datetime not null comment 'date the notice record was created',
45
46     index deleted_notice_profile_id_idx (profile_id)
47
48 ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
49
50 create table config (
51
52     section varchar(32) comment 'configuration section',
53     setting varchar(32) comment 'configuration setting',
54     value varchar(255) comment 'configuration value',
55
56     constraint primary key (section, setting)
57
58 ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
59
60 create table profile_role (
61
62     profile_id integer not null comment 'account having the role' references profile (id),
63     role    varchar(32) not null comment 'string representing the role',
64     created datetime not null comment 'date the role was granted',
65
66     constraint primary key (profile_id, role)
67
68 ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
69
70 create table location_namespace (
71
72     id integer primary key comment 'identity for this namespace',
73     description varchar(255) comment 'description of the namespace',
74     created datetime not null comment 'date the record was created',
75     modified timestamp comment 'date this record was modified'
76
77 ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
78
79 create table login_token (
80     user_id integer not null comment 'user owning this token' references user (id),
81     token char(32) not null comment 'token useable for logging in',
82     created datetime not null comment 'date this record was created',
83     modified timestamp comment 'date this record was modified',
84
85     constraint primary key (user_id)
86 ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
87
88 create table user_location_prefs (
89     user_id integer not null comment 'user who has the preference' references user (id),
90     share_location tinyint default 1 comment 'Whether to share location data',
91     created datetime not null comment 'date this record was created',
92     modified timestamp comment 'date this record was modified',
93
94     constraint primary key (user_id)
95 ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
96
97 create table queue_item_new (
98     id integer auto_increment primary key comment 'unique identifier',
99     frame blob not null comment 'data: object reference or opaque string',
100     transport varchar(8) not null comment 'queue for what? "email", "jabber", "sms", "irc", ...',
101     created datetime not null comment 'date this record was created',
102     claimed datetime comment 'date this item was claimed',
103
104     index queue_item_created_idx (created)
105
106 ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
107
108 insert into queue_item_new (frame,transport,created,claimed)
109     select notice_id,transport,created,claimed from queue_item;
110 alter table queue_item rename to queue_item_old;
111 alter table queue_item_new rename to queue_item;
112
113 alter table consumer
114     add column  consumer_secret varchar(255) not null comment 'secret value';
115
116 create table oauth_application (
117     id integer auto_increment primary key comment 'unique identifier',
118     owner integer not null comment 'owner of the application' references profile (id),
119     consumer_key varchar(255) not null comment 'application consumer key' references consumer (consumer_key),
120     name varchar(255) not null comment 'name of the application',
121     description varchar(255) comment 'description of the application',
122     icon varchar(255) not null comment 'application icon',
123     source_url varchar(255) comment 'application homepage - used for source link',
124     organization varchar(255) comment 'name of the organization running the application',
125     homepage varchar(255) comment 'homepage for the organization',
126     callback_url varchar(255) comment 'url to redirect to after authentication',
127     type tinyint default 0 comment 'type of app, 1 = browser, 2 = desktop',
128     access_type tinyint default 0 comment 'default access type, bit 1 = read, bit 2 = write',
129     created datetime not null comment 'date this record was created',
130     modified timestamp comment 'date this record was modified'
131 ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
132
133 create table oauth_application_user (
134     profile_id integer not null comment 'user of the application' references profile (id),
135     application_id integer not null comment 'id of the application' references oauth_application (id),
136     access_type tinyint default 0 comment 'access type, bit 1 = read, bit 2 = write, bit 3 = revoked',
137     token varchar(255) comment 'request or access token',
138     created datetime not null comment 'date this record was created',
139     modified timestamp comment 'date this record was modified',
140     constraint primary key (profile_id, application_id)
141 ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
142
143