You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We'll need a roles table if we're going to have users with different permissions.
The roles table should have two fields:
rid for role id
name for the role name
This should be similar to the createUsersTable and it should also be run in db-setup.ts. Some things to note:
Currently quiz_db.sql sets up all the tables and is setup to run once when used with the docker-compose.yml setup. We could choose to maintain this and re-create this SQL dump but existing docker containers won't update themselves. Therefore running npm run db-setup is necessary if the database schema expectation changes.
Probably best to create the function in db/roles.ts
Create tests to check proper creation of table in tests/roles.test.ts. See users.test.ts.
Handle the case for when the table already exists
The text was updated successfully, but these errors were encountered:
We'll need a roles table if we're going to have users with different permissions.
The roles table should have two fields:
rid
for role idname
for the role nameThis should be similar to the
createUsersTable
and it should also be run indb-setup.ts
. Some things to note:quiz_db.sql
sets up all the tables and is setup to run once when used with thedocker-compose.yml
setup. We could choose to maintain this and re-create this SQL dump but existing docker containers won't update themselves. Therefore runningnpm run db-setup
is necessary if the database schema expectation changes.db/roles.ts
tests/roles.test.ts
. Seeusers.test.ts
.The text was updated successfully, but these errors were encountered: