Closed Lucca-Sidey closed 6 months ago
If I have this correct, a table is created when a user creates an account? Is there anything in there to prevent this happening for admin sign up as a timetable is not required? Not fully across alembic.
I am unsure at the moment as i can only login as admin. Something that we need to check.
My understanding is that the migration file allows us to manage our databases effectively while also storing versions at each change point in the case that it doesn't work. My intention is not to create a new table every time a new user is added, but to just add the 'Messages' table once and then ensure that that table is in relation to the 'User' table and stores all messages related to that user
The 3 bash lines in the previous comment automatically created the migration folder with all of the files in it in once swoop. I first added the class 'Message' to the models.py a did the initial migration. I needed to go back and change the Messages to allow for threading and users to comment multiple times on a thread, which i then did a second migrated and upgraded.(version not yet pushed). Seems to work on my end.
I could be widely misinformed so please feel free to educate and ill change accordingly
Okay, thank you for the clarification!
In this commit......
created the migrations folder through bash('export FLASK_APP=src', 'flask --app src db init','flask db migrate -m "Initial migration.") This new folder allows us to handle changes in the database schema eg: create new tables, alter. Needed it to create the 'Message' Table for the Message Board, This should also allow us to manage the database for time table when we get to it.
fixed some syntax errors in the 'Message_Board.js'
Some other minor changes to message_board.html