428d851913
* refactor: generic rename to mysql * refactor: g4 with mysql syntax * test: mysql syntax * refactor: remove useless keywords * refactor: remove nonReserved keywords * refactor: lint specificFunction --------- Co-authored-by: liuyi <liuyi@dtstack.com>
11 lines
468 B
SQL
11 lines
468 B
SQL
-- https://dev.mysql.com/doc/refman/8.0/en/alter-table-generated-columns.html
|
|
|
|
|
|
ALTER TABLE t1 ADD COLUMN c2 INT GENERATED ALWAYS AS (c1 + 1) STORED;
|
|
ALTER TABLE t1 MODIFY COLUMN c2 TINYINT GENERATED ALWAYS AS (c1 + 5) STORED;
|
|
ALTER TABLE t1 CHANGE c2 c3 INT GENERATED ALWAYS AS (c1 + 1) STORED;
|
|
ALTER TABLE t1 DROP COLUMN c3;
|
|
ALTER TABLE t1 DROP COLUMN c2;
|
|
ALTER TABLE t1 MODIFY COLUMN c2 INT GENERATED ALWAYS AS (c1 + 1) STORED;
|
|
ALTER TABLE t1 MODIFY COLUMN c2 INT;
|