MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / migrate

Function migrate

scripts/migrate.js:295–316  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

293};
294
295const migrate = async () => {
296 const client = await pool.connect();
297
298 try {
299 logger.info('🚀 Starting database migration...');
300
301 await createTables(client);
302 await createIndexes(client);
303 await createTriggers(client);
304 await recordSchemaVersion(client);
305
306 logger.info('✨ Migration completed successfully!');
307 logger.info(`📌 Schema version recorded: v${EXPECTED_SCHEMA_VERSION} (${EXPECTED_SCHEMA_LABEL})`);
308 logger.info('📚 Your database is now ready for TitanBot.');
309 } catch (error) {
310 logger.error('❌ Migration failed:', error);
311 process.exit(1);
312 } finally {
313 client.release();
314 await pool.end();
315 }
316};
317
318const checkMigrationVersion = async () => {
319 const client = await pool.connect();

Callers 1

migrate.jsFile · 0.85

Calls 5

createTablesFunction · 0.85
createIndexesFunction · 0.85
createTriggersFunction · 0.85
recordSchemaVersionFunction · 0.85
connectMethod · 0.80

Tested by

no test coverage detected