1
|
SELECT functions.to_global_col_names('"REF_UNIT"');
|
2
|
|
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
|
SELECT functions.set_col_types('"REF_UNIT"', ARRAY[
|
7
|
('.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")$$);
|