sphericle / TheClicksyncChallengeList

now open source!
MIT License
1 stars 1 forks source link

resync database migrations #13

Open sphericle opened 2 months ago

sphericle commented 2 months ago

alright so the ../migrations are dumb and stupid and broken rn because i didn't know how databases worked and added things at will without using migrations lmao! so we need to figure out how to reset these migrations and have them be able to run from cli and through deployments with no problem. but we can't actually re run them, because if we try to make a new table, for example, the table will already exist and it will fail. obviously we can't remove the table because yeah.

sphericle commented 2 months ago

maybe we could replace all that with one single CREATE script from pgadmin (not sure what that does and also it might still be broken....) which would in theory build the database schema the way we want it to. and when we run a command to create the db we can use IF NOT EXISTS, which will skip creating the database if we already have one, but won't fail either.

sphericle commented 2 months ago

this is probably what i'm looking for

sphericle commented 2 months ago

uh nvm

sphericle commented 2 months ago

pray

sphericle commented 2 months ago

https://github.com/stadust/pointercrate-migration/blob/master/2023-01-07-160559_sqlx/up.sql

sphericle commented 2 months ago

alr here's how this should go:

sphericle commented 2 months ago

wtf .......