@dbcube/schema-builder 5.1.7 → 5.2.1
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/index.cjs +12 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
- package/.npmignore +0 -51
- package/CONTRIBUTING.md +0 -9
- package/bun.lockb +0 -0
- package/pnpm-workspace.yaml +0 -2
- package/tsup.config.ts +0 -14
package/dist/index.cjs
CHANGED
|
@@ -1180,7 +1180,19 @@ var Schema = class {
|
|
|
1180
1180
|
returnFormattedError(queries.status, queries.message);
|
|
1181
1181
|
break;
|
|
1182
1182
|
}
|
|
1183
|
+
const dbType = queries.data.database_type ?? this.engine.getConfig?.()?.type;
|
|
1183
1184
|
delete queries.data.database_type;
|
|
1185
|
+
const generatedCreate = (queries.data.regular_queries ?? []).filter((q) => q.includes("CREATE"))[0];
|
|
1186
|
+
if (generatedCreate) {
|
|
1187
|
+
const diffQueries = await import_core.TableProcessor.generateAlterQueries(
|
|
1188
|
+
generatedCreate,
|
|
1189
|
+
dbType,
|
|
1190
|
+
dml.data.table,
|
|
1191
|
+
dml.data.database
|
|
1192
|
+
);
|
|
1193
|
+
const nonCreate = (queries.data.regular_queries ?? []).filter((q) => !q.includes("CREATE"));
|
|
1194
|
+
queries.data.regular_queries = [...diffQueries, ...nonCreate];
|
|
1195
|
+
}
|
|
1184
1196
|
const parseJsonQueries = JSON.stringify(queries.data);
|
|
1185
1197
|
const response = await this.engine.run("schema_engine", [
|
|
1186
1198
|
"--action",
|