1
|
SELECT functions.to_global_col_names('"COUNTY"');
|
2
|
|
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
|
SELECT functions.set_col_types('"COUNTY"', ARRAY[
|
8
|
('.STATECD' , 'integer')
|
9
|
, ('.UNITCD' , 'integer')
|
10
|
, ('.COUNTYCD', 'integer')
|
11
|
]::functions.col_cast[]);
|
12
|
|
13
|
SELECT functions.create_if_not_exists($$ALTER TABLE "COUNTY" ADD CONSTRAINT "COUNTY.ID" UNIQUE ("COUNTY.CN") $$);
|
14
|
SELECT functions.create_if_not_exists($$ALTER TABLE "COUNTY" ADD CONSTRAINT "COUNTY.unique" UNIQUE (".STATECD", ".UNITCD", ".COUNTYCD")$$);
|