Skip to content

[BUG]: SQLite column name change error #5587

@tristansusie

Description

@tristansusie

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

0.45.2

What version of drizzle-kit are you using?

031.10

Other packages

No response

Describe the Bug

When I changed my column name "is_invisible" in my schema to "is_visible", the migration throws an error, since the SQL wants to insert back from the column "is_visible" which does not exist. This should be "is_invisible".

PRAGMA foreign_keys=OFF;--> statement-breakpoint
CREATE TABLE __new_task (
...
is_visible integer DEFAULT true NOT NULL,
...
);
--> statement-breakpoint
INSERT INTO __new_task(..., "is_visible", ...) SELECT ..., "is_visible", ... FROM task;--> statement-breakpoint
DROP TABLE task;--> statement-breakpoint
ALTER TABLE __new_task RENAME TO task;--> statement-breakpoint
PRAGMA foreign_keys=ON;

Thanks for your work and kind regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions