diff --git a/t/30sqlt-new-diff-mysql.t b/t/30sqlt-new-diff-mysql.t index 706c2752a..bfe663a42 100644 --- a/t/30sqlt-new-diff-mysql.t +++ b/t/30sqlt-new-diff-mysql.t @@ -74,6 +74,8 @@ ALTER TABLE new_name ADD COLUMN new_field integer NULL; ALTER TABLE person ADD COLUMN is_rock_star tinyint(4) NULL DEFAULT 1; +ALTER TABLE foobar CHANGE COLUMN name name varchar(255) NULL; + ALTER TABLE person CHANGE COLUMN person_id person_id integer(11) NOT NULL auto_increment; ALTER TABLE person CHANGE COLUMN name name varchar(20) NOT NULL; @@ -124,6 +126,8 @@ SET foreign_key_checks=1; ALTER TABLE employee DROP COLUMN job_title; +ALTER TABLE foobar CHANGE COLUMN name name varchar(255) NULL; + ALTER TABLE old_name RENAME TO new_name, ADD COLUMN new_field integer NULL; @@ -196,6 +200,8 @@ ALTER TABLE employee DROP FOREIGN KEY FK5302D47D93FE702E, DROP COLUMN job_title, ADD CONSTRAINT FK5302D47D93FE702E_diff FOREIGN KEY (employee_id) REFERENCES person (person_id); +ALTER TABLE foobar CHANGE COLUMN name name varchar(255) NULL; + ALTER TABLE person DROP INDEX UC_age_name, DROP INDEX u_name, ADD COLUMN is_rock_star tinyint(4) NULL DEFAULT 1, diff --git a/t/data/diff/create1.yml b/t/data/diff/create1.yml index b0f147763..ba16c17a3 100644 --- a/t/data/diff/create1.yml +++ b/t/data/diff/create1.yml @@ -2,6 +2,33 @@ schema: procedures: {} tables: + foobar: + fields: + id: + data_type: int + default_value: ~ + extra: {} + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + name: id + order: 1 + size: + - 11 + name: + data_type: varchar + default_value: ~ + extra: {} + is_nullable: 1 + is_primary_key: 0 + name: name + order: 2 + size: + - 25 + indices: [] + name: foobar + options: [] + order: 5 deleted: constraints: - fields: id diff --git a/t/data/diff/create2.yml b/t/data/diff/create2.yml index d5912d14d..c931ef5a3 100644 --- a/t/data/diff/create2.yml +++ b/t/data/diff/create2.yml @@ -2,6 +2,33 @@ schema: procedures: {} tables: + foobar: + fields: + id: + data_type: int + default_value: ~ + extra: {} + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + name: id + order: 1 + size: + - 11 + name: + data_type: varchar + default_value: ~ + extra: {} + is_nullable: 1 + is_primary_key: 0 + name: name + order: 2 + size: + - 255 + indices: [] + name: foobar + options: [] + order: 5 added: constraints: [] fields: diff --git a/t/data/mysql/create.sql b/t/data/mysql/create.sql index 642d9a233..2c25f76d8 100644 --- a/t/data/mysql/create.sql +++ b/t/data/mysql/create.sql @@ -21,3 +21,9 @@ create table employee ( create table deleted ( id integer ); + +CREATE TABLE foobar ( + id int(11) NOT NULL auto_increment, + name varchar(25) default NULL, + PRIMARY KEY (id) +) ENGINE=InnoDB; diff --git a/t/data/mysql/create2.sql b/t/data/mysql/create2.sql index 54cf4bb68..1b0175d8b 100644 --- a/t/data/mysql/create2.sql +++ b/t/data/mysql/create2.sql @@ -23,3 +23,8 @@ create table added ( id integer ); +CREATE TABLE foobar ( + id integer NOT NULL auto_increment, + name varchar(255) default NULL, + PRIMARY KEY (id) +);