Skip to content

Commit 781dea0

Browse files
committed
Add 0.24.1 release notes
1 parent 18d41e1 commit 781dea0

File tree

6 files changed

+56
-28
lines changed

6 files changed

+56
-28
lines changed

changelogs/drizzle-kit/0.24.1.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## Bug fixes
2+
3+
> Big thanks to @L-Mario564 for his [PR](https://github.com/drizzle-team/drizzle-orm/pull/2804). It conflicted in most cases with a PR that was merged, but we incorporated some of his logic. Merging it would have caused more problems and taken more time to resolve, so we just took a few things from his PR, like removing "::<type>" mappings in introspect and some array type default handlers
4+
5+
### What was fixed
6+
7+
1. The Drizzle Kit CLI was not working properly for the `introspect` command.
8+
2. Added the ability to use column names with special characters for all dialects.
9+
3. Included PostgreSQL sequences in the introspection process.
10+
4. Reworked array type introspection and added all test cases.
11+
5. Fixed all (we hope) default issues in PostgreSQL, where `::<type>` was included in the introspected output.
12+
6. `preserve` casing option was broken
13+
14+
### Tickets that were closed
15+
16+
- [[BUG]: invalid schema generation with drizzle-kit introspect:pg](https://github.com/drizzle-team/drizzle-orm/issues/1210)
17+
- [[BUG][mysql introspection]: TS error when introspect column including colon](https://github.com/drizzle-team/drizzle-orm/issues/1928)
18+
- [[BUG]: Unhandled defaults when introspecting postgres db](https://github.com/drizzle-team/drizzle-orm/issues/1625)
19+
- [[BUG]: PostgreSQL Enum Naming and Schema Typing Issue](https://github.com/drizzle-team/drizzle-orm/issues/2315)
20+
- [[BUG]: drizzle-kit instrospect command generates syntax error on varchar column types](https://github.com/drizzle-team/drizzle-orm/issues/2714)
21+
- [[BUG]: Introspecting varchar[] type produces syntactically invalid schema.ts](https://github.com/drizzle-team/drizzle-orm/issues/1633)
22+
- [[BUG]: introspect:pg column not using generated enum name](https://github.com/drizzle-team/drizzle-orm/issues/1648)
23+
- [[BUG]: drizzle-kit introspect casing "preserve" config not working](https://github.com/drizzle-team/drizzle-orm/issues/2773)
24+
- [[BUG]: drizzle-kit introspect fails on required param that is defined](https://github.com/drizzle-team/drizzle-orm/issues/2719)
25+
- [[BUG]: Error when running npx drizzle-kit introspect: "Expected object, received string"](https://github.com/drizzle-team/drizzle-orm/issues/2657)
26+
- [[BUG]: Missing index names when running introspect command [MYSQL]](https://github.com/drizzle-team/drizzle-orm/issues/2525)
27+
- [[BUG]: drizzle-kit introspect TypeError: Cannot read properties of undefined (reading 'toLowerCase')](https://github.com/drizzle-team/drizzle-orm/issues/2338)
28+
- [[BUG]: Wrong column name when using PgEnum.array()](https://github.com/drizzle-team/drizzle-orm/issues/2100)
29+
- [[BUG]: Incorrect Schema Generated when introspecting extisting pg database](https://github.com/drizzle-team/drizzle-orm/issues/1985)
30+
- [[⚠️🐞BUG]: index() missing argument after introspection, causes tsc error that fails the build](https://github.com/drizzle-team/drizzle-orm/issues/1870)
31+
- [[BUG]: drizzle-kit introspect small errors](https://github.com/drizzle-team/drizzle-orm/issues/1738)
32+
- [[BUG]: Missing bigint import in drizzle-kit introspect](https://github.com/drizzle-team/drizzle-orm/issues/1020)

drizzle-kit/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "drizzle-kit",
3-
"version": "0.24.0",
3+
"version": "0.24.1",
44
"homepage": "https://orm.drizzle.team",
55
"keywords": [
66
"drizzle",
@@ -98,7 +98,6 @@
9898
"pluralize": "^8.0.0",
9999
"postgres": "^3.4.4",
100100
"prettier": "^2.8.1",
101-
"pure-rand": "^6.1.0",
102101
"semver": "^7.5.4",
103102
"superjson": "^2.2.1",
104103
"tsup": "^8.0.2",

drizzle-kit/src/cli/commands/utils.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ export const preparePullConfig = async (
408408
dialect: 'postgresql',
409409
out: config.out,
410410
breakpoints: config.breakpoints,
411-
casing: config.introspectCasing,
411+
casing: config.casing,
412412
credentials: parsed.data,
413413
tablesFilter,
414414
schemasFilter,
@@ -426,7 +426,7 @@ export const preparePullConfig = async (
426426
dialect: 'mysql',
427427
out: config.out,
428428
breakpoints: config.breakpoints,
429-
casing: config.introspectCasing,
429+
casing: config.casing,
430430
credentials: parsed.data,
431431
tablesFilter,
432432
schemasFilter,
@@ -444,7 +444,7 @@ export const preparePullConfig = async (
444444
dialect: 'sqlite',
445445
out: config.out,
446446
breakpoints: config.breakpoints,
447-
casing: config.introspectCasing,
447+
casing: config.casing,
448448
credentials: parsed.data,
449449
tablesFilter,
450450
schemasFilter,

drizzle-kit/src/cli/validations/cli.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const pullParams = object({
3838
.optional()
3939
.default(['public']),
4040
extensionsFilters: literal('postgis').array().optional(),
41-
introspectCasing: casing,
41+
casing,
4242
breakpoints: boolean().optional().default(true),
4343
migrations: object({
4444
prefix: prefix.optional().default('index'),

drizzle-kit/src/serializer/pgSerializer.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -822,8 +822,8 @@ export const fromDatabase = async (
822822
const columnTo: string = fk.foreign_column_name;
823823
const schemaTo: string = fk.foreign_table_schema;
824824
const foreignKeyName = fk.constraint_name;
825-
const onUpdate = fk.update_rule.toLowerCase();
826-
const onDelete = fk.delete_rule.toLowerCase();
825+
const onUpdate = fk.update_rule?.toLowerCase();
826+
const onDelete = fk.delete_rule?.toLowerCase();
827827

828828
if (typeof foreignKeysToReturn[foreignKeyName] !== 'undefined') {
829829
foreignKeysToReturn[foreignKeyName].columnsFrom.push(columnFrom);
@@ -1041,7 +1041,12 @@ export const fromDatabase = async (
10411041
};
10421042

10431043
if (identityName) {
1044-
delete sequencesToReturn[`${tableSchema}.${identityName}`];
1044+
// remove "" from sequence name
1045+
delete sequencesToReturn[
1046+
`${tableSchema}.${
1047+
identityName.startsWith('"') && identityName.endsWith('"') ? identityName.slice(1, -1) : identityName
1048+
}`
1049+
];
10451050
delete sequencesToReturn[identityName];
10461051
}
10471052

pnpm-lock.yaml

+11-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)