-
Notifications
You must be signed in to change notification settings - Fork 0
add initial version of DB schema #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
| ```sql | ||
| CREATE TABLE person ( | ||
| id SERIAL PRIMARY KEY, | ||
| login VARCHAR(20) NOT NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about using login, name and email together
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? what wrong with it?
| id SERIAL PRIMARY KEY, | ||
| login VARCHAR(20) NOT NULL, | ||
| name VARCHAR(35) NOT NULL, | ||
| email VARCHAR(35) UNIQUE NOT NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use 64 length for login, name, and email
| avatar_url VARCHAR | ||
| ); | ||
|
|
||
| CREATE TABLE organization ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks pretty similar to person table
| CREATE TABLE membership ( | ||
| organization_id INT REFERENCES organization(id), | ||
| person_id INT REFERENCES person(id), | ||
| role VARCHAR CHECK (role IN ('owner', 'member')), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
owner or admin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
admin sounds reasonable and better
| id SERIAL PRIMARY KEY, | ||
| title VARCHAR(30) NOT NULL, | ||
| description VARCHAR NOT NULL, | ||
| location VARCHAR(50), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
location can be a list of available location
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it can be, but for now it will be simple text, that user type by hands
| CONSTRAINT applicant_id PRIMARY KEY (vacancy_id, person_id) | ||
| ); | ||
|
|
||
| CREATE TABLE test ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test or quiz?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, quiz suits better
ok2ju
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are some comments at this MR
in progress