From 9dc3e5da26832d7f443fb6aac5799e273140e472 Mon Sep 17 00:00:00 2001 From: "LAPTOP-V3V5DP1T\\Han Qiang Qiang" <1364346467@qq.com> Date: Wed, 28 Jun 2023 17:02:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9Coating=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SicRT/Config/DBModel.sql | 62 +++++++++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 7 deletions(-) diff --git a/SicRT/Config/DBModel.sql b/SicRT/Config/DBModel.sql index cc0adaa6..74c247a5 100644 --- a/SicRT/Config/DBModel.sql +++ b/SicRT/Config/DBModel.sql @@ -425,13 +425,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 @@ -449,13 +450,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 @@ -465,7 +465,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