|
| 1 | +CREATE TABLE IF NOT EXISTS omicron.public.fm_sitrep ( |
| 2 | + -- The ID of this sitrep. |
| 3 | + id UUID PRIMARY KEY, |
| 4 | + -- The ID of the parent sitrep. |
| 5 | + -- |
| 6 | + -- A sitrep's _parent_ is the sitrep that was current when the planning |
| 7 | + -- phase that produced that sitrep ran. The parent sitrep is a planning |
| 8 | + -- input that produced this sitrep. |
| 9 | + -- |
| 10 | + -- This is effectively a foreign key back to this table; however, it is |
| 11 | + -- allowed to be NULL: the initial sitrep has no parent. Additionally, |
| 12 | + -- it may be non-NULL but no longer reference a row in this table: once a |
| 13 | + -- child sitrep has been created from a parent, it's possible for the |
| 14 | + -- parent to be deleted. We do not NULL out this field on such a deletion, |
| 15 | + -- so we can always see that there had been a particular parent even if |
| 16 | + -- it's now gone. |
| 17 | + parent_sitrep_id UUID, |
| 18 | + -- The ID of the inventory collection that was used as input to this |
| 19 | + -- sitrep. |
| 20 | + -- |
| 21 | + -- This is a foreign key that references a row in the `inv_collection` |
| 22 | + -- table (and other inventory records associated with that collection). |
| 23 | + -- |
| 24 | + -- Note that inventory collections are pruned on a separate schedule |
| 25 | + -- from sitreps, so the inventory collection records may not exist. |
| 26 | + inv_collection_id UUID NOT NULL, |
| 27 | + |
| 28 | + -- These fields are not semantically meaningful and are intended |
| 29 | + -- debugging purposes. |
| 30 | + |
| 31 | + -- The time at which this sitrep was created. |
| 32 | + time_created TIMESTAMPTZ NOT NULL, |
| 33 | + -- The Omicron zone UUID of the Nexus instance that created this |
| 34 | + -- sitrep. |
| 35 | + creator_id UUID NOT NULL, |
| 36 | + -- A human-readable description of the changes represented by this |
| 37 | + -- sitrep. |
| 38 | + comment TEXT NOT NULL |
| 39 | +); |
0 commit comments