-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add instance ID column to migration table
- Loading branch information
Showing
9 changed files
with
266 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- shake hands with DANGER! | ||
DROP TABLE IF EXISTS omicron.public.migration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
-- A table of the states of current migrations. | ||
CREATE TABLE IF NOT EXISTS omicron.public.migration ( | ||
id UUID PRIMARY KEY, | ||
|
||
/* The ID of the instance that was migrated */ | ||
instance_id UUID NOT NULL, | ||
|
||
/* The time this migration record was created. */ | ||
time_created TIMESTAMPTZ NOT NULL, | ||
|
||
/* The time this migration record was deleted. */ | ||
time_deleted TIMESTAMPTZ, | ||
|
||
/* The state of the migration source */ | ||
source_state omicron.public.migration_state NOT NULL, | ||
|
||
/* The ID of the migration source Propolis */ | ||
source_propolis_id UUID NOT NULL, | ||
|
||
/* Generation number owned and incremented by the source sled-agent */ | ||
source_gen INT8 NOT NULL DEFAULT 1, | ||
|
||
/* Timestamp of when the source field was last updated. | ||
* | ||
* This is provided by the sled-agent when publishing a migration state | ||
* update. | ||
*/ | ||
time_source_updated TIMESTAMPTZ, | ||
|
||
/* The state of the migration target */ | ||
target_state omicron.public.migration_state NOT NULL, | ||
|
||
/* The ID of the migration target Propolis */ | ||
target_propolis_id UUID NOT NULL, | ||
|
||
/* Generation number owned and incremented by the target sled-agent */ | ||
target_gen INT8 NOT NULL DEFAULT 1, | ||
|
||
/* Timestamp of when the source field was last updated. | ||
* | ||
* This is provided by the sled-agent when publishing a migration state | ||
* update. | ||
*/ | ||
time_target_updated TIMESTAMPTZ | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* Lookup migrations by instance ID */ | ||
CREATE INDEX IF NOT EXISTS lookup_migrations_by_instance_id ON omicron.public.migration ( | ||
instance_id | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters