Browse Source

1.Add automatically update database column codes

hecl 1 year ago
parent
commit
fa67219b9f
1 changed files with 8 additions and 0 deletions
  1. 8 0
      Venus/Venus_RT/Config/DBModel.sql

+ 8 - 0
Venus/Venus_RT/Config/DBModel.sql

@@ -149,6 +149,14 @@ begin
 					GRANT SELECT ON TABLE "process_data" TO postgres;
  
     end if; 
+	 ------------------------------------------------------------------------------------------------
+	    if not exists(select * from information_schema.COLUMNS
+	        where 	
+			table_catalog = CURRENT_CATALOG and table_schema = CURRENT_SCHEMA 
+			and table_name = 'process_data' and column_name = 'recipe_type') 
+            then
+            ALTER TABLE "process_data" ADD COLUMN "recipe_type" TEXT;
+    end if ;
 
 	 ------------------------------------------------------------------------------------------------
  --