Skip to content

Commit

Permalink
schema changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed May 20, 2024
1 parent 1efdae5 commit 943dfb2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions schema/crdb/add-instance-updater-lock/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE omicron.public.instance
ADD COLUMN IF NOT EXISTS updater_id UUID
DEFAULT null,
ADD COLUMN IF NOT EXISTS updater_gen INT
NOT NULL DEFAULT 0;
10 changes: 9 additions & 1 deletion schema/crdb/dbinit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,15 @@ CREATE TABLE IF NOT EXISTS omicron.public.instance (
ncpus INT NOT NULL,
memory INT NOT NULL,
hostname STRING(63) NOT NULL,
boot_on_fault BOOL NOT NULL DEFAULT false
boot_on_fault BOOL NOT NULL DEFAULT false,

/* ID of the instance update saga that has locked this instance for
* updating, if one exists. */
updater_id UUID,

/* Generation of the instance updater lock */
updater_gen INT NOT NULL

);

-- Names for instances within a project should be unique
Expand Down

0 comments on commit 943dfb2

Please sign in to comment.