|
| 1 | +create table Compliance |
| 2 | +( |
| 3 | + ComplianceID int auto_increment |
| 4 | + primary key, |
| 5 | + UserID bigint not null, |
| 6 | + Category int not null, |
| 7 | + OptedIn tinyint(1) not null, |
| 8 | + DecidedAt timestamp(6) default current_timestamp(6) not null, |
| 9 | + constraint Compliance_UserID_Category_unique |
| 10 | + unique (UserID, Category) |
| 11 | +); |
| 12 | + |
| 13 | +create table ServerConfigs |
| 14 | +( |
| 15 | + ServerID bigint not null |
| 16 | + primary key, |
| 17 | + LogChannelID bigint null, |
| 18 | + LogJoin tinyint(1) default 0 not null, |
| 19 | + LogLeave tinyint(1) default 0 not null, |
| 20 | + LogKick tinyint(1) default 0 not null, |
| 21 | + LogBan tinyint(1) default 0 not null, |
| 22 | + LogNameChange tinyint(1) default 0 not null, |
| 23 | + LogPurge tinyint(1) default 0 not null, |
| 24 | + SelectableRolesLimit int default 1 not null, |
| 25 | + StarboardEnabled tinyint(1) default 0 not null, |
| 26 | + StarboardChannelID bigint null, |
| 27 | + StarboardEmoji varchar(32) default 'star' not null, |
| 28 | + StarboardThreshold int default 1 not null, |
| 29 | + StarboardAllowSelfStar tinyint(1) default 0 not null, |
| 30 | + QuickviewFuraffinityEnabled tinyint(1) default 1 not null, |
| 31 | + QuickviewFuraffinityThumbnail tinyint(1) default 1 not null, |
| 32 | + QuickviewPicartoEnabled tinyint(1) default 1 not null, |
| 33 | + WikiMinQuality int default 50 not null, |
| 34 | + constraint check_ServerConfigs_0 |
| 35 | + check (`SelectableRolesLimit` = -1 or `SelectableRolesLimit` >= 1), |
| 36 | + constraint check_ServerConfigs_1 |
| 37 | + check (`StarboardThreshold` >= 1), |
| 38 | + constraint check_ServerConfigs_2 |
| 39 | + check (`WikiMinQuality` between 0 and 100) |
| 40 | +); |
| 41 | + |
| 42 | +create table ServerSelectableRoles |
| 43 | +( |
| 44 | + ServerID bigint not null, |
| 45 | + RoleID bigint not null, |
| 46 | + constraint ServerSelectableRoles_ServerID_RoleID_unique |
| 47 | + unique (ServerID, RoleID), |
| 48 | + constraint fk_ServerSelectableRoles_ServerID__ServerID |
| 49 | + foreign key (ServerID) references ServerConfigs (ServerID) |
| 50 | + on update cascade on delete cascade |
| 51 | +); |
| 52 | + |
| 53 | +create table ServerWikiSources |
| 54 | +( |
| 55 | + ServerID bigint not null, |
| 56 | + Destination varchar(100) not null, |
| 57 | + constraint ServerWikiSources_ServerID_Destination_unique |
| 58 | + unique (ServerID, Destination), |
| 59 | + constraint fk_ServerWikiSources_ServerID__ServerID |
| 60 | + foreign key (ServerID) references ServerConfigs (ServerID) |
| 61 | + on update cascade on delete cascade |
| 62 | +); |
0 commit comments