Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] MySQL CURRENT_TIMESTAMP function is considered a string and is not processed normally #1029

Open
kworkbee opened this issue Dec 28, 2023 · 0 comments

Comments

@kworkbee
Copy link

kworkbee commented Dec 28, 2023

In Database,

# ...
- name: created_date
        type: datetime (6)
        constraints:
          notNull: true
        attributes:
          autoIncrement: false
        default: CURRENT_TIMESTAMP(6)
# ...

Controller Logs:

Executing query "create table `user` (`idx` int (11) not null auto_increment, `name` varchar (256) not null, `role` varchar (20) not null, `created_date` datetime (6) not null default 'CURRENT_TIMESTAMP(6)', `last_modified_date` datetime (6) not null default 'CURRENT_TIMESTAMP(6)', `enabled` tinyint (1) not null default '1', primary key (`idx`)"
{"level":"error","msg":"failed to apply statements: Error 1067 (42000): Invalid default value for 'created_date'"}

The CURRENT_TIMESTAMP function, which should be applied as the default value in the field created_date, is considered a string, resulting in a bug that prevents DDL from running properly.

@kworkbee kworkbee changed the title MySQL CURRENT_TIMESTAMP function is considered a string and is not processed normally [Bug] MySQL CURRENT_TIMESTAMP function is considered a string and is not processed normally Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant