Skip to content
Americo edited this page Apr 23, 2018 · 8 revisions

Schema Information

Users

column name details
id not null, primary key
username not null
imageUrl not null
firstName not null
lastName not null
auth columns not null
activeDrafts object { draftId, projectId }

Saves

column name details
id not null, primary key
userId not null, foreign key (references users table)
previousSaveId not null, foreign key (references saves table)
comment not null
projectId not null, foreign key (references projects table)
draftId not null, foreign key (references drafts table)
createdAt not null
isAuto notNull, boolean
revisionIds array of revision ids (references revisions table)

Revisions

column name details
id not null, primary key
body not null (object from draftJS)
documentId not null, foreign key (references documents table)
userId not null, foreign key (references users table)
saveId not null, foreign key (references saves table), indexed
createdAt not null

Documents

column name details
id not null, primary key
name not null

Drafts

column name details
id not null, primary key
name not null
projectId not null, foreign key (references projects table), indexed
saves array of ids (references saves table)
documentOrder ordered array of ids (references documents table)

Projects

column name details
id not null, primary key
name not null
owner not null, foreign key (references users table)
canEdit array of ids (references users table)
canView array of ids (references users table)
Clone this wiki locally