Files
sankofa-hw-infra/packages/schema/drizzle/0002_unifi_product_intelligence.sql
defiQUG 93df3c8c20
Some checks failed
CI / lint-and-test (push) Has been cancelled
Initial commit: add .gitignore and README
2026-02-09 21:51:50 -08:00

25 lines
1.3 KiB
SQL

CREATE TABLE IF NOT EXISTS "unifi_product_catalog" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"sku" text NOT NULL UNIQUE,
"model_name" text NOT NULL,
"generation" text NOT NULL,
"performance_class" text,
"eol_date" text,
"support_horizon" text,
"approved_sovereign_default" boolean DEFAULT false NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL
);
CREATE INDEX IF NOT EXISTS "unifi_catalog_sku_idx" ON "unifi_product_catalog" ("sku");
CREATE INDEX IF NOT EXISTS "unifi_catalog_generation_idx" ON "unifi_product_catalog" ("generation");
INSERT INTO "unifi_product_catalog" ("sku", "model_name", "generation", "performance_class", "eol_date", "support_horizon", "approved_sovereign_default") VALUES
('USW-24-PoE', 'UniFi Switch 24 PoE', 'Gen1', 'prosumer', '2026-12-31', '2027-06', true),
('USW-48-PoE', 'UniFi Switch 48 PoE', 'Gen1', 'prosumer', '2026-12-31', '2027-06', true),
('U6-Pro', 'UniFi 6 Pro', 'Gen2', 'enterprise', '2028-06-30', '2029-12', true),
('U6-Enterprise', 'UniFi 6 Enterprise', 'Enterprise', 'enterprise', '2029-12-31', '2030-06', true),
('U7-Pro', 'UniFi 7 Pro', 'Gen2', 'enterprise', null, null, true),
('USW-Enterprise-24-PoE', 'UniFi Enterprise 24 PoE', 'Enterprise', 'enterprise', '2030-12-31', '2031-06', true)
ON CONFLICT ("sku") DO NOTHING;