Project

General

Profile

1 8136 aaronmk
SELECT functions.to_global_col_names('"COUNTY"');
2 8124 aaronmk
3
SELECT functions.rename_if_exists($$ALTER TABLE "COUNTY" RENAME "COUNTY.STATECD"  TO ".STATECD" $$);
4
SELECT functions.rename_if_exists($$ALTER TABLE "COUNTY" RENAME "COUNTY.UNITCD"   TO ".UNITCD"  $$);
5
SELECT functions.rename_if_exists($$ALTER TABLE "COUNTY" RENAME "COUNTY.COUNTYCD" TO ".COUNTYCD"$$);
6
7 8136 aaronmk
SELECT functions.set_col_types('"COUNTY"', ARRAY[
8 8124 aaronmk
  ('.STATECD' , 'integer')
9
, ('.UNITCD'  , 'integer')
10
, ('.COUNTYCD', 'integer')
11
]::functions.col_cast[]);
12
13 8130 aaronmk
SELECT functions.create_if_not_exists($$ALTER TABLE "COUNTY" ADD CONSTRAINT "COUNTY.ID"     UNIQUE ("COUNTY.CN")                       $$);
14 8124 aaronmk
SELECT functions.create_if_not_exists($$ALTER TABLE "COUNTY" ADD CONSTRAINT "COUNTY.unique" UNIQUE (".STATECD", ".UNITCD", ".COUNTYCD")$$);