Supporting adjust volume size & pre-update backups.
This commit is contained in:
12
src/db.scm
12
src/db.scm
@@ -230,6 +230,7 @@ returning users.user_id;"
|
||||
(digitalocean-api-token . ("digitalocean_api_token_enc" #t))
|
||||
(digitalocean-region . ("digitalocean_region" #f))
|
||||
(digitalocean-size . ("digitalocean_size" #f))
|
||||
(digitalocean-volume-size . ("digitalocean_volume_size" #f))
|
||||
(backblaze-application-key . ("backblaze_application_key_enc" #t))
|
||||
(backblaze-key-id . ("backblaze_key_id_enc" #t))
|
||||
(backblaze-bucket-url . ("backblaze_bucket_url_enc" #t))))
|
||||
@@ -416,6 +417,11 @@ returning users.user_id;"
|
||||
(custom-image . "terraform_custom_image")
|
||||
(machine-create . "terraform_machine_create")
|
||||
(machine-destroy . "terraform_machine_destroy")
|
||||
(ip-create . "terraform_ip_create")
|
||||
(ip-destroy . "terraform_ip_destroy")
|
||||
(volume-create . "terraform_volume_create")
|
||||
(volume-destroy . "terraform_volume_destroy")
|
||||
(instance-backup . "instance_backup")
|
||||
(status . "status")
|
||||
(id . "id")
|
||||
(instance-id . "instance_id")))
|
||||
@@ -621,13 +627,15 @@ returning users.user_id;"
|
||||
;; The "up" file is called to run the migration and the "down" file is called to
|
||||
;; "undo" the migration.
|
||||
(define *migrations*
|
||||
'((0 . "adding-instance-control-app")))
|
||||
'((0 . "adding-instance-control-app")
|
||||
(1 . "adding-service-config-digitalocean-volume-size")
|
||||
(2 . "adding-deployments-instance-backup")))
|
||||
|
||||
(define (run-pending-migrations conn)
|
||||
(let* ((migration-ids (sort (map car *migrations*) <))
|
||||
(migration-rows (query conn "select migration_id from migrations;"))
|
||||
(applied-migration-ids (if (> (row-count migration-rows) 0)
|
||||
(row-values migration-rows)
|
||||
(column-values migration-rows)
|
||||
'())))
|
||||
(for-each
|
||||
(lambda (id)
|
||||
|
||||
Reference in New Issue
Block a user