Adds python file to setup database #6
Merged
w25tran
merged 2 commits from william/setup-db
into main
2 years ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'william/setup-db'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Also adds the DB file to gitignore
setup_db.py won't run properly if the table already exists.
Should I account for that possibility?
What's
active
?changed this line in version 3 of the diff
added 1 commit
b4a99602
- Add position column to links tableCompare with previous version
position
should also have a unique constraint: More info here: https://www.w3schools.com/sqL/sql_unique.aspchanged this line in version 4 of the diff
added 2 commits
28f1c680
- Add constraints to links table columns98dacb78
- Add check to see if links table already existsCompare with previous version
active
represents a bool value for whether we want the link to showresolved all threads
Is there a need to have a separate
active
column? If it's in the database, it should implicitly be shown. We can just remove it from the database if we want to hide it.On the other hand, it does provide us functionality to just hide certain links. What do you think @n3parikh?
If I call the script from the repo's root directory,
links.db
is created in the repo's root directory (i.e. near the frontend and backend folders). But if I call it from the backend folder, it creates alinks.db
in the backend folder (i.e. /backend/links.db)The suggestion above makes sure that links.db is always created inside the backend folder.
Good job! 💯
changed this line in version 5 of the diff
added 1 commit
676442ac
- Apply 1 suggestion(s) to 1 file(s)Compare with previous version
Would we ever run into a scenario where we want to keep an inactive event in the database in order to be able to access the number of clicks it had?
This is now accounted for.
I'm leaning towards removing it for now. If we need the feature later on, we can always add it back.
Can you turn this into exception, just so it's more obvious it's a "failure"?
Okay, let's drop the
active
column for now, and I'll create another task to add it if we decide we need it.Looks good overall! Just 2 things to change, and it should be good to merge after.
changed this line in version 6 of the diff
added 3 commits
3035b138
- Remove active column9e5bb54e
- Raise exception if links tables already exists288de5a4
- Merge remote-tracking branch 'refs/remotes/origin/william/setup-db' into william/setup-dbCompare with previous version
resolved all threads
Should be good now.
resolved all threads
added 2 commits
37b59ed4
- 1 commit from branchmain
89977d3c
- Merge branch 'main' into william/setup-dbCompare with previous version