Merge branch 'develop' into feature/整理优化数据库代码

This commit is contained in:
HCL 2023-06-28 17:04:05 +08:00
commit aa71b0daee
1 changed files with 55 additions and 7 deletions

View File

@ -431,13 +431,14 @@ begin
CREATE TABLE tray_thickness_main
(
"tray_guid" text NOT NULL,
"tray_number" text NOT NULL,
"tray_label" text,
"pm_number" text,
"tray_coating_thickness" real,
"tray_max_thickness"real,
"last_date" date,
"last_time" time,
CONSTRAINT "tray_thickness_main_pkey" PRIMARY KEY ("tray_number" )
"tray_max_thickness" real,
"create_time" timestamp,
CONSTRAINT "tray_thickness_main_pkey" PRIMARY KEY ("tray_guid" )
)
WITH (
OIDS=FALSE
@ -455,13 +456,12 @@ begin
CREATE TABLE tray_thickness_data
(
"wafer_guid" text NOT NULL,
"tray_guid" text NOT NULL,
"tray_number" text ,
"tray_inner_number" text,
"ring_inner_number" text,
"ring_outer_number" text,
CONSTRAINT "tray_thickness_data_pkey" PRIMARY KEY ("wafer_guid" )
CONSTRAINT "tray_thickness_data_pkey" PRIMARY KEY ("tray_guid" )
)
WITH (
OIDS=FALSE
@ -471,7 +471,55 @@ begin
GRANT SELECT ON TABLE tray_thickness_data TO postgres;
end if;
------------------------------------------------------------------------------------------------
--
if not exists(select * from information_schema.tables
where
table_catalog = CURRENT_CATALOG and table_schema = CURRENT_SCHEMA
and table_name = 'pm_thickness_data') then
CREATE TABLE pm_thickness_data
(
"pm_guid" text NOT NULL,
"pm_minor_cycle" text ,
"pm_major_cycle" text,
CONSTRAINT "pm_thickness_data_pkey" PRIMARY KEY ("pm_guid" )
)
WITH (
OIDS=FALSE
);
ALTER TABLE pm_thickness_data
OWNER TO postgres;
GRANT SELECT ON TABLE pm_thickness_data TO postgres;
end if;
------------------------------------------------------------------------------------------------
--
if not exists(select * from information_schema.tables
where
table_catalog = CURRENT_CATALOG and table_schema = CURRENT_SCHEMA
and table_name = 'pm_thickness_main') then
CREATE TABLE pm_thickness_main
(
"pm_guid" text NOT NULL,
"pm_cycle" text NOT NULL,
"pm_label" text,
"pm_number" text,
"pm_coating_thickness" real,
"pm_max_thickness" real,
"create_time" timestamp,
CONSTRAINT "pm_thickness_main_pkey" PRIMARY KEY ("pm_guid" )
)
WITH (
OIDS=FALSE
);
ALTER TABLE "pm_thickness_main"
OWNER TO postgres;
GRANT SELECT ON TABLE "pm_thickness_main" TO postgres;
end if;
------------------------------------------------------------------------------------------------
--
if not exists(select * from information_schema.tables
where
table_catalog = CURRENT_CATALOG and table_schema = CURRENT_SCHEMA