mirror of https://github.com/zer0bin-dev/zer0bin
♻️ refactor: migrate note
This commit is contained in:
parent
fab8762c1e
commit
622c93cab4
|
@ -32,6 +32,15 @@ pub struct AppState {
|
|||
pub async fn migrations(pool: &PgPool) -> Result<(), sqlx::Error> {
|
||||
let migrator = Migrator::new(Path::new("./migrations")).await?;
|
||||
|
||||
/*
|
||||
|
||||
To move database over to SQLx managed migrations do the following:
|
||||
|
||||
1. Run `ALTER TABLE pastes RENAME TO old_pastes` in PSQL
|
||||
2. Start the backend to create the new managed tables
|
||||
3. Run `INSERT INTO pastes SELECT * from old_pastes;` and `DROP TABLE old_pastes;` in PSQL
|
||||
*/
|
||||
|
||||
// TODO: This is a hacky solution but it works for now
|
||||
// it doesnt work lol
|
||||
// if let Err(e) = migrator.run(pool).await {
|
||||
|
|
Loading…
Reference in New Issue