add and update

This commit is contained in:
zhuxu 2025-05-22 15:38:34 +08:00
parent d2fb604894
commit b7ff89be60
5 changed files with 21 additions and 10 deletions

View File

@ -0,0 +1,9 @@
-- standard component type
DROP TABLE IF EXISTS COMPONENT_TYPE;
CREATE TABLE COMPONENT_TYPE (
ID SERIAL PRIMARY KEY,
TYPE VARCHAR(64) NOT NULL DEFAULT '',
NAME VARCHAR(64) NOT NULL DEFAULT ''
);

View File

@ -0,0 +1,10 @@
-- measurement of bay
DROP TABLE IF EXISTS MEASUREMENT;
CREATE TABLE (
ID SERIAL PRIMARY KEY,
TAG VARCHAR(64) NOT NULL DEFAULT '',
NAME VARCHAR(64) NOT NULL DEFAULT '',
BAY_ID INTEGER NOT NULL DEFAULT -1
);

View File

@ -29,11 +29,7 @@ CREATE TABLE IF NOT EXISTS public.component
context jsonb NOT NULL DEFAULT '{}'::jsonb,
op integer NOT NULL DEFAULT '-1'::integer,
ts timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT component_id_PrimaryKey PRIMARY KEY (id),
CONSTRAINT component_ForeignKey_page_id FOREIGN KEY (page_id)
REFERENCES public.page (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
CONSTRAINT component_id_PrimaryKey PRIMARY KEY (id)
)
TABLESPACE pg_default;

View File

@ -16,11 +16,7 @@ CREATE TABLE IF NOT EXISTS public.topologic
description character varying(512) COLLATE pg_catalog."default",
op integer NOT NULL DEFAULT '-1'::integer,
ts timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT topologic_id_PrimaryKey PRIMARY KEY (id),
CONSTRAINT topologic_ForeignKey_page_id FOREIGN KEY (page_id)
REFERENCES public.page (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
CONSTRAINT topologic_id_PrimaryKey PRIMARY KEY (id)
)
TABLESPACE pg_default;