prisma-laravel-migrate 0.0.21 → 0.0.23
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.
|
@@ -94,7 +94,7 @@ export async function generateLaravelSchema(options) {
|
|
|
94
94
|
// 3) Extract full & generated parts from your printer
|
|
95
95
|
const { fullContent: content } = printer.printMigration(mig);
|
|
96
96
|
// 4) Write with markers as before
|
|
97
|
-
|
|
97
|
+
!cfg.noEmit &&
|
|
98
98
|
writeWithMerge(filePath, content, cfg.overwriteExisting ?? false);
|
|
99
99
|
});
|
|
100
100
|
return migrations;
|
|
@@ -78,7 +78,7 @@ export async function generateLaravelModels(options) {
|
|
|
78
78
|
for (const enumDef of enums) {
|
|
79
79
|
const enumPhp = printer.printEnum(enumDef);
|
|
80
80
|
const enumFile = path.join(enumsDir, `${enumDef.name}.php`);
|
|
81
|
-
|
|
81
|
+
!cfg.noEmit &&
|
|
82
82
|
writeWithMerge(enumFile, enumPhp, cfg.overwriteExisting ?? false);
|
|
83
83
|
}
|
|
84
84
|
// 5) Write model files
|
|
@@ -89,11 +89,13 @@ export async function generateLaravelModels(options) {
|
|
|
89
89
|
model.imports.push(...imports);
|
|
90
90
|
else
|
|
91
91
|
model.imports = imports;
|
|
92
|
+
//---
|
|
93
|
+
model.imports = Array.from(new Set(model.imports));
|
|
92
94
|
//----
|
|
93
95
|
const content = buildModelContent(model);
|
|
94
96
|
const modelPhp = printer.printModel(model, enums, content);
|
|
95
97
|
const modelFile = path.join(modelsDir, `${model.className}.php`);
|
|
96
|
-
|
|
98
|
+
!cfg.noEmit &&
|
|
97
99
|
writeWithMerge(modelFile, modelPhp, cfg.overwriteExisting ?? false);
|
|
98
100
|
}
|
|
99
101
|
return { models, enums };
|