@prisma/migrate 6.13.0-dev.2 → 6.13.0-dev.20
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/dist/Migrate.js +5 -5
- package/dist/SchemaEngineCLI.js +3 -3
- package/dist/SchemaEngineWasm.js +3 -3
- package/dist/bin.js +28 -30
- package/dist/{chunk-ADPKCVW6.js → chunk-2W7UX2BN.js} +9 -5
- package/dist/{chunk-V7WJDRC5.js → chunk-36YYNTIK.js} +9 -5
- package/dist/{chunk-7LY7V77P.js → chunk-CD4AWGFA.js} +5 -5
- package/dist/{chunk-B4SUSDC2.js → chunk-DYXEUKV3.js} +9 -7
- package/dist/{chunk-CRSCXIDW.js → chunk-FQCU5MBM.js} +5 -5
- package/dist/{chunk-PQKZ53DW.js → chunk-GGA2F64G.js} +8 -6
- package/dist/{chunk-5LKIRKDL.js → chunk-HFXUQT52.js} +13 -13
- package/dist/{chunk-TTZYN7EG.js → chunk-IV7HLMV3.js} +5 -5
- package/dist/{chunk-NXO3W23G.js → chunk-MC7EKKS7.js} +9 -5
- package/dist/{chunk-EFFIIN6M.js → chunk-NO7W63MC.js} +6 -6
- package/dist/{chunk-DOEFQJRR.js → chunk-ORBFWBKN.js} +7 -7
- package/dist/{chunk-OGDI56IM.js → chunk-QKNAWUSB.js} +5 -5
- package/dist/{chunk-7XBNQBAU.js → chunk-RGXAEXQZ.js} +35 -23
- package/dist/{chunk-LH6RL6H6.js → chunk-SAIG3NBV.js} +6 -6
- package/dist/chunk-VTHNUWGH.js +6004 -0
- package/dist/{chunk-PHPV3SW5.js → chunk-WMNVA5IX.js} +12 -8
- package/dist/{chunk-45UP24UI.js → chunk-XT3QE3R5.js} +18 -8
- package/dist/commands/DbExecute.js +6 -6
- package/dist/commands/DbPull.js +6 -6
- package/dist/commands/DbPush.js +6 -6
- package/dist/commands/DbSeed.js +3 -3
- package/dist/commands/MigrateDeploy.js +6 -6
- package/dist/commands/MigrateDev.js +7 -7
- package/dist/commands/MigrateDiff.js +6 -8
- package/dist/commands/MigrateReset.js +7 -7
- package/dist/commands/MigrateResolve.js +6 -6
- package/dist/commands/MigrateStatus.js +6 -6
- package/dist/index.js +32 -34
- package/dist/internals/src/cli/getSchema.d.ts +6 -8
- package/dist/migrate/src/Migrate.d.ts +5 -1
- package/dist/migrate/src/SchemaEngine.d.ts +1 -1
- package/dist/migrate/src/SchemaEngineCLI.d.ts +1 -1
- package/dist/migrate/src/SchemaEngineWasm.d.ts +10 -2
- package/dist/migrate/src/types.d.ts +10 -0
- package/dist/migrate/src/utils/listMigrations.d.ts +1 -1
- package/dist/migrate/src/utils/seed.d.ts +5 -0
- package/dist/utils/getDatabaseVersionSafe.js +6 -6
- package/dist/utils/introspectSql.js +6 -6
- package/dist/utils/listMigrations.js +2 -2
- package/dist/utils/seed.js +3 -3
- package/dist/utils/setupMSSQL.js +586 -37
- package/dist/utils/setupMysql.js +1376 -2
- package/package.json +10 -10
- package/dist/chunk-33LPBNDX.js +0 -1399
- package/dist/chunk-AUGZZ6RT.js +0 -584
- package/dist/chunk-QM4W5GWJ.js +0 -10782
|
@@ -26,17 +26,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_RGXAEXQZ_exports = {};
|
|
30
|
+
__export(chunk_RGXAEXQZ_exports, {
|
|
31
31
|
Migrate: () => Migrate
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_RGXAEXQZ_exports);
|
|
34
34
|
var import_chunk_URKH6SE2 = require("./chunk-URKH6SE2.js");
|
|
35
35
|
var import_chunk_PCTCQIOH = require("./chunk-PCTCQIOH.js");
|
|
36
|
-
var
|
|
36
|
+
var import_chunk_GGA2F64G = require("./chunk-GGA2F64G.js");
|
|
37
37
|
var import_chunk_23DZXSTI = require("./chunk-23DZXSTI.js");
|
|
38
|
-
var
|
|
39
|
-
var
|
|
38
|
+
var import_chunk_ORBFWBKN = require("./chunk-ORBFWBKN.js");
|
|
39
|
+
var import_chunk_CD4AWGFA = require("./chunk-CD4AWGFA.js");
|
|
40
40
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
41
41
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
42
42
|
var import_client_generator_registry = require("@prisma/client-generator-registry");
|
|
@@ -731,18 +731,22 @@ var logUpdateStderr = createLogUpdate(import_node_process.default.stderr);
|
|
|
731
731
|
var Migrate = class _Migrate {
|
|
732
732
|
engine;
|
|
733
733
|
schemaContext;
|
|
734
|
+
schemaFilter;
|
|
735
|
+
shadowDbInitScript;
|
|
734
736
|
migrationsDirectoryPath;
|
|
735
|
-
constructor({ schemaContext, migrationsDirPath, engine }) {
|
|
737
|
+
constructor({ schemaContext, migrationsDirPath, engine, schemaFilter, shadowDbInitScript }) {
|
|
736
738
|
this.engine = engine;
|
|
737
739
|
this.schemaContext = schemaContext;
|
|
738
740
|
this.migrationsDirectoryPath = migrationsDirPath;
|
|
741
|
+
this.schemaFilter = schemaFilter ?? { externalTables: [], externalEnums: [] };
|
|
742
|
+
this.shadowDbInitScript = shadowDbInitScript ?? "";
|
|
739
743
|
}
|
|
740
744
|
static async setup({ adapter, schemaContext, ...rest }) {
|
|
741
745
|
const engine = await (async () => {
|
|
742
746
|
if (adapter) {
|
|
743
|
-
return await
|
|
747
|
+
return await import_chunk_ORBFWBKN.SchemaEngineWasm.setup({ adapter, schemaContext, ...rest });
|
|
744
748
|
} else {
|
|
745
|
-
return await
|
|
749
|
+
return await import_chunk_CD4AWGFA.SchemaEngineCLI.setup({ schemaContext, ...rest });
|
|
746
750
|
}
|
|
747
751
|
})();
|
|
748
752
|
(0, import_chunk_PCTCQIOH.warnDatasourceDriverAdapter)(schemaContext, adapter);
|
|
@@ -756,14 +760,17 @@ var Migrate = class _Migrate {
|
|
|
756
760
|
return (0, import_internals.toSchemasContainer)(this.schemaContext.schemaFiles);
|
|
757
761
|
}
|
|
758
762
|
reset() {
|
|
759
|
-
return this.engine.reset(
|
|
763
|
+
return this.engine.reset({
|
|
764
|
+
filter: this.schemaFilter
|
|
765
|
+
});
|
|
760
766
|
}
|
|
761
767
|
async createMigration(params) {
|
|
762
768
|
if (!this.migrationsDirectoryPath) throw new Error("this.migrationsDirectoryPath is undefined");
|
|
763
|
-
const migrationsList = await (0,
|
|
769
|
+
const migrationsList = await (0, import_chunk_GGA2F64G.listMigrations)(this.migrationsDirectoryPath, this.shadowDbInitScript);
|
|
764
770
|
const { connectorType, generatedMigrationName, extension, migrationScript } = await this.engine.createMigration({
|
|
765
771
|
...params,
|
|
766
|
-
migrationsList
|
|
772
|
+
migrationsList,
|
|
773
|
+
filters: this.schemaFilter
|
|
767
774
|
});
|
|
768
775
|
const { baseDir, lockfile } = migrationsList;
|
|
769
776
|
if (migrationScript === null) {
|
|
@@ -800,29 +807,31 @@ var Migrate = class _Migrate {
|
|
|
800
807
|
optInToShadowDatabase
|
|
801
808
|
}) {
|
|
802
809
|
if (!this.migrationsDirectoryPath) throw new Error("this.migrationsDirectoryPath is undefined");
|
|
803
|
-
const migrationsList = await (0,
|
|
810
|
+
const migrationsList = await (0, import_chunk_GGA2F64G.listMigrations)(this.migrationsDirectoryPath, this.shadowDbInitScript);
|
|
804
811
|
return this.engine.diagnoseMigrationHistory({
|
|
805
812
|
migrationsList,
|
|
806
|
-
optInToShadowDatabase
|
|
813
|
+
optInToShadowDatabase,
|
|
814
|
+
filters: this.schemaFilter
|
|
807
815
|
});
|
|
808
816
|
}
|
|
809
817
|
async listMigrationDirectories() {
|
|
810
818
|
if (!this.migrationsDirectoryPath) throw new Error("this.migrationsDirectoryPath is undefined");
|
|
811
|
-
const migrationsList = await (0,
|
|
819
|
+
const migrationsList = await (0, import_chunk_GGA2F64G.listMigrations)(this.migrationsDirectoryPath, this.shadowDbInitScript);
|
|
812
820
|
return {
|
|
813
821
|
migrations: migrationsList.migrationDirectories.map((dir) => dir.path)
|
|
814
822
|
};
|
|
815
823
|
}
|
|
816
824
|
async devDiagnostic() {
|
|
817
825
|
if (!this.migrationsDirectoryPath) throw new Error("this.migrationsDirectoryPath is undefined");
|
|
818
|
-
const migrationsList = await (0,
|
|
826
|
+
const migrationsList = await (0, import_chunk_GGA2F64G.listMigrations)(this.migrationsDirectoryPath, this.shadowDbInitScript);
|
|
819
827
|
return this.engine.devDiagnostic({
|
|
820
|
-
migrationsList
|
|
828
|
+
migrationsList,
|
|
829
|
+
filters: this.schemaFilter
|
|
821
830
|
});
|
|
822
831
|
}
|
|
823
832
|
async markMigrationApplied({ migrationId }) {
|
|
824
833
|
if (!this.migrationsDirectoryPath) throw new Error("this.migrationsDirectoryPath is undefined");
|
|
825
|
-
const migrationsList = await (0,
|
|
834
|
+
const migrationsList = await (0, import_chunk_GGA2F64G.listMigrations)(this.migrationsDirectoryPath, this.shadowDbInitScript);
|
|
826
835
|
return await this.engine.markMigrationApplied({
|
|
827
836
|
migrationsList,
|
|
828
837
|
migrationName: migrationId
|
|
@@ -835,25 +844,28 @@ var Migrate = class _Migrate {
|
|
|
835
844
|
}
|
|
836
845
|
async applyMigrations() {
|
|
837
846
|
if (!this.migrationsDirectoryPath) throw new Error("this.migrationsDirectoryPath is undefined");
|
|
838
|
-
const migrationsList = await (0,
|
|
847
|
+
const migrationsList = await (0, import_chunk_GGA2F64G.listMigrations)(this.migrationsDirectoryPath, this.shadowDbInitScript);
|
|
839
848
|
return this.engine.applyMigrations({
|
|
840
|
-
migrationsList
|
|
849
|
+
migrationsList,
|
|
850
|
+
filters: this.schemaFilter
|
|
841
851
|
});
|
|
842
852
|
}
|
|
843
853
|
async evaluateDataLoss() {
|
|
844
854
|
if (!this.migrationsDirectoryPath) throw new Error("this.migrationsDirectoryPath is undefined");
|
|
845
|
-
const migrationsList = await (0,
|
|
855
|
+
const migrationsList = await (0, import_chunk_GGA2F64G.listMigrations)(this.migrationsDirectoryPath, this.shadowDbInitScript);
|
|
846
856
|
const schema = this.getPrismaSchema();
|
|
847
857
|
return this.engine.evaluateDataLoss({
|
|
848
858
|
migrationsList,
|
|
849
|
-
schema
|
|
859
|
+
schema,
|
|
860
|
+
filters: this.schemaFilter
|
|
850
861
|
});
|
|
851
862
|
}
|
|
852
863
|
async push({ force = false }) {
|
|
853
864
|
const schema = this.getPrismaSchema();
|
|
854
865
|
const { warnings, unexecutable, executedSteps } = await this.engine.schemaPush({
|
|
855
866
|
force,
|
|
856
|
-
schema
|
|
867
|
+
schema,
|
|
868
|
+
filters: this.schemaFilter
|
|
857
869
|
});
|
|
858
870
|
return {
|
|
859
871
|
executedSteps,
|
|
@@ -16,14 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_SAIG3NBV_exports = {};
|
|
20
|
+
__export(chunk_SAIG3NBV_exports, {
|
|
21
21
|
MigrateResolve: () => MigrateResolve
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_SAIG3NBV_exports);
|
|
24
24
|
var import_chunk_2FXU5NZQ = require("./chunk-2FXU5NZQ.js");
|
|
25
25
|
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
26
|
-
var
|
|
26
|
+
var import_chunk_RGXAEXQZ = require("./chunk-RGXAEXQZ.js");
|
|
27
27
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
28
28
|
var import_internals = require("@prisma/internals");
|
|
29
29
|
var MigrateResolve = class _MigrateResolve {
|
|
@@ -112,7 +112,7 @@ ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.green)((0, import_in
|
|
|
112
112
|
if (!adapter) {
|
|
113
113
|
await (0, import_chunk_74LUB4XX.ensureCanConnectToDatabase)(schemaContext.primaryDatasource);
|
|
114
114
|
}
|
|
115
|
-
const migrate = await
|
|
115
|
+
const migrate = await import_chunk_RGXAEXQZ.Migrate.setup({ adapter, migrationsDirPath, schemaContext });
|
|
116
116
|
try {
|
|
117
117
|
await migrate.markMigrationApplied({
|
|
118
118
|
migrationId: args["--applied"]
|
|
@@ -133,7 +133,7 @@ Migration ${args["--applied"]} marked as applied.
|
|
|
133
133
|
);
|
|
134
134
|
}
|
|
135
135
|
await (0, import_chunk_74LUB4XX.ensureCanConnectToDatabase)(schemaContext.primaryDatasource);
|
|
136
|
-
const migrate = await
|
|
136
|
+
const migrate = await import_chunk_RGXAEXQZ.Migrate.setup({ adapter: void 0, migrationsDirPath, schemaContext });
|
|
137
137
|
try {
|
|
138
138
|
await migrate.markMigrationRolledBack({
|
|
139
139
|
migrationId: args["--rolled-back"]
|