sphericle / TheClicksyncChallengeList

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

resync database migrations #13

Open sphericle opened 2 weeks ago

sphericle commented 2 weeks 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 weeks 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 weeks ago

this is probably what i'm looking for

sphericle commented 2 weeks ago

uh nvm

sphericle commented 1 week ago

pray

sphericle commented 1 week ago

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

sphericle commented 1 week ago

alr here's how this should go:

sphericle commented 1 week ago

wtf .......