pg migration

This commit is contained in:
Ruben Fiszel
2022-11-26 19:39:37 +01:00
parent 3f728b35ea
commit ce3f2cc71f
3 changed files with 12 additions and 0 deletions

5
backend/build.rs Normal file
View File

@@ -0,0 +1,5 @@
// generated by `sqlx migrate build-script`
fn main() {
// trigger recompilation when a new migration is added
println!("cargo:rerun-if-changed=migrations");
}

View File

@@ -0,0 +1 @@
-- Add down migration script here

View File

@@ -0,0 +1,6 @@
-- Add up migration script here
UPDATE resource_type rt SET name = 'postgresql' WHERE name = 'postgres' AND NOT EXISTS (
SELECT 1 FROM resource_type WHERE name = 'postgresql' AND rt.workspace_id = workspace_id
);
UPDATE resource SET resource_type = 'postgresql' WHERE resource_type = 'postgres';