From 3639a295c4263515ce5bfda2ec2fcfa3e273888a Mon Sep 17 00:00:00 2001 From: j3s Date: Mon, 1 Feb 2021 10:59:13 -0600 Subject: [PATCH 1/2] Add coreos --- capsulflask/db.py | 2 +- capsulflask/schema_migrations/13_down_coreos.sql | 3 +++ capsulflask/schema_migrations/13_up_coreos.sql | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 capsulflask/schema_migrations/13_down_coreos.sql create mode 100644 capsulflask/schema_migrations/13_up_coreos.sql diff --git a/capsulflask/db.py b/capsulflask/db.py index b0e9a0d..a75663f 100644 --- a/capsulflask/db.py +++ b/capsulflask/db.py @@ -42,7 +42,7 @@ def init_app(app): hasSchemaVersionTable = False actionWasTaken = False schemaVersion = 0 - desiredSchemaVersion = 12 + desiredSchemaVersion = 13 cursor = connection.cursor() diff --git a/capsulflask/schema_migrations/13_down_coreos.sql b/capsulflask/schema_migrations/13_down_coreos.sql new file mode 100644 index 0000000..7ae6ee7 --- /dev/null +++ b/capsulflask/schema_migrations/13_down_coreos.sql @@ -0,0 +1,3 @@ +DELETE FROM os_images WHERE id = 'coreos'; + +UPDATE schemaversion SET version = 12; diff --git a/capsulflask/schema_migrations/13_up_coreos.sql b/capsulflask/schema_migrations/13_up_coreos.sql new file mode 100644 index 0000000..5d8928c --- /dev/null +++ b/capsulflask/schema_migrations/13_up_coreos.sql @@ -0,0 +1,4 @@ +INSERT INTO os_images (id, template_image_file_name, description, deprecated) +VALUES ('coreos', 'coreos/stable/root.img.qcow2', 'Fedora CoreOS Stable', FALSE); + +UPDATE schemaversion SET version = 13; From 4b3f3603cccfd4a849bda0f56f99439de3cdd20d Mon Sep 17 00:00:00 2001 From: j3s Date: Mon, 1 Feb 2021 12:27:22 -0600 Subject: [PATCH 2/2] CoreOS isnt ready --- capsulflask/db.py | 2 +- capsulflask/schema_migrations/14_down_coreos_notready.sql | 3 +++ capsulflask/schema_migrations/14_up_cores_notready.sql | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 capsulflask/schema_migrations/14_down_coreos_notready.sql create mode 100644 capsulflask/schema_migrations/14_up_cores_notready.sql diff --git a/capsulflask/db.py b/capsulflask/db.py index a75663f..411678b 100644 --- a/capsulflask/db.py +++ b/capsulflask/db.py @@ -42,7 +42,7 @@ def init_app(app): hasSchemaVersionTable = False actionWasTaken = False schemaVersion = 0 - desiredSchemaVersion = 13 + desiredSchemaVersion = 14 cursor = connection.cursor() diff --git a/capsulflask/schema_migrations/14_down_coreos_notready.sql b/capsulflask/schema_migrations/14_down_coreos_notready.sql new file mode 100644 index 0000000..0edd12b --- /dev/null +++ b/capsulflask/schema_migrations/14_down_coreos_notready.sql @@ -0,0 +1,3 @@ +UPDATE os_images SET deprecated = FALSE WHERE id = 'coreos'; + +UPDATE schemaversion SET version = 13; diff --git a/capsulflask/schema_migrations/14_up_cores_notready.sql b/capsulflask/schema_migrations/14_up_cores_notready.sql new file mode 100644 index 0000000..539d09c --- /dev/null +++ b/capsulflask/schema_migrations/14_up_cores_notready.sql @@ -0,0 +1,3 @@ +UPDATE os_images SET deprecated = TRUE WHERE id = 'coreos'; + +UPDATE schemaversion SET version = 14;