I have a simple table with the following structure:
CREATE TABLE `test` (
|
`a` int(11) DEFAULT NULL
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8
|
When I'm trying to run following statement:
ALTER TABLE `test` ADD COLUMN `consultant_id` integer NOT NULL,
|
ALTER COLUMN `consultant_id` DROP DEFAULT;
|
I've got an error:
ERROR 1054 (42S22): Unknown column 'consultant_id' in 'test'
|
However when I'm splitting these changes into two separate ALTER TABLE, it works:
MariaDB> ALTER TABLE `test` ADD COLUMN `consultant_id` integer NOT NULL;
|
Query OK, 0 rows affected (0.01 sec)
|
Records: 0 Duplicates: 0 Warnings: 0
|
MariaDB> ALTER TABLE `test` ALTER COLUMN `consultant_id` DROP DEFAULT;
|
Query OK, 0 rows affected (0.00 sec)
|
Records: 0 Duplicates: 0 Warnings: 0
|