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
Failed to parse of DDL containing CURRENT_TIMESTAMP(6) #59
Comments
I made a fix and started its release of v0.5.16. |
Thank you for the very quick response. |
Can the issue be raised again? I am having the same problem. My original script is: create table staff (
id integer not null auto_increment primary key,
date_created timestamp not null default current_timestamp,
date_modified timestamp not null default current_timestamp on update current_timestamp,
full_name varchar(50) character set utf8,
date_of_birth date,
username varchar(32),
password varchar(32),
role_id int
); My output DDL is: CREATE TABLE `staff` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date_created` timestamp NOT NULL DEFAULT current_timestamp(),
`date_modified` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`full_name` varchar(50) CHARACTER SET utf8 DEFAULT NULL,
`date_of_birth` date DEFAULT NULL,
`username` varchar(32) DEFAULT NULL,
`password` varchar(32) DEFAULT NULL,
`role_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; Thanks in advance... EDIT: the script works should I add a number to my ...
date_created timestamp(6) not null default current_timestamp,
date_modified timestamp(6) not null default current_timestamp on update current_timestamp,
... It still feels kinda buggy when I rerun my script: function assure() {
FILENAME=$1
mysqldef \
--host=127.0.0.1 \
--port=3306 \
--user=amber \
--password=amber \
--file=./schemas/${FILENAME} \
amber
}
assure "staff.sql" The output becomes:
|
Your report doesn't follow the issue template and thus I cannot even understand what problem you're asking me to fix. Please follow https://github.com/k0kubun/sqldef/blob/master/.github/ISSUE_TEMPLATE.md as is. I found sqldef fails to parse |
Hey @k0kubun... Sorry for the confusion. I am sorry that I did not read things carefully. I will try to explain the problem again.
|
timestamp |
timestamp(6) |
|
---|---|---|
current_timestamp |
x | |
current_timestamp(6) |
x | x |
Again, I am sorry that I did not say it at first, but thank you for the project. It is your contribution to the community, and it benefits the users (including me), so please do not worry about what I want. You are doing the work for free, and everybody appreciates that!
Thank you for reading.
I'm not sure if I understand the
Well, actually there are two people who became my GitHub Sponsor thanks to this project. But thanks :) |
As you see in this script create table staff (
...
date_created timestamp not null default current_timestamp,
date_modified timestamp not null default current_timestamp on update current_timestamp,
...
); Basically, in the definition above, I tried to create a
I hope that the explanation is clear enough. If not, please do not mind looking at the official documentation. https://dev.mysql.com/doc/refman/8.0/en/timestamp-initialization.html Thanks for reading. |
I think I understand what you're saying, but what you want me to do is often not clear from your comments (if you have one, please use the issue template). You just found how you should write DDLs and it's not about an issue of sqldef. Is that correct? |
My environment:
Case containing CURRENT_TIMESTAMP(6)
Failed to parse of DDL.
I made sure that
schema.sql
has the correct syntax.Case not containing CURRENT_TIMESTAMP(6)
The DDL is successfully applied.
The text was updated successfully, but these errors were encountered: