From 453e6391e29e2a001b4e9584d5d0c9d035260f2b Mon Sep 17 00:00:00 2001 From: "WQY\\qiong" Date: Fri, 11 Nov 2022 21:13:39 +0800 Subject: [PATCH] Refine reaction schema --- script/sql/create/19.reactions.sql | 37 ++++++++---------------------- script/sql/drop/19.reactions.sql | 14 ++--------- 2 files changed, 12 insertions(+), 39 deletions(-) diff --git a/script/sql/create/19.reactions.sql b/script/sql/create/19.reactions.sql index d22cb1b..a8f4305 100644 --- a/script/sql/create/19.reactions.sql +++ b/script/sql/create/19.reactions.sql @@ -1,42 +1,25 @@ -- [REACTIONS] -create type reactions_order_param as enum ('BULK', 'WALL', 'TANK'); - -create table reactions_order -( - key reactions_order_param not null -, value numeric not null -); - -create type reactions_global_param as enum ('BULK', 'WALL'); - create table reactions_global ( - key reactions_global_param not null + key text not null , value numeric not null ); -create type reactions_pipe_param as enum ('BULK', 'WALL'); - -create table reactions_pipe +create table reactions_pipe_bulk ( - key reactions_pipe_param not null -, pipe varchar(32) references pipes(id) not null + pipe varchar(32) primary key references pipes(id) not null +, value numeric not null +); + +create table reactions_pipe_wall +( + pipe varchar(32) primary key references pipes(id) not null , value numeric not null ); create table reactions_tank ( - tank varchar(32) references tanks(id) not null + tank varchar(32) primary key references tanks(id) not null , value numeric not null ); - -create table reactions_limiting_potential -( - value numeric not null -); - -create table reactions_roughness_correlation -( - value numeric not null -); diff --git a/script/sql/drop/19.reactions.sql b/script/sql/drop/19.reactions.sql index 8336620..5fae80d 100644 --- a/script/sql/drop/19.reactions.sql +++ b/script/sql/drop/19.reactions.sql @@ -1,19 +1,9 @@ -- [REACTIONS] -drop table if exists reactions_roughness_correlation; - -drop table if exists reactions_limiting_potential; - drop table if exists reactions_tank; -drop table if exists reactions_pipe; +drop table if exists reactions_pipe_wall; -drop type if exists reactions_pipe_param; +drop table if exists reactions_pipe_bulk; drop table if exists reactions_global; - -drop type if exists reactions_global_param; - -drop table if exists reactions_order; - -drop type if exists reactions_order_param;