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

Open
wants to merge 21 commits into
base: beta
Choose a base branch
from
Open

Kit bugfixes #4043

wants to merge 21 commits into from

Conversation

L-Mario564
Copy link
Collaborator

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

Addresses 19 bugs:

#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.

#3679 & #3820
Using an non-alphanumeric character within a sequence's name (like a "-") would result in changes being applied when there weren't any. This is now fixed.

#3347, #2806, #3685 & #2454
Fixed issues with geometry(point) serialization:
1- geometry(point) got instrospected as geometry(Point).
2- Default value was serialized as [Object object].

#3884
Prevent type error when the table belonging to a check constraint wasn't found during introspection in MySQL.

#3585
This seems to have been fixed in newer versions of Kit. Added a test to verify such.

#3559 & #3549
Empty strings upon introspection are now handled correctly.

#1680
Fixed in latest. Added test to verify.

#2888
Composite unique constraint got recreated in Postgres even if the column order hasn't been modified. Fixed by retrieving the order of the constraint's columns upon introspection.

@L-Mario564 L-Mario564 marked this pull request as ready for review February 5, 2025 16:56
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