Project

General

Profile

1 8136 aaronmk
SELECT functions.to_global_col_names('"REF_UNIT"');
2 8126 aaronmk
3
SELECT functions.rename_if_exists($$ALTER TABLE "REF_UNIT" RENAME "REF_UNIT.STATECD" TO ".STATECD"$$);
4
SELECT functions.rename_if_exists($$ALTER TABLE "REF_UNIT" RENAME "REF_UNIT.VALUE"   TO ".UNITCD" $$);
5
6 8136 aaronmk
SELECT functions.set_col_types('"REF_UNIT"', ARRAY[
7 8126 aaronmk
  ('.STATECD' , 'integer')
8
, ('.UNITCD' , 'integer')
9
]::functions.col_cast[]);
10
11
SELECT functions.create_if_not_exists($$ALTER TABLE "REF_UNIT" ADD CONSTRAINT "REF_UNIT.unique" UNIQUE (".STATECD", ".UNITCD")$$);