diff --git a/capsulflask/db.py b/capsulflask/db.py index f6e1d40..d74a526 100644 --- a/capsulflask/db.py +++ b/capsulflask/db.py @@ -50,7 +50,7 @@ def init_app(app, is_running_server): hasSchemaVersionTable = False actionWasTaken = False schemaVersion = 0 - desiredSchemaVersion = 21 + desiredSchemaVersion = 22 cursor = connection.cursor() diff --git a/capsulflask/schema_migrations/22_down_os_updates.sql b/capsulflask/schema_migrations/22_down_os_updates.sql new file mode 100644 index 0000000..cd51e0f --- /dev/null +++ b/capsulflask/schema_migrations/22_down_os_updates.sql @@ -0,0 +1,8 @@ +DELETE FROM os_images WHERE id = 'rockylinux'; +DELETE FROM os_images WHERE id = 'alpine315'; +DELETE FROM os_images WHERE id = 'debian11'; + +UPDATE os_images SET deprecated = FALSE WHERE id = 'debian10'; +UPDATE os_images SET deprecated = FALSE WHERE id = 'alpine313'; + +UPDATE schemaversion SET version = 21; diff --git a/capsulflask/schema_migrations/22_up_os_updates.sql b/capsulflask/schema_migrations/22_up_os_updates.sql new file mode 100644 index 0000000..cc24f2a --- /dev/null +++ b/capsulflask/schema_migrations/22_up_os_updates.sql @@ -0,0 +1,13 @@ +INSERT INTO os_images (id, template_image_file_name, description, deprecated) +VALUES ('rockylinux', 'rockylinux/8/root.img.qcow2', 'Rocky Linux 8', FALSE); + +INSERT INTO os_images (id, template_image_file_name, description, deprecated) +VALUES ('alpine315', 'alpine/3.15/root.img.qcow2', 'Alpine Linux 3.15', FALSE); + +INSERT INTO os_images (id, template_image_file_name, description, deprecated) +VALUES ('debian11', 'debian/11/root.img.qcow2', 'Debian 11 (bullseye)', FALSE); + +UPDATE os_images SET deprecated = TRUE WHERE id = 'debian10'; +UPDATE os_images SET deprecated = TRUE WHERE id = 'alpine313'; + +UPDATE schemaversion SET version = 22;