Add persisted and shareable builds
This commit is contained in:
@@ -255,6 +255,16 @@ for (const [name, definition] of [
|
||||
}
|
||||
}
|
||||
|
||||
const buildColumns = await (await database.prepare("PRAGMA table_info('builds')")).all();
|
||||
if (buildColumns.length && !buildColumns.some((column) => column.name === 'loadout_json')) {
|
||||
console.log('Adding persistent builder loadout snapshots.');
|
||||
await database.exec('ALTER TABLE builds ADD COLUMN loadout_json TEXT');
|
||||
}
|
||||
if (buildColumns.length) {
|
||||
await database.exec("UPDATE builds SET visibility='private' WHERE visibility='draft'");
|
||||
}
|
||||
await database.exec('CREATE INDEX IF NOT EXISTS builds_visibility_updated_idx ON builds(visibility,updated_at DESC)');
|
||||
|
||||
console.log(`Applied ${statements.length} schema statements to ${databasePath}`);
|
||||
|
||||
if (!databaseAlreadyExisted) {
|
||||
|
||||
Reference in New Issue
Block a user