Skip to content

Commit bb3aaf1

Browse files
AleksandrShermanOleksiiKH0240AlexBlokhAndriiShermanSukairo-02
authored
Beta.7 (#5200)
* [update]: int tests removed skipIf in some tests * [update-kit]: changelog * [update-kit]: pg index issue fixed * [kit-fix]: pg + cockroach issue * [kit]: mssql issue * Fixed bun-sqlite rqbv2 mapper error on empty get response (fixes #5189) * Up all versions to 7 + orm changelog * changelog update * [update-kit]: tests on ignore migrations config schema/table + minor updates * [fix-kit]: fixed all fromDatabaseForDrizzle params * [fix-kit]: fixed broken tests * [kit-fix]: broken tests --------- Co-authored-by: OleksiiKH0240 <[email protected]> Co-authored-by: Alex Blokh <[email protected]> Co-authored-by: AndriiSherman <[email protected]> Co-authored-by: Sukairo-02 <[email protected]>
1 parent 4414a19 commit bb3aaf1

File tree

78 files changed

+2743
-252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2743
-252
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## Bug fixes
2+
3+
- https://github.com/drizzle-team/drizzle-orm/issues/5143
4+
- [[BUG]: drizzle-kit push removes migration table (doesn't recognize custom migration table name)](https://github.com/drizzle-team/drizzle-orm/issues/5083)
5+
- [[BUG]:Drizzle pull generate invalid autosummarize](https://github.com/drizzle-team/drizzle-orm/issues/5196)
6+
- [[BUG]: drizzle-kit pull generated wrong syntax](https://github.com/drizzle-team/drizzle-orm/issues/5193)
7+
- [[BUG]: [drizzle-kit] MSSQL - Foreign Key Constraints Generated via drizzle-kit generate are not scoped to the Correct Schema](https://github.com/drizzle-team/drizzle-orm/issues/5182)
8+
9+
- **Push** command now respects a custom migration schema or/and table from ***drizzle.config*** and ignores them during the execution
10+
11+
## Breaking changes
12+
13+
### The `migrations`.`prefix` field was removed from `drizzle-kit` config
14+
The following syntax is now deprecated:
15+
```ts
16+
migrations: {
17+
prefix: 'index'
18+
}
19+
```
20+
You can no longer use it to define your `drizzle.config.ts` file like this:
21+
```ts {11-13}
22+
import { defineConfig } from "drizzle-kit";
23+
24+
export default defineConfig({
25+
dialect: "postgresql",
26+
schema: "./schema.ts",
27+
out: "./drizzle",
28+
dbCredentials: {
29+
url: "postgres://postgres:postgres@localhost:5432/postgres",
30+
},
31+
// ❌ deprecated, will be removed
32+
migrations: {
33+
prefix: 'index'
34+
}
35+
});
36+
```
37+
There is no alternatives for `prefix` at the moment.
38+
We will consider adding one in the future for compatibility with some providers.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Bug fixes
2+
3+
- [[BUG]: findFirst fails with TypeError: null is not an object (evaluating 'row[selectionItem.key]') if no results are found](https://github.com/drizzle-team/drizzle-orm/issues/5189)

drizzle-arktype/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "drizzle-arktype",
3-
"version": "1.0.0-beta.6",
3+
"version": "1.0.0-beta.7",
44
"description": "Generate arktype schemas from Drizzle ORM schemas",
55
"type": "module",
66
"scripts": {

drizzle-kit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "drizzle-kit",
3-
"version": "1.0.0-beta.6",
3+
"version": "1.0.0-beta.7",
44
"homepage": "https://orm.drizzle.team",
55
"keywords": [
66
"drizzle",

drizzle-kit/src/cli/commands/generate-cockroach.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export const handle = async (config: GenerateConfig) => {
3333
name: config.name,
3434
breakpoints: config.breakpoints,
3535
type: 'custom',
36-
prefixMode: config.prefix,
3736
renames: [],
3837
snapshots,
3938
});
@@ -63,7 +62,6 @@ export const handle = async (config: GenerateConfig) => {
6362
outFolder,
6463
name: config.name,
6564
breakpoints: config.breakpoints,
66-
prefixMode: config.prefix,
6765
renames,
6866
snapshots,
6967
});

drizzle-kit/src/cli/commands/generate-common.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ import type { MysqlSnapshot } from '../../dialects/mysql/snapshot';
1010
import type { SqliteSnapshot } from '../../dialects/sqlite/snapshot';
1111
import { BREAKPOINT } from '../../utils';
1212
import { prepareMigrationMetadata } from '../../utils/words';
13-
import type { Driver, Prefix } from '../validations/common';
13+
import type { Driver } from '../validations/common';
1414

1515
export const writeResult = (config: {
1616
snapshot: SqliteSnapshot | PostgresSnapshot | MysqlSnapshot | MssqlSnapshot | CockroachSnapshot | SingleStoreSnapshot;
1717
sqlStatements: string[];
1818
outFolder: string;
1919
breakpoints: boolean;
20-
prefixMode: Prefix;
2120
name?: string;
2221
bundle?: boolean;
2322
type?: 'introspect' | 'custom' | 'none';

drizzle-kit/src/cli/commands/generate-mssql.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export const handle = async (config: GenerateConfig) => {
3535
name: config.name,
3636
breakpoints: config.breakpoints,
3737
type: 'custom',
38-
prefixMode: config.prefix,
3938
renames: [],
4039
snapshots,
4140
});
@@ -82,7 +81,6 @@ export const handle = async (config: GenerateConfig) => {
8281
outFolder,
8382
name: config.name,
8483
breakpoints: config.breakpoints,
85-
prefixMode: config.prefix,
8684
renames,
8785
snapshots,
8886
});

drizzle-kit/src/cli/commands/generate-mysql.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ export const handle = async (config: GenerateConfig) => {
102102
name: config.name,
103103
breakpoints: config.breakpoints,
104104
type: 'custom',
105-
prefixMode: config.prefix,
106105
renames: [],
107106
snapshots,
108107
});
@@ -133,7 +132,6 @@ export const handle = async (config: GenerateConfig) => {
133132
outFolder,
134133
name: config.name,
135134
breakpoints: config.breakpoints,
136-
prefixMode: config.prefix,
137135
renames,
138136
snapshots,
139137
});

drizzle-kit/src/cli/commands/generate-postgres.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export const handle = async (config: GenerateConfig) => {
3838
name: config.name,
3939
breakpoints: config.breakpoints,
4040
type: 'custom',
41-
prefixMode: config.prefix,
4241
renames: [],
4342
snapshots,
4443
});
@@ -65,7 +64,7 @@ export const handle = async (config: GenerateConfig) => {
6564
'default',
6665
);
6766

68-
const explainMessage = explain('mysql', groupedStatements, false, []);
67+
const explainMessage = explain('postgres', groupedStatements, false, []);
6968
if (explainMessage) console.log(explainMessage);
7069

7170
writeResult({
@@ -74,7 +73,6 @@ export const handle = async (config: GenerateConfig) => {
7473
outFolder,
7574
name: config.name,
7675
breakpoints: config.breakpoints,
77-
prefixMode: config.prefix,
7876
renames,
7977
snapshots,
8078
});

0 commit comments

Comments
 (0)