-
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.
update database schema for the upgrade case too
- Loading branch information
1 parent
376a37b
commit 5b7152c
Showing
17 changed files
with
105 additions
and
10 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CREATE TABLE IF NOT EXISTS omicron.public.hw_baseboard_id ( | ||
id UUID PRIMARY KEY, | ||
part_number TEXT NOT NULL, | ||
serial_number TEXT NOT NULL | ||
); |
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 @@ | ||
CREATE UNIQUE INDEX IF NOT EXISTS lookup_baseboard_id_by_props | ||
ON omicron.public.hw_baseboard_id (part_number, serial_number); |
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,5 @@ | ||
CREATE TYPE IF NOT EXISTS omicron.public.hw_power_state AS ENUM ( | ||
'A0', | ||
'A1', | ||
'A2' | ||
); |
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 @@ | ||
CREATE TYPE IF NOT EXISTS omicron.public.hw_rot_slot AS ENUM ( | ||
'A', | ||
'B' | ||
); |
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,9 @@ | ||
CREATE TABLE IF NOT EXISTS omicron.public.sw_caboose ( | ||
id UUID PRIMARY KEY, | ||
board TEXT NOT NULL, | ||
git_commit TEXT NOT NULL, | ||
name TEXT NOT NULL, | ||
-- The MGS response that provides this field indicates that it can be NULL. | ||
-- But that's only to support old software that we no longer support. | ||
version TEXT NOT NULL | ||
); |
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 @@ | ||
CREATE UNIQUE INDEX IF NOT EXISTS caboose_properties | ||
on omicron.public.sw_caboose (board, git_commit, name, version); |
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,6 @@ | ||
CREATE TABLE IF NOT EXISTS inv_collection ( | ||
id UUID PRIMARY KEY, | ||
time_started TIMESTAMPTZ NOT NULL, | ||
time_done TIMESTAMPTZ NOT NULL, | ||
collector TEXT NOT NULL | ||
); |
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 @@ | ||
CREATE INDEX IF NOT EXISTS inv_collection_by_time_started | ||
ON omicron.public.inv_collection (time_started); |
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,5 @@ | ||
CREATE TABLE IF NOT EXISTS omicron.public.inv_collection_error ( | ||
inv_collection_id UUID NOT NULL, | ||
idx INT4 NOT NULL, | ||
message TEXT | ||
); |
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 @@ | ||
CREATE INDEX IF NOT EXISTS errors_by_collection | ||
ON omicron.public.inv_collection_error (inv_collection_id, idx); |
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,5 @@ | ||
CREATE TYPE IF NOT EXISTS omicron.public.sp_type AS ENUM ( | ||
'sled', | ||
'switch', | ||
'power' | ||
); |
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,15 @@ | ||
CREATE TABLE IF NOT EXISTS omicron.public.inv_service_processor ( | ||
inv_collection_id UUID NOT NULL, | ||
hw_baseboard_id UUID NOT NULL, | ||
time_collected TIMESTAMPTZ NOT NULL, | ||
source TEXT NOT NULL, | ||
|
||
sp_type omicron.public.sp_type NOT NULL, | ||
sp_slot INT4 NOT NULL, | ||
|
||
baseboard_revision INT8 NOT NULL, | ||
hubris_archive_id TEXT NOT NULL, | ||
power_state omicron.public.hw_power_state NOT NULL, | ||
|
||
PRIMARY KEY (inv_collection_id, hw_baseboard_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
CREATE TABLE IF NOT EXISTS omicron.public.inv_root_of_trust ( | ||
inv_collection_id UUID NOT NULL, | ||
hw_baseboard_id UUID NOT NULL, | ||
time_collected TIMESTAMPTZ NOT NULL, | ||
source TEXT NOT NULL, | ||
|
||
slot_active omicron.public.hw_rot_slot NOT NULL, | ||
slot_boot_pref_transient omicron.public.hw_rot_slot, | ||
slot_boot_pref_persistent omicron.public.hw_rot_slot NOT NULL, | ||
slot_boot_pref_persistent_pending omicron.public.hw_rot_slot, | ||
slot_a_sha3_256 TEXT, | ||
slot_b_sha3_256 TEXT, | ||
|
||
PRIMARY KEY (inv_collection_id, hw_baseboard_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CREATE TYPE IF NOT EXISTS omicron.public.caboose_which AS ENUM ( | ||
'sp_slot_0', | ||
'sp_slot_1', | ||
'rot_slot_A', | ||
'rot_slot_B' | ||
); |
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,11 @@ | ||
CREATE TABLE IF NOT EXISTS omicron.public.inv_caboose ( | ||
inv_collection_id UUID NOT NULL, | ||
hw_baseboard_id UUID NOT NULL, | ||
time_collected TIMESTAMPTZ NOT NULL, | ||
source TEXT NOT NULL, | ||
|
||
which omicron.public.caboose_which NOT NULL, | ||
sw_caboose_id UUID NOT NULL, | ||
|
||
PRIMARY KEY (inv_collection_id, hw_baseboard_id, which) | ||
); |
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