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]: defaultNow() syntax error #1134

Closed
ArtemGolovko opened this issue Aug 27, 2023 · 1 comment
Closed

[BUG]: defaultNow() syntax error #1134

ArtemGolovko opened this issue Aug 27, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@ArtemGolovko
Copy link

ArtemGolovko commented Aug 27, 2023

What version of drizzle-orm are you using?

0.28.5

What version of drizzle-kit are you using?

0.19.13

Describe the Bug

Syntax error while executing drizzle-kit push:mysql with schema below.

export const users = mysqlTable('users', {
    id: serial('id').primaryKey(),
    joined_at: timestamp('joined_at', { mode: 'date', fsp: 0 }).notNull().defaultNow()
});

Here is full sql error:

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 '(now()),

This syntax error occurs when using defaultNow() in schema. It generates incorrect sql (now()) that causes the error.

Expected behavior

deafultNow() in schema should have generated now() instead of (now()).

Environment & setup

Name Version
Mysql 5.7.37-log MySQL Community Server
OS Windows 10
@ArtemGolovko ArtemGolovko added the bug Something isn't working label Aug 27, 2023
@Angelelz
Copy link
Collaborator

I'll close this one in favor of #921.
It will be fixed by #1114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants