This topic describes CREATE TABLE DDL operations that are executed in a MySQL database and can be converted by the DDL synchronization component of OceanBase Migration Service (OMS), but they cannot be executed in the MySQL compatible mode of OceanBase Database when you migrate data from the MySQL database to the MySQL compatible mode of OceanBase Database.
Define a generated column based on other generated columns
Use other generated columns in the CREATE TABLE DDL statement to define a new generated column.
MySQL databases: supported.
MySQL compatible mode of OceanBase Database: not supported.
Example:
CREATE TABLE group_by_t1
(a INT GENERATED ALWAYS AS (1) VIRTUAL,
b INT GENERATED ALWAYS AS (a) VIRTUAL,
c INT GENERATED ALWAYS AS (1) VIRTUAL);
Create an index or a constraint
When you create a constraint, the column types supported in a MySQL database are different from those supported in the MySQL compatible mode of OceanBase Database. For more information, see Column types that are supported to create indexes or constraints.
Restrictions on creating foreign key constraints:
OceanBase Database MySQL compatible mode: Foreign keys can only be added when parent table columns have UNIQUE or PRIMARY constraints.
Parent table columns are the referenced columns in the parent table specified in the foreign key constraint.
MySQL databases: Foreign keys can be added when parent table columns have any type of constraint - UNIQUE, PRIMARY, or regular key constraints.