forked from boos/BoosAPI
76c85d0a13
* feat: add site api endpoint schema scaffolding * feat: wire site api endpoints into backup migration * feat: add site api endpoint selection service * feat: add site api endpoint contracts * feat: route discovery through site api endpoints * feat: route proxy traffic through site api endpoints * feat: add site api endpoint pool editor * fix: keep proxy video tasks on site endpoint pool * fix: restore core test compatibility for site endpoint pool * fix: address endpoint pool review findings
18 lines
883 B
SQL
18 lines
883 B
SQL
CREATE TABLE `site_api_endpoints` (
|
|
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
`site_id` integer NOT NULL,
|
|
`url` text NOT NULL,
|
|
`enabled` integer DEFAULT true,
|
|
`sort_order` integer DEFAULT 0,
|
|
`cooldown_until` text,
|
|
`last_selected_at` text,
|
|
`last_failed_at` text,
|
|
`last_failure_reason` text,
|
|
`created_at` text DEFAULT (datetime('now')),
|
|
`updated_at` text DEFAULT (datetime('now')),
|
|
FOREIGN KEY (`site_id`) REFERENCES `sites`(`id`) ON UPDATE no action ON DELETE cascade
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE UNIQUE INDEX `site_api_endpoints_site_url_unique` ON `site_api_endpoints` (`site_id`,`url`);--> statement-breakpoint
|
|
CREATE INDEX `site_api_endpoints_site_enabled_sort_idx` ON `site_api_endpoints` (`site_id`,`enabled`,`sort_order`);--> statement-breakpoint
|
|
CREATE INDEX `site_api_endpoints_site_cooldown_idx` ON `site_api_endpoints` (`site_id`,`cooldown_until`); |