@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.js
CHANGED
|
@@ -1138,7 +1138,19 @@ var Schema = class {
|
|
|
1138
1138
|
returnFormattedError(queries.status, queries.message);
|
|
1139
1139
|
break;
|
|
1140
1140
|
}
|
|
1141
|
+
const dbType = queries.data.database_type ?? this.engine.getConfig?.()?.type;
|
|
1141
1142
|
delete queries.data.database_type;
|
|
1143
|
+
const generatedCreate = (queries.data.regular_queries ?? []).filter((q) => q.includes("CREATE"))[0];
|
|
1144
|
+
if (generatedCreate) {
|
|
1145
|
+
const diffQueries = await TableProcessor.generateAlterQueries(
|
|
1146
|
+
generatedCreate,
|
|
1147
|
+
dbType,
|
|
1148
|
+
dml.data.table,
|
|
1149
|
+
dml.data.database
|
|
1150
|
+
);
|
|
1151
|
+
const nonCreate = (queries.data.regular_queries ?? []).filter((q) => !q.includes("CREATE"));
|
|
1152
|
+
queries.data.regular_queries = [...diffQueries, ...nonCreate];
|
|
1153
|
+
}
|
|
1142
1154
|
const parseJsonQueries = JSON.stringify(queries.data);
|
|
1143
1155
|
const response = await this.engine.run("schema_engine", [
|
|
1144
1156
|
"--action",
|