#3644·atlas

Some TiDB features not supported when generating migrations

Author: louimetCreated Jan 6, 2026Updated Sep 29, 2026

When generating migrations, Atlas doesn't seem to support some TiDB-specific features that are allowed in MySQL, and strips out TiDB-style comments that can be used as a workaround.

For example, if you want to set up the time-to-live feature on your table:

sql
CREATE TABLE t1 (
    id int PRIMARY KEY,
    created_at TIMESTAMP
) TTL = `created_at` + INTERVAL 3 MONTH TTL_ENABLE = 'OFF';

The above command will give a syntax error when atlas migrate diff is run, and if you use the commented syntax below instead, it will just be stripped out and ignored.

sql
CREATE TABLE t1 (
    id int PRIMARY KEY,
    created_at TIMESTAMP
) /*T![ttl] TTL = `created_at` + INTERVAL 3 MONTH TTL_ENABLE = 'OFF'*/;

The only way to bypass this behavior seems to be to manually add the TiDB-specific syntax directly in a migration file.