-
Notifications
You must be signed in to change notification settings - Fork 886
Closed
Description
Versions:
phinx: 0.11
mysql: 8+
pho: 7.2
Refering to: dbeaver/dbeaver#10797
when creating a colum which has CURRENT_TIMESTAMP as the default value, mysql adds 'DEFAULT_GENERATED' into the extra column.
This then gets added to any alter statements and causes a syntax issue.
REPRODUCTION:
####Create a table with a datetime field with CURRENT_TIMESTAMP as the default value.
CREATE TABLE `test_table` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(80) NOT NULL,
`last_changed` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE
)
####using phinx to rename the column
public function change(){
$this->table('test_table')
->renameColumn('last_changed', 'updated_at')
->update();
}
georgique
Metadata
Metadata
Assignees
Labels
No labels