From aca711501d3bce5ca5890285fb462a91598bf624 Mon Sep 17 00:00:00 2001 From: Joby James Date: Thu, 19 Sep 2024 09:56:52 +0530 Subject: [PATCH] refactor: device model change #158 --- pattern/infra-assurance/models.ts | 16 ++++++---------- pattern/infra-assurance/models_test.fixture.puml | 16 ++++++---------- pattern/infra-assurance/models_test.fixture.sh | 16 ++++++---------- pattern/infra-assurance/models_test.fixture.sql | 16 ++++++---------- 4 files changed, 24 insertions(+), 40 deletions(-) diff --git a/pattern/infra-assurance/models.ts b/pattern/infra-assurance/models.ts index e2e49cb8..adf295b4 100644 --- a/pattern/infra-assurance/models.ts +++ b/pattern/infra-assurance/models.ts @@ -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, }); diff --git a/pattern/infra-assurance/models_test.fixture.puml b/pattern/infra-assurance/models_test.fixture.puml index 0d414ac7..8be6d67b 100644 --- a/pattern/infra-assurance/models_test.fixture.puml +++ b/pattern/infra-assurance/models_test.fixture.puml @@ -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 diff --git a/pattern/infra-assurance/models_test.fixture.sh b/pattern/infra-assurance/models_test.fixture.sh index 3e27dc64..785db53b 100644 --- a/pattern/infra-assurance/models_test.fixture.sh +++ b/pattern/infra-assurance/models_test.fixture.sh @@ -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, diff --git a/pattern/infra-assurance/models_test.fixture.sql b/pattern/infra-assurance/models_test.fixture.sql index 55ac85cc..7a914310 100644 --- a/pattern/infra-assurance/models_test.fixture.sql +++ b/pattern/infra-assurance/models_test.fixture.sql @@ -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,