Index beta evidence and foreign key child lookups
This commit is contained in:
@@ -89,6 +89,8 @@ export function ensureHostSchema(handle: Database.Database): void {
|
||||
CHECK(stage IN ('queued','running','cleaned','failed','completed')),
|
||||
requested_at TEXT NOT NULL, updated_at TEXT NOT NULL, cleaned_at TEXT, error TEXT
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_ec_host_credentials_host ON ec_host_credentials(host_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_ec_host_enrollments_host ON ec_host_enrollments(host_id);
|
||||
`);
|
||||
const columns = handle.prepare('PRAGMA table_info(ec_host_operations)').all() as { name: string }[];
|
||||
if (!columns.some(column => column.name === 'history_expired_at')) handle.exec('ALTER TABLE ec_host_operations ADD COLUMN history_expired_at TEXT');
|
||||
|
||||
Reference in New Issue
Block a user