feat: persistent lootbox states, update command now runs db migrations
This commit is contained in:
@@ -76,9 +76,27 @@ export const update = createCommand({
|
||||
|
||||
const { stdout } = await execAsync(`git reset --hard origin/${branch}`);
|
||||
|
||||
// Run DB Migrations
|
||||
await confirmation.editReply({
|
||||
embeds: [createWarningEmbed("Updating database schema...", "Running Migrations")],
|
||||
components: []
|
||||
});
|
||||
|
||||
let migrationOutput = "";
|
||||
try {
|
||||
const { stdout: dbOut } = await execAsync("bun run db:push:local");
|
||||
migrationOutput = dbOut;
|
||||
} catch (dbErr: any) {
|
||||
migrationOutput = `Migration Failed: ${dbErr.message}`;
|
||||
console.error("Migration Error:", dbErr);
|
||||
// We continue with restart even if migration fails?
|
||||
// Probably safer to try, or should we abort?
|
||||
// For now, let's log it and proceed, as code might depend on it but maybe it was a no-op partial fail.
|
||||
}
|
||||
|
||||
await interaction.followUp({
|
||||
flags: MessageFlags.Ephemeral,
|
||||
embeds: [createSuccessEmbed(`Git Reset Output:\n\`\`\`\n${stdout}\n\`\`\`\nRestarting process...`, "Update Successful")]
|
||||
embeds: [createSuccessEmbed(`Git Reset Output:\n\`\`\`\n${stdout}\n\`\`\`\nDB Migration Output:\n\`\`\`\n${migrationOutput}\n\`\`\`\nRestarting process...`, "Update Successful")]
|
||||
});
|
||||
|
||||
// Write context for post-restart notification
|
||||
|
||||
Reference in New Issue
Block a user