-
Notifications
You must be signed in to change notification settings - Fork 0
Schema
Colin Eckert edited this page Jan 31, 2021
·
8 revisions
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
string | not null, indexed, unique | |
full_name | string | |
password_digest | string | not null |
session_token | string | not null, indexed, unique |
created_at | datetime | not null |
updated_at | datetime | not null |
- index on
email, unique: true
- index on
session_token, unique: true
- has many
notes
throughnotebooks
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
title | string | not null |
body | text | not null |
notebook_id | integer | not null, indexed, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |
-
notebook_id
referencesnotebooks
- index on
notebook_id
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
name | string | not null, unique, indexed |
author_id | integer | not null, indexed, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |
-
author_id
referencesusers
- index on
[:name, :author_id], unique: true
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
name | string | not null, unique, indexed |
author_id | integer | not null, indexed, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |
-
author_id
referencesusers
- index on
[:name, :author_id], unique: true
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
note_id | integer | not null, indexed, foreign key |
tag_id | integer | not null, indexed, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |
-
note_id
referencesnotes
-
tag_id
referencestags
- index on
[:note_id, :tag_id], unique: true