forked from boos/BoosAPI
Add initial database schema and journal entries for token management
- Created a new snapshot JSON file (0003_snapshot.json) defining the schema for tables including account_tokens, accounts, checkin_logs, events, model_availability, proxy_logs, route_channels, settings, sites, token_model_availability, and token_routes. - Added columns, indexes, and foreign key constraints for each table to ensure data integrity and relationships. - Introduced a journal JSON file (_journal.json) to track schema versions and changes, including entries for version 6 with relevant tags and timestamps.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
CREATE TABLE IF NOT EXISTS `token_model_availability` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`token_id` integer NOT NULL,
|
||||
`model_name` text NOT NULL,
|
||||
`available` integer,
|
||||
`latency_ms` integer,
|
||||
`checked_at` text DEFAULT (datetime('now')),
|
||||
FOREIGN KEY (`token_id`) REFERENCES `account_tokens`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS `token_model_availability_token_model_unique`
|
||||
ON `token_model_availability` (`token_id`, `model_name`);
|
||||
Reference in New Issue
Block a user