Skip to content

Cannot rollback renaming a column that has DEFAULT CURRENT_TIMESTAMP #754

Closed
@nojimage

Description

@nojimage

This is a (multiple allowed):

  • bug

  • enhancement

  • feature-discussion (RFC)

  • CakePHP Version: 5.x

  • Migrations plugin version: 4.3.1, 4.4.1

  • Bake plugin version (if relevant): -

  • Database server (MySQL, SQLite, Postgres): 8.0

  • PHP Version: 8.3

  • Platform / OS: Linux

What you did

  • I create rename column migration file.
  • The target column has default CURRENT_TIMESTAMP.
  • The migration executed successfully. However, when executing the migration rollback, the following error occurred:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT_GENERATED DEFAULT CURRENT_TIMESTAMP, CHANGE' at line 1

Expected Behavior

the rollback is executed correctly as well.

This is probably due to the same reason as reported by phinx.

cakephp/phinx#2138

The following fix needs to be backport.

cakephp/phinx#2253

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions