SELECT functions.to_global_col_names(:table_str);

SELECT functions.rename_if_exists($$ALTER TABLE "SUBPLOT" RENAME "SUBPLOT.STATECD"  TO ".STATECD" $$);
SELECT functions.rename_if_exists($$ALTER TABLE "SUBPLOT" RENAME "SUBPLOT.UNITCD"   TO ".UNITCD"  $$);
SELECT functions.rename_if_exists($$ALTER TABLE "SUBPLOT" RENAME "SUBPLOT.COUNTYCD" TO ".COUNTYCD"$$);
SELECT functions.rename_if_exists($$ALTER TABLE "SUBPLOT" RENAME "SUBPLOT.PLOT"     TO ".PLOT"    $$);
SELECT functions.rename_if_exists($$ALTER TABLE "SUBPLOT" RENAME "SUBPLOT.INVYR"    TO ".INVYR"   $$);
SELECT functions.rename_if_exists($$ALTER TABLE "SUBPLOT" RENAME "SUBPLOT.SUBP"     TO ".SUBP"    $$);

SELECT functions.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.unique" UNIQUE (".STATECD", ".UNITCD", ".COUNTYCD", ".PLOT", ".INVYR", ".SUBP")$$);
