183 lines
3.7 KiB
Plaintext
183 lines
3.7 KiB
Plaintext
//// ------------------------------------------------------
|
|
//// THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
|
|
//// ------------------------------------------------------
|
|
|
|
Table Setting {
|
|
key String [pk]
|
|
value String [not null]
|
|
}
|
|
|
|
Table User {
|
|
sub String [pk]
|
|
display_name String
|
|
picture_url String
|
|
profile_url String
|
|
lastTimeGainStarted DateTime [default: `now()`, not null]
|
|
pixelStack Int [not null, default: 0]
|
|
undoExpires DateTime
|
|
isAdmin Boolean [not null, default: false]
|
|
isModerator Boolean [not null, default: false]
|
|
pixels Pixel [not null]
|
|
FactionMember FactionMember [not null]
|
|
Ban Ban
|
|
AuditLog AuditLog [not null]
|
|
IPAddress IPAddress [not null]
|
|
}
|
|
|
|
Table Instance {
|
|
id Int [pk, increment]
|
|
hostname String [unique, not null]
|
|
name String
|
|
logo_url String
|
|
banner_url String
|
|
Ban Ban
|
|
}
|
|
|
|
Table IPAddress {
|
|
ip String [not null]
|
|
userSub String [not null]
|
|
lastUsedAt DateTime [not null]
|
|
createdAt DateTime [default: `now()`, not null]
|
|
user User [not null]
|
|
|
|
indexes {
|
|
(ip, userSub) [pk]
|
|
}
|
|
}
|
|
|
|
Table PaletteColor {
|
|
id Int [pk, increment]
|
|
name String [not null]
|
|
hex String [unique, not null]
|
|
}
|
|
|
|
Table Pixel {
|
|
id Int [pk, increment]
|
|
userId String [not null]
|
|
x Int [not null]
|
|
y Int [not null]
|
|
color String [not null]
|
|
isTop Boolean [not null, default: false]
|
|
isModAction Boolean [not null, default: false]
|
|
createdAt DateTime [default: `now()`, not null]
|
|
deletedAt DateTime
|
|
user User [not null]
|
|
}
|
|
|
|
Table Faction {
|
|
id String [pk]
|
|
name String [not null]
|
|
image String
|
|
FactionMember FactionMember [not null]
|
|
FactionRole FactionRole [not null]
|
|
FactionSocial FactionSocial [not null]
|
|
FactionSetting FactionSetting [not null]
|
|
}
|
|
|
|
Table FactionMember {
|
|
id Int [pk, increment]
|
|
sub String [not null]
|
|
factionId String [not null]
|
|
user User [not null]
|
|
faction Faction [not null]
|
|
}
|
|
|
|
Table FactionRole {
|
|
id String [pk]
|
|
name String [not null]
|
|
level Int [not null]
|
|
factionId String [not null]
|
|
faction Faction [not null]
|
|
}
|
|
|
|
Table FactionSocial {
|
|
id String [pk]
|
|
factionId String [not null]
|
|
title String
|
|
url String [not null]
|
|
position Int [not null]
|
|
faction Faction [not null]
|
|
}
|
|
|
|
Table FactionSetting {
|
|
id String [pk]
|
|
factionId String [not null]
|
|
key String [not null]
|
|
value String [not null]
|
|
definition FactionSettingDefinition [not null]
|
|
faction Faction [not null]
|
|
}
|
|
|
|
Table FactionSettingDefinition {
|
|
id String [pk]
|
|
name String [not null]
|
|
type String [not null]
|
|
minimumLevel Int [not null]
|
|
FactionSetting FactionSetting [not null]
|
|
}
|
|
|
|
Table Ban {
|
|
id Int [pk, increment]
|
|
userId String [unique]
|
|
instanceId Int [unique]
|
|
privateNote String
|
|
publicNote String
|
|
expiresAt DateTime [not null]
|
|
createdAt DateTime [default: `now()`, not null]
|
|
updatedAt DateTime
|
|
user User
|
|
instance Instance
|
|
AuditLog AuditLog [not null]
|
|
}
|
|
|
|
Table AuditLog {
|
|
id Int [pk, increment]
|
|
userId String
|
|
action AuditLogAction [not null]
|
|
reason String
|
|
comment String
|
|
banId Int
|
|
createdAt DateTime [default: `now()`, not null]
|
|
updatedAt DateTime
|
|
user User
|
|
ban Ban
|
|
}
|
|
|
|
Enum AuditLogAction {
|
|
BAN_CREATE
|
|
BAN_UPDATE
|
|
BAN_DELETE
|
|
CANVAS_SIZE
|
|
CANVAS_FILL
|
|
CANVAS_FREEZE
|
|
CANVAS_UNFREEZE
|
|
CANVAS_AREA_UNDO
|
|
USER_MOD
|
|
USER_UNMOD
|
|
USER_ADMIN
|
|
USER_UNADMIN
|
|
}
|
|
|
|
Ref: IPAddress.userSub > User.sub
|
|
|
|
Ref: Pixel.userId > User.sub
|
|
|
|
Ref: FactionMember.sub > User.sub
|
|
|
|
Ref: FactionMember.factionId > Faction.id
|
|
|
|
Ref: FactionRole.factionId > Faction.id
|
|
|
|
Ref: FactionSocial.factionId > Faction.id
|
|
|
|
Ref: FactionSetting.key > FactionSettingDefinition.id
|
|
|
|
Ref: FactionSetting.factionId > Faction.id
|
|
|
|
Ref: Ban.userId - User.sub
|
|
|
|
Ref: Ban.instanceId - Instance.id
|
|
|
|
Ref: AuditLog.userId > User.sub
|
|
|
|
Ref: AuditLog.banId > Ban.id |