The statement for renaming a table in MySQL is slightly different from that in GaussDB(DWS). DSC will perform adaptation based on GaussDB(DWS) features during migration.
Currently, DSC does not support original table names prefixed with DATABASE/SCHEMA.
Input
# Rename a single table. RENAME TABLE DEPARTMENT TO NEWDEPT; # Rename multiple tables. RENAME TABLE NEWDEPT TO NEWDEPT_02,PEOPLE TO PEOPLE_02;
Output
-- Rename a single table. ALTER TABLE "public"."department" RENAME TO "newdept"; -- Rename multiple tables. ALTER TABLE "public"."newdept" RENAME TO "newdept_02"; ALTER TABLE "public"."people" RENAME TO "people_02";
Input
## A. ALTER TABLE runoob_alter_test RENAME TO runoob_alter_testnew; ## B. ALTER TABLE runoob_alter_testnew RENAME AS runoob_alter_testnewnew;
Output
-- A. ALTER TABLE "public"."runoob_alter_test" RENAME TO "runoob_alter_testnew"; -- B. ALTER TABLE "public"."runoob_alter_testnew" RENAME TO "runoob_alter_testnewnew";