File tree 3 files changed +16
-2
lines changed
add-instance-updater-lock
3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ use std::collections::BTreeMap;
17
17
///
18
18
/// This must be updated when you change the database schema. Refer to
19
19
/// schema/crdb/README.adoc in the root of this repository for details.
20
- pub const SCHEMA_VERSION : SemverVersion = SemverVersion :: new ( 60 , 0 , 0 ) ;
20
+ pub const SCHEMA_VERSION : SemverVersion = SemverVersion :: new ( 61 , 0 , 0 ) ;
21
21
22
22
/// List of all past database schema versions, in *reverse* order
23
23
///
@@ -29,6 +29,7 @@ static KNOWN_VERSIONS: Lazy<Vec<KnownVersion>> = Lazy::new(|| {
29
29
// | leaving the first copy as an example for the next person.
30
30
// v
31
31
// KnownVersion::new(next_int, "unique-dirname-with-the-sql-files"),
32
+ KnownVersion :: new( 61 , "add-instance-updater-lock" ) ,
32
33
KnownVersion :: new( 60 , "add-lookup-vmm-by-sled-id-index" ) ,
33
34
KnownVersion :: new( 59 , "enforce-first-as-default" ) ,
34
35
KnownVersion :: new( 58 , "insert-default-allowlist" ) ,
Original file line number Diff line number Diff line change
1
+ ALTER TABLE omicron .public .instance
2
+ ADD COLUMN IF NOT EXISTS updater_id UUID
3
+ DEFAULT null ,
4
+ ADD COLUMN IF NOT EXISTS updater_gen INT
5
+ NOT NULL DEFAULT 0 ;
Original file line number Diff line number Diff line change @@ -1002,7 +1002,15 @@ CREATE TABLE IF NOT EXISTS omicron.public.instance (
1002
1002
ncpus INT NOT NULL ,
1003
1003
memory INT NOT NULL ,
1004
1004
hostname STRING(63 ) NOT NULL ,
1005
- boot_on_fault BOOL NOT NULL DEFAULT false
1005
+ boot_on_fault BOOL NOT NULL DEFAULT false,
1006
+
1007
+ /* ID of the instance update saga that has locked this instance for
1008
+ * updating, if one exists. */
1009
+ updater_id UUID,
1010
+
1011
+ /* Generation of the instance updater lock */
1012
+ updater_gen INT NOT NULL
1013
+
1006
1014
);
1007
1015
1008
1016
-- Names for instances within a project should be unique
You can’t perform that action at this time.
0 commit comments