Schema - Anthony-E-Cruz/Pinspiration GitHub Wiki
Database Schema
users
| column Name | data Type | details |
|---|---|---|
| id | integer | not null, primary key |
| username | string | not null, indexed, unique |
| string | not null, indexed, unique | |
| password_digest | string | not null |
| session_token | string | not null, indexed, unique |
- indexed on username, unique: true
- indexed on email, unique: true
- indexed on session_token, unique: true
boards
| column Name | data Type | details |
|---|---|---|
| id | integer | not null, primary key |
| title | string | not null, unique |
| description | string | not null |
| creator_id | integer | not null, unique, indexed, foreign key |
| private | boolean | not null |
- creator_id references users
- indexed on creator_id
pins
| column Name | data Type | details |
|---|---|---|
| id | integer | not null, primary key |
| title | string | not null, unique |
| description | string | not null |
| uploader_id | integer | not null, indexed, foreign key |
| board_id | array | length: {minimum: 1}, indexed, foreign key |
- creator_id references users
- collage_id references collages
- indexed on [:uploader_id, :collage_id], unique: true