SELECT functions.to_global_col_names(:table_str);

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

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