feat(federation): add schema columns for upload size mismatch tracking
Adds federation_status and federation_meta to attachments table, and remote_max_upload_size to federation_peers, with idempotent migrations.
This commit is contained in:
@@ -616,6 +616,19 @@ export function runMigrations(db: Database.Database): void {
|
||||
|
||||
migrateGeneralizeOutbox(db);
|
||||
|
||||
// ─── Federation upload size mismatch columns ─────────────────────────────
|
||||
try {
|
||||
db.exec(`ALTER TABLE attachments ADD COLUMN federation_status TEXT`);
|
||||
} catch { /* column already exists */ }
|
||||
|
||||
try {
|
||||
db.exec(`ALTER TABLE attachments ADD COLUMN federation_meta TEXT`);
|
||||
} catch { /* column already exists */ }
|
||||
|
||||
try {
|
||||
db.exec(`ALTER TABLE federation_peers ADD COLUMN remote_max_upload_size INTEGER`);
|
||||
} catch { /* column already exists */ }
|
||||
|
||||
console.log('Migrations complete.');
|
||||
}
|
||||
|
||||
|
||||
@@ -94,6 +94,8 @@ export const attachments = sqliteTable('attachments', {
|
||||
height: integer('height'),
|
||||
duration: real('duration'),
|
||||
sourceUrl: text('source_url'),
|
||||
federationStatus: text('federation_status'),
|
||||
federationMeta: text('federation_meta'),
|
||||
createdAt: integer('created_at').notNull(),
|
||||
});
|
||||
|
||||
@@ -315,6 +317,7 @@ export const federationPeers = sqliteTable('federation_peers', {
|
||||
lastFailureAt: integer('last_failure_at'),
|
||||
consecutiveFailures: integer('consecutive_failures').default(0),
|
||||
lastSyncedAt: integer('last_synced_at').default(0),
|
||||
remoteMaxUploadSize: integer('remote_max_upload_size'),
|
||||
createdAt: integer('created_at').notNull(),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user