This commit is contained in:
2026-01-14 11:01:08 +01:00
parent 0a03405598
commit b50e100732
8 changed files with 91 additions and 20 deletions
+21
View File
@@ -19,6 +19,7 @@ const handle_table_foreign_key_1 = __importDefault(require("./handle-table-forei
const handle_dsql_schema_fields_1 = __importDefault(require("./handle-dsql-schema-fields"));
const handle_mariadb_existing_columns_1 = __importDefault(require("./handle-mariadb-existing-columns"));
const update_table_init_1 = __importDefault(require("./update-table-init"));
const debug_log_1 = __importDefault(require("../../utils/logging/debug-log"));
/**
* # Update table function
*/
@@ -41,6 +42,10 @@ function updateTable(_a) {
* @description Try to undate table, catch error if anything goes wrong
*/
try {
(0, debug_log_1.default)({
log: `Handling Existing Columns ...`,
addTime: true,
});
const { allExistingColumns, upToDateTableFieldsArray } = yield (0, handle_mariadb_existing_columns_1.default)({
dbFullName,
dbSchema,
@@ -54,6 +59,10 @@ function updateTable(_a) {
* @description Iterate through each field object and
* perform operations
*/
(0, debug_log_1.default)({
log: `Handling Schema Fields ...`,
addTime: true,
});
yield (0, handle_dsql_schema_fields_1.default)({
dbFullName,
tableName,
@@ -66,6 +75,10 @@ function updateTable(_a) {
* @description Iterate through each datasquirel schema
* table index(if available), and perform operations
*/
(0, debug_log_1.default)({
log: `Handling Table Foreign Keys ...`,
addTime: true,
});
yield (0, handle_table_foreign_key_1.default)({
dbFullName,
fields: upToDateTableFieldsArray,
@@ -78,6 +91,10 @@ function updateTable(_a) {
* @description Iterate through each datasquirel schema
* table index(if available), and perform operations
*/
(0, debug_log_1.default)({
log: `Handling Table Indexes ...`,
addTime: true,
});
if (tableIndexes === null || tableIndexes === void 0 ? void 0 : tableIndexes[0]) {
(0, handle_indexes_1.default)({
dbFullName,
@@ -91,6 +108,10 @@ function updateTable(_a) {
* @description Iterate through each datasquirel schema
* table unique constraint(if available), and perform operations
*/
(0, debug_log_1.default)({
log: `Handling Unique Constraints ...`,
addTime: true,
});
if (tableUniqueConstraints === null || tableUniqueConstraints === void 0 ? void 0 : tableUniqueConstraints[0]) {
(0, handle_unique_constraints_1.default)({
dbFullName,