Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create table AccountTypes(
- id int primary key identity(0,1),
- name varchar(13) unique,
- canPost bit,
- canEditOtherPosts bit,
- canMute bit,
- canBan bit,
- canReport bit,
- canModerateUser bit,
- canViewDms bit,
- canMoveThread bit,
- canModifyTopics bit,
- canPromoteUser bit,
- canPromoteToAdmin bit,
- )
- insert into AccountTypes values ('ban', 0, 0, 0,0,0,0,0, 0,0, 0,0)
- insert into AccountTypes values ('basic', 1, 0, 0,0,1,0,0, 0,0, 0,0)
- insert into AccountTypes values ('trusted', 1, 0, 0,0,1,0,0, 0,0, 0,0)
- insert into AccountTypes values ('basic-admin', 1, 1, 1,0,1,0,0, 0,0, 0,0)
- insert into AccountTypes values ('admin', 1, 1, 1,1,1,0,0, 0,0, 0,0)
- insert into AccountTypes values ('trusted-admin',1, 1, 1,1,1,0,1, 0,0, 0,0)
- insert into AccountTypes values ('super-admin', 1, 1, 1,1,1,1,1, 1,1, 1,1)
- insert into AccountTypes values ('developer', 1, 1, 1,1,1,1,0, 1,0, 1,0)
- insert into AccountTypes values ('co-owner', 1, 1, 1,1,1,1,0, 1,0, 1,0)
- insert into AccountTypes values ('owner', 1, 1, 1,1,1,1,1, 1,1, 1,1)
- create table UserMetadata(
- id int primary key identity(0,1),
- name varchar,
- descript varchar
- )
- create table Users(
- id int primary key identity(0,1),
- gId char(21) unique, /*google login id*/
- lang nvarchar(5),
- img nvarchar(512), /* user icon*/
- email nvarchar(320),
- nick nvarchar(32) unique, /* nickname - defaults to google name + if duplicat a hash*/
- gName nvarchar(128),
- banner nvarchar(256),
- descipt nvarchar(2048),
- hoby nvarchar(32),
- note nvarchar(32),
- lastAct date, /* last time active*/
- joined date, /* account creation date */
- acType int foreign key references AccountTypes(id) default 1 /* type of user */
- )
- create table Topics(
- name varchar,
- broadTopic varchar,
- icon varchar,
- )
- create table Threads(
- id int primary key identity(0,1),
- title nvarchar,
- op int foreign key references Users(id),
- creation date,
- lastPost date,
- visible bit default 1
- )
- create table Posts(
- id int primary key identity(0,1),
- thread int foreign key references Threads(id),
- author int foreign key references Users(id),
- creation date,
- lastPost date,
- data nvarchar(2048),
- visible bit default 1
- )
- create table Notifications(
- usr int foreign key references Users(id),
- thread int foreign key references Threads(id),
- )
- create table DmThread(
- usr1 int foreign key references Users(id),
- usr2 int foreign key references Users(id)
- )
- create table DmMsg50(
- id int primary key identity(0,1),
- data nvarchar /* blobs of 50 messages in json format*/
- )
Add Comment
Please, Sign In to add comment