diff --git a/backend/charm/src/charm.py b/backend/charm/src/charm.py index edd60b65..f847528d 100755 --- a/backend/charm/src/charm.py +++ b/backend/charm/src/charm.py @@ -113,6 +113,7 @@ def _migrate_database(self): logger.error(e.stdout) logger.error(e.stderr) self.unit.status = BlockedStatus("Database migration failed") + raise SystemExit(0) def _on_database_changed(self, event): self._migrate_database() diff --git a/backend/migrations/versions/2024_04_17_1118-624a270a03dc_add_template_id_to_test_case.py b/backend/migrations/versions/2024_04_17_1118-624a270a03dc_add_template_id_to_test_case.py index 8a0f74e3..f70758af 100644 --- a/backend/migrations/versions/2024_04_17_1118-624a270a03dc_add_template_id_to_test_case.py +++ b/backend/migrations/versions/2024_04_17_1118-624a270a03dc_add_template_id_to_test_case.py @@ -17,7 +17,10 @@ def upgrade() -> None: - op.add_column("test_case", sa.Column("template_id", sa.String(), nullable=False)) + op.add_column( + "test_case", + sa.Column("template_id", sa.String(), nullable=False, server_default=""), + ) def downgrade() -> None: