Skip to content

Commit

Permalink
Merge pull request #212 from jobyjames1/main
Browse files Browse the repository at this point in the history
refactor: device model change #158
  • Loading branch information
geovlazar authored Sep 19, 2024
2 parents 2f59e7d + aca7115 commit 536cd40
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 40 deletions.
16 changes: 6 additions & 10 deletions pattern/infra-assurance/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -825,16 +825,12 @@ export const certificate = gm.textPkTable("certificate", {

export const device = gm.textPkTable("device", {
device_id: udm.ulidPrimaryKey(),
device_name: udm.text(),
short_name: udm.text(),
barcode: udm.text(),
model: udm.text(),
serial_number: udm.text(),
firmware: udm.text(),
data_center: udm.text(),
location: udm.text(),
purpose: udm.text(),
description: udm.text(),
name: udm.text(),
state: udm.text(),
boundary: udm.text(),
segmentation: udm.text(),
state_sysinfo: udm.jsonTextNullable(),
elaboration: udm.jsonTextNullable(),
...gm.housekeeping.columns,
});

Expand Down
16 changes: 6 additions & 10 deletions pattern/infra-assurance/models_test.fixture.puml
Original file line number Diff line number Diff line change
Expand Up @@ -863,16 +863,12 @@
entity "device" as device {
* **device_id**: TEXT
--
* device_name: TEXT
* short_name: TEXT
* barcode: TEXT
* model: TEXT
* serial_number: TEXT
* firmware: TEXT
* data_center: TEXT
* location: TEXT
* purpose: TEXT
* description: TEXT
* name: TEXT
* state: TEXT
* boundary: TEXT
* segmentation: TEXT
state_sysinfo: TEXT
elaboration: TEXT
created_at: TIMESTAMPTZ
created_by: TEXT
updated_at: TIMESTAMPTZ
Expand Down
16 changes: 6 additions & 10 deletions pattern/infra-assurance/models_test.fixture.sh
Original file line number Diff line number Diff line change
Expand Up @@ -926,16 +926,12 @@ CREATE TABLE IF NOT EXISTS "certificate" (
);
CREATE TABLE IF NOT EXISTS "device" (
"device_id" TEXT PRIMARY KEY NOT NULL,
"device_name" TEXT NOT NULL,
"short_name" TEXT NOT NULL,
"barcode" TEXT NOT NULL,
"model" TEXT NOT NULL,
"serial_number" TEXT NOT NULL,
"firmware" TEXT NOT NULL,
"data_center" TEXT NOT NULL,
"location" TEXT NOT NULL,
"purpose" TEXT NOT NULL,
"description" TEXT NOT NULL,
"name" TEXT NOT NULL,
"state" TEXT NOT NULL,
"boundary" TEXT NOT NULL,
"segmentation" TEXT NOT NULL,
"state_sysinfo" TEXT,
"elaboration" TEXT,
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
"created_by" TEXT DEFAULT 'UNKNOWN',
"updated_at" TIMESTAMPTZ,
Expand Down
16 changes: 6 additions & 10 deletions pattern/infra-assurance/models_test.fixture.sql
Original file line number Diff line number Diff line change
Expand Up @@ -892,16 +892,12 @@ CREATE TABLE IF NOT EXISTS "certificate" (
);
CREATE TABLE IF NOT EXISTS "device" (
"device_id" TEXT PRIMARY KEY NOT NULL,
"device_name" TEXT NOT NULL,
"short_name" TEXT NOT NULL,
"barcode" TEXT NOT NULL,
"model" TEXT NOT NULL,
"serial_number" TEXT NOT NULL,
"firmware" TEXT NOT NULL,
"data_center" TEXT NOT NULL,
"location" TEXT NOT NULL,
"purpose" TEXT NOT NULL,
"description" TEXT NOT NULL,
"name" TEXT NOT NULL,
"state" TEXT NOT NULL,
"boundary" TEXT NOT NULL,
"segmentation" TEXT NOT NULL,
"state_sysinfo" TEXT,
"elaboration" TEXT,
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
"created_by" TEXT DEFAULT 'UNKNOWN',
"updated_at" TIMESTAMPTZ,
Expand Down

0 comments on commit 536cd40

Please sign in to comment.