pg migration
This commit is contained in:
5
backend/build.rs
Normal file
5
backend/build.rs
Normal 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");
|
||||
}
|
||||
1
backend/migrations/20221126181131_pg_rt_name.down.sql
Normal file
1
backend/migrations/20221126181131_pg_rt_name.down.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- Add down migration script here
|
||||
6
backend/migrations/20221126181131_pg_rt_name.up.sql
Normal file
6
backend/migrations/20221126181131_pg_rt_name.up.sql
Normal 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';
|
||||
Reference in New Issue
Block a user