We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
drizzle-orm
0.38.2
drizzle-kit
0.30.1
No response
I have this schema:
export const sessions = sqliteTable("sessions", { token: text({ length: 255, }), });
I then add an id field with autoIncrement
id
autoIncrement
export const sessions = sqliteTable("sessions", { id: integer().primaryKey({ autoIncrement: true, }), token: text({ length: 255, }), });
Results in this migration:
PRAGMA foreign_keys=OFF;--> statement-breakpoint CREATE TABLE `__new_sessions` ( `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `token` text(255) ); --> statement-breakpoint INSERT INTO `__new_sessions`("id", "token") SELECT "id", "token" FROM `sessions`;--> statement-breakpoint DROP TABLE `sessions`;--> statement-breakpoint ALTER TABLE `__new_sessions` RENAME TO `sessions`;--> statement-breakpoint PRAGMA foreign_keys=ON;
But this migration fails.
When I modify the following line to remove id
INSERT INTO `__new_sessions`("token") SELECT "token" FROM `sessions`;--> statement-breakpoint
it works.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Report hasn't been filed before.
What version of
drizzle-orm
are you using?0.38.2
What version of
drizzle-kit
are you using?0.30.1
Other packages
No response
Describe the Bug
I have this schema:
I then add an
id
field withautoIncrement
Results in this migration:
But this migration fails.
When I modify the following line to remove
id
it works.
The text was updated successfully, but these errors were encountered: