-
Notifications
You must be signed in to change notification settings - Fork 0
database schema
Arebiter edited this page Oct 21, 2021
·
27 revisions
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| string | not null, indexed, unique | |
| password_digest | string | not null |
| session_token | string | not null, indexed, unique |
| first_name | string | not null |
| last_name | string | not null |
| created_at | datetime | not null |
| updated_at | datetime | not null |
- index on username, unique:true
- index on email, unique: true
- index on session_token, unique true
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| host_id | integer | not null, indexed, foreign key |
| location | string | not null |
| start_time | datetime | not null |
| duration | float | not null |
| city_id | integer | not null, indexed, foreign key |
| created_at | datetime | not null |
| updated_at | datetime | not null |
- index on host_id, unique:true
- index on city_id, unique: true
- host_id references users table
- city_id references cities
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| name | string | not null, unique, indexed |
| created_at | datetime | not null |
| updated_at | datetime | not null |
- index on name, unique:true
to keep track of users attending a teatime
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| teatime_id | integer | not null, indexed, foreign key |
| user_id | integer | not null, indexed, foreign key |
| status | integer | not null |
| created_at | datetime | not null |
| updated_at | datetime | not null |
- index on teatime_id, unique:true
- index on user_id, unique: true
or?
- index on [teatime_id, user_id]. unique: true - this would need to be a unique combination
- teatime_id references TeaTime
- users_id references users table