kythia-core 0.9.4-beta.0 → 0.9.4-beta.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/changelog.md +7 -0
- package/package.json +1 -1
- package/src/database/KythiaORM.js +10 -5
package/changelog.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.9.4-beta.1](https://github.com/kenndeclouv/kythia-core/compare/v0.9.4-beta.0...v0.9.4-beta.1) (2025-11-09)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ✨ Added
|
|
9
|
+
|
|
10
|
+
* Refactor KythiaORM to sync multiple models in a single operation, improving efficiency and logging. Updated version hashes in model_versions table after sync completion. ([1bc195d](https://github.com/kenndeclouv/kythia-core/commit/1bc195d17d67865d01cb6c0290a2715f876b2451))
|
|
11
|
+
|
|
5
12
|
### 0.9.4-beta.0 (2025-11-04)
|
|
6
13
|
|
|
7
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kythia-core",
|
|
3
|
-
"version": "0.9.4-beta.
|
|
3
|
+
"version": "0.9.4-beta.1",
|
|
4
4
|
"description": "Core library for the Kythia main Discord bot: extensible, modular, and scalable foundation for commands, components, and event management.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -448,10 +448,17 @@ async function KythiaORM({ kythiaInstance, sequelize, KythiaModel, logger, confi
|
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
451
|
+
const modelNamesToSync = modelsToSync.map(m => m.model.name);
|
|
452
|
+
|
|
453
|
+
logger.info(`🔄 Syncing models via sequelize.sync(): ${modelNamesToSync.join(', ')}...`);
|
|
454
|
+
await sequelize.sync({
|
|
455
|
+
models: modelNamesToSync,
|
|
456
|
+
alter: true,
|
|
457
|
+
});
|
|
458
|
+
logger.info('✅ Model sync complete.');
|
|
454
459
|
|
|
460
|
+
logger.info('💾 Updating version hashes in model_versions table...');
|
|
461
|
+
for (const { model, newHash } of modelsToSync) {
|
|
455
462
|
await sequelize.query(
|
|
456
463
|
`INSERT INTO ${versionTableName} (model_name, version_hash, updated_at)
|
|
457
464
|
VALUES (?, ?, CURRENT_TIMESTAMP)
|
|
@@ -462,8 +469,6 @@ async function KythiaORM({ kythiaInstance, sequelize, KythiaModel, logger, confi
|
|
|
462
469
|
type: sequelize.QueryTypes.INSERT,
|
|
463
470
|
}
|
|
464
471
|
);
|
|
465
|
-
|
|
466
|
-
logger.info(`✅ Synced model: ${model.name} (${newHash})`);
|
|
467
472
|
}
|
|
468
473
|
|
|
469
474
|
logger.info('✨ Database sync completed successfully!');
|