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]: SQLite migration generation shows lack of support for "Set not null to column" when the schema modification do not need it #2561

Open
ebacala opened this issue Jun 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ebacala
Copy link

ebacala commented Jun 27, 2024

What version of drizzle-orm are you using?

0.31.2

What version of drizzle-kit are you using?

0.22.7

Describe the Bug

Here is the schema migration I want to test

export const lorem = sqliteTable("lorem", {
	lorem: text("lorem"),
});

After generating the SQL generation command with drizzle-kit generate the following SQL file is generated:

CREATE TABLE `lorem` (
	`lorem` text
);
--> statement-breakpoint
/*
 SQLite does not support "Set not null to column" out of the box, we do not generate automatic migration for that, so it has to be done manually
 Please refer to: https://www.techonthenet.com/sqlite/tables/alter_table.php
                  https://www.sqlite.org/lang_altertable.html
                  https://stackoverflow.com/questions/2083543/modify-a-columns-type-in-sqlite3

 Due to that we don't generate migration automatically and it has to be done manually
*/

Why is there an error message for setting not null to a column when there's no NOT NULL constraint applied ?

Thank you for taking the time to answer

Expected behavior

Should not the migration file be valid for SQLite?

Environment & setup

Node v20.14
drizzle-kit v0.22.7
drizzle-orm v0.31.2

@ebacala ebacala added the bug Something isn't working label Jun 27, 2024
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

1 participant