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

Kit bugfixes #4043

Draft
wants to merge 9 commits into
base: beta
Choose a base branch
from
Draft

Kit bugfixes #4043

wants to merge 9 commits into from

Conversation

L-Mario564
Copy link
Collaborator

@L-Mario564 L-Mario564 commented Jan 30, 2025

Addresses:

#3254
bit data type in PG generated with quotes around it. Not anymore.

#2630
Added a proper migration strategy when altering a serial column to a integer generated always as identity column in PG.

Before:

ALTER TABLE "table" ALTER COLUMN "id" SET DATA TYPE integer;
ALTER TABLE "table" ALTER COLUMN "id" ADD GENERATED ALWAYS AS IDENTITY (sequence name "table"."table_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1);

Now:

ALTER TABLE "table" ALTER COLUMN "id" DROP DEFAULT;
DROP SEQUENCE "table_id_seq";
ALTER TABLE "table" ALTER COLUMN "id" ADD GENERATED ALWAYS AS IDENTITY (sequence name "table_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1);
SELECT setval(pg_get_serial_sequence('table', 'id'), coalesce(max("id"), 0) + 1, false) FROM "table";

#3004
The value for maxvalue for the created sequence when using bigint data type was incorrect. This is now the real 64-bit integer limit.

#3713
Check constraints didn't insert parameterized values.

check('name', sql`${table.age} > ${21}`);

Before:

... CHECK ("users"."age" > $1);

Now:

... CHECK ("users"."age" > 21);

#3867
In the issue reported, the user had a .DS_Store file that Drizzle was attempting to read as a JSON file. Added the extra check to the internal prepareOutFolder function to only include .json files.

#3795
This doesn't seem to be a bug present in latest. I added tests to confirm this.

#3609
Default value for bigint data type wasn't handled properly, leading to an error when attempting to JSON.stringify it.

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

Successfully merging this pull request may close these issues.

1 participant