Migrate database from sqlite to local postgres container #53
No reviewers
DevOpps/Owners
Labels
No labels
operations
simulator api
tests
web app
No milestone
No project
2 participants
Due date
No due date set.
Dependencies
No dependencies set
Reference
DevOpps/minitwit!53
Loading…
Reference in a new issue
No description provided.
Delete branch "36-migrate-new_database"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I swapped our local SQLite setup for a Postgres Docker container so our local dev environment actually matches our live server.
In docker-compose.yml: Added the postgres:15 container.
In Cargo.toml & main.rs: Switched SeaORM to the Postgres driver and removed the old SQLite table building code.
Take a look at it and see if its ok. After that in main we will need to migrate the actual data on the live server. I looked into it and a tool called pgloader looks good for this. It will aitomaticially translate and push our old SQLite .db file straight into the new Postgres database. However, if anyone knows a better tool, feel free to use that instead.
I actually don't have my SSH access set up for the live server right now. Could someone else handle running the pgloader migration once this is merged?
Fixed by #55