drizzle-kit 1.0.0-beta.1-14dce51 → 1.0.0-beta.1-ec0aae1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.d.mts +3 -3
- package/api.d.ts +3 -3
- package/bin.cjs +11 -3
- package/package.json +1 -1
package/api.d.mts
CHANGED
@@ -2621,7 +2621,7 @@ type DrizzleMySQLSnapshotJSON = MySqlSchema;
|
|
2621
2621
|
type DrizzleSingleStoreSnapshotJSON = SingleStoreSchema;
|
2622
2622
|
declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string, schemaFilters?: string[], casing?: CasingType) => PgSchema;
|
2623
2623
|
declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
|
2624
|
-
declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>, schemaFilters?: string[], tablesFilter?: string[], extensionsFilters?: Config["extensionsFilters"]) => Promise<{
|
2624
|
+
declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any, any, any, any, any>, schemaFilters?: string[], tablesFilter?: string[], extensionsFilters?: Config["extensionsFilters"]) => Promise<{
|
2625
2625
|
hasDataLoss: boolean;
|
2626
2626
|
warnings: string[];
|
2627
2627
|
statementsToExecute: string[];
|
@@ -2629,7 +2629,7 @@ declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: Pg
|
|
2629
2629
|
}>;
|
2630
2630
|
declare const generateSQLiteDrizzleJson: (imports: Record<string, unknown>, prevId?: string, casing?: CasingType) => Promise<SQLiteSchema>;
|
2631
2631
|
declare const generateSQLiteMigration: (prev: DrizzleSQLiteSnapshotJSON, cur: DrizzleSQLiteSnapshotJSON) => Promise<string[]>;
|
2632
|
-
declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstance: LibSQLDatabase<any>) => Promise<{
|
2632
|
+
declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstance: LibSQLDatabase<any, any>) => Promise<{
|
2633
2633
|
hasDataLoss: boolean;
|
2634
2634
|
warnings: string[];
|
2635
2635
|
statementsToExecute: string[];
|
@@ -2637,7 +2637,7 @@ declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstan
|
|
2637
2637
|
}>;
|
2638
2638
|
declare const generateMySQLDrizzleJson: (imports: Record<string, unknown>, prevId?: string, casing?: CasingType) => Promise<MySqlSchema>;
|
2639
2639
|
declare const generateMySQLMigration: (prev: DrizzleMySQLSnapshotJSON, cur: DrizzleMySQLSnapshotJSON) => Promise<string[]>;
|
2640
|
-
declare const pushMySQLSchema: (imports: Record<string, unknown>, drizzleInstance: MySql2Database<any>, databaseName: string) => Promise<{
|
2640
|
+
declare const pushMySQLSchema: (imports: Record<string, unknown>, drizzleInstance: MySql2Database<any, any>, databaseName: string) => Promise<{
|
2641
2641
|
hasDataLoss: boolean;
|
2642
2642
|
warnings: string[];
|
2643
2643
|
statementsToExecute: string[];
|
package/api.d.ts
CHANGED
@@ -2621,7 +2621,7 @@ type DrizzleMySQLSnapshotJSON = MySqlSchema;
|
|
2621
2621
|
type DrizzleSingleStoreSnapshotJSON = SingleStoreSchema;
|
2622
2622
|
declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string, schemaFilters?: string[], casing?: CasingType) => PgSchema;
|
2623
2623
|
declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
|
2624
|
-
declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>, schemaFilters?: string[], tablesFilter?: string[], extensionsFilters?: Config["extensionsFilters"]) => Promise<{
|
2624
|
+
declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any, any, any, any, any>, schemaFilters?: string[], tablesFilter?: string[], extensionsFilters?: Config["extensionsFilters"]) => Promise<{
|
2625
2625
|
hasDataLoss: boolean;
|
2626
2626
|
warnings: string[];
|
2627
2627
|
statementsToExecute: string[];
|
@@ -2629,7 +2629,7 @@ declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: Pg
|
|
2629
2629
|
}>;
|
2630
2630
|
declare const generateSQLiteDrizzleJson: (imports: Record<string, unknown>, prevId?: string, casing?: CasingType) => Promise<SQLiteSchema>;
|
2631
2631
|
declare const generateSQLiteMigration: (prev: DrizzleSQLiteSnapshotJSON, cur: DrizzleSQLiteSnapshotJSON) => Promise<string[]>;
|
2632
|
-
declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstance: LibSQLDatabase<any>) => Promise<{
|
2632
|
+
declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstance: LibSQLDatabase<any, any>) => Promise<{
|
2633
2633
|
hasDataLoss: boolean;
|
2634
2634
|
warnings: string[];
|
2635
2635
|
statementsToExecute: string[];
|
@@ -2637,7 +2637,7 @@ declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstan
|
|
2637
2637
|
}>;
|
2638
2638
|
declare const generateMySQLDrizzleJson: (imports: Record<string, unknown>, prevId?: string, casing?: CasingType) => Promise<MySqlSchema>;
|
2639
2639
|
declare const generateMySQLMigration: (prev: DrizzleMySQLSnapshotJSON, cur: DrizzleMySQLSnapshotJSON) => Promise<string[]>;
|
2640
|
-
declare const pushMySQLSchema: (imports: Record<string, unknown>, drizzleInstance: MySql2Database<any>, databaseName: string) => Promise<{
|
2640
|
+
declare const pushMySQLSchema: (imports: Record<string, unknown>, drizzleInstance: MySql2Database<any, any>, databaseName: string) => Promise<{
|
2641
2641
|
hasDataLoss: boolean;
|
2642
2642
|
warnings: string[];
|
2643
2643
|
statementsToExecute: string[];
|
package/bin.cjs
CHANGED
@@ -86257,7 +86257,7 @@ var init_introspect = __esm({
|
|
86257
86257
|
name: (0, import_pluralize.plural)(toTable1),
|
86258
86258
|
type: "many-through",
|
86259
86259
|
tableFrom: toTable2,
|
86260
|
-
columnsFrom: fk22.
|
86260
|
+
columnsFrom: fk22.columnsTo,
|
86261
86261
|
tableTo: toTable1,
|
86262
86262
|
columnsTo: columnsTo2,
|
86263
86263
|
tableThrough,
|
@@ -86315,7 +86315,15 @@ import * as schema from "./schema";
|
|
86315
86315
|
(it, originIndex) => relationIndex !== originIndex && it.tableTo === relation.tableTo
|
86316
86316
|
);
|
86317
86317
|
if (hasMultipleRelations) {
|
86318
|
-
|
86318
|
+
if (relation.type === "one") {
|
86319
|
+
relationName = `${relation.tableFrom}_${relation.columnsFrom.join("_")}_${relation.tableTo}_${relation.columnsTo.join("_")}`;
|
86320
|
+
} else if (relation.type === "many") {
|
86321
|
+
relationName = `${relation.tableTo}_${relation.columnsTo.join("_")}_${relation.tableFrom}_${relation.columnsFrom.join("_")}`;
|
86322
|
+
} else if (relation.type === "through") {
|
86323
|
+
relationName = `${relation.tableFrom}_${relation.columnsFrom.join("_")}_${relation.tableTo}_${relation.columnsTo.join("_")}_via_${relation.tableThrough}`;
|
86324
|
+
} else {
|
86325
|
+
relationName = `${relation.tableTo}_${relation.columnsTo.join("_")}_${relation.tableFrom}_${relation.columnsFrom.join("_")}_via_${relation.tableThrough}`;
|
86326
|
+
}
|
86319
86327
|
}
|
86320
86328
|
const hasDuplicatedRelation = originArray.some(
|
86321
86329
|
(it, originIndex) => relationIndex !== originIndex && it.name === relation.name
|
@@ -92721,7 +92729,7 @@ init_utils5();
|
|
92721
92729
|
var version2 = async () => {
|
92722
92730
|
const { npmVersion } = await ormCoreVersions();
|
92723
92731
|
const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : "";
|
92724
|
-
const envVersion = "1.0.0-beta.1-
|
92732
|
+
const envVersion = "1.0.0-beta.1-ec0aae1";
|
92725
92733
|
const kitVersion = envVersion ? `v${envVersion}` : "--";
|
92726
92734
|
const versions = `drizzle-kit: ${kitVersion}
|
92727
92735
|
${ormVersion}`;
|