fix migration break

This commit is contained in:
Ruben Fiszel
2023-05-25 11:07:45 +02:00
parent f806b38071
commit 470650e504
3 changed files with 13 additions and 0 deletions

View File

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

View File

@@ -0,0 +1,11 @@
-- Add up migration script here
do
$$
BEGIN
IF (NOT EXISTS (SELECT workspace_id FROM script WHERE workspace_id = 'demo' UNION ALL SELECT workspace_id FROM flow WHERE workspace_id = 'demo' UNION ALL SELECT workspace_id FROM app WHERE workspace_id = 'demo'))
THEN
DELETE FROM workspace_invite WHERE workspace_id = 'demo';
END IF;
END
$$

View File

@@ -99,6 +99,7 @@ async fn main() -> anyhow::Result<()> {
};
if server_mode {
// migration code to avoid break
windmill_api::migrate_db(&db).await?;
}