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] Initial migration should use IF NOT EXISTS #409

Open
jschuur opened this issue May 15, 2024 · 0 comments
Open

[BUG] Initial migration should use IF NOT EXISTS #409

jschuur opened this issue May 15, 2024 · 0 comments

Comments

@jschuur
Copy link

jschuur commented May 15, 2024

The initial migration file generated with drizzle-kit generate for an existing project seemed to use a CREATE TABLE table_name (..) format, rather than
CREATE TABLE IF NOT EXISTS table_name (...).

At least this was the case for me for a turso/sqlite driver/dialect config and drizzle-kit: v0.21.2.

drizzle-kit introspect also did not add IF NOT EXISTS.

Shouldn't IF NOT EXISTS be use here, so that it can gracefully skip existing tables? The same should apply to index generating statements.

@jschuur jschuur changed the title Breakpoints in migration don't work with Turso, initial migration should use IF NOT EXISTS [BUG] Breakpoints in migration don't work with Turso, initial migration should use IF NOT EXISTS May 15, 2024
@jschuur jschuur changed the title [BUG] Breakpoints in migration don't work with Turso, initial migration should use IF NOT EXISTS [BUG] Initial migration should use IF NOT EXISTS May 23, 2024
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