feat(isac): add moderated contributor mode
This commit is contained in:
@@ -81,6 +81,18 @@ for (const [name, definition] of [
|
||||
}
|
||||
}
|
||||
|
||||
const proposalColumns = await (await database.prepare("PRAGMA table_info('data_change_proposals')")).all();
|
||||
for (const [name, definition] of [
|
||||
['draft_entity_id', 'TEXT'],
|
||||
['applied_entity_id', 'TEXT']
|
||||
]) {
|
||||
if (!proposalColumns.some((column) => column.name === name)) {
|
||||
await database.exec(`ALTER TABLE data_change_proposals ADD COLUMN ${name} ${definition}`);
|
||||
}
|
||||
}
|
||||
await database.exec("UPDATE data_change_proposals SET draft_entity_id=id WHERE draft_entity_id IS NULL AND entity_id IS NULL");
|
||||
await database.exec('CREATE UNIQUE INDEX IF NOT EXISTS data_change_proposals_draft_entity_idx ON data_change_proposals(draft_entity_id) WHERE draft_entity_id IS NOT NULL');
|
||||
|
||||
console.log(`Applied ${statements.length} schema statements to ${databasePath}`);
|
||||
|
||||
if (!databaseAlreadyExisted) {
|
||||
|
||||
Reference in New Issue
Block a user