CREATE TABLE `alert_rules` ( `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `name` text NOT NULL, `enabled` integer DEFAULT true NOT NULL, `metric` text NOT NULL, `mount` text, `operator` text DEFAULT 'above' NOT NULL, `threshold` real NOT NULL, `for_minutes` integer DEFAULT 0 NOT NULL, `severity` text DEFAULT 'warning' NOT NULL, `server_id` integer, `tag` text, `created_by` text, `created_at` text NOT NULL ); --> statement-breakpoint CREATE TABLE `alert_snoozes` ( `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `alert_id` text NOT NULL, `condition_key` text NOT NULL, `message` text NOT NULL, `until` text NOT NULL, `snoozed_by` text NOT NULL, `snoozed_at` text NOT NULL, `last_seen_at` text NOT NULL ); --> statement-breakpoint CREATE UNIQUE INDEX `alert_snoozes_alert_idx` ON `alert_snoozes` (`alert_id`);--> statement-breakpoint CREATE TABLE `storage_samples` ( `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `series_id` integer NOT NULL, `at` text NOT NULL, `value` real NOT NULL, FOREIGN KEY (`series_id`) REFERENCES `storage_series`(`id`) ON UPDATE no action ON DELETE cascade ); --> statement-breakpoint CREATE INDEX `storage_samples_series_idx` ON `storage_samples` (`series_id`,`at`);--> statement-breakpoint CREATE TABLE `storage_series` ( `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `integration_id` integer NOT NULL, `key` text NOT NULL, `label` text NOT NULL, `latest_percent` real NOT NULL, `used_bytes` integer, `total_bytes` integer, `updated_at` text NOT NULL, FOREIGN KEY (`integration_id`) REFERENCES `integrations`(`id`) ON UPDATE no action ON DELETE cascade ); --> statement-breakpoint CREATE UNIQUE INDEX `storage_series_key_idx` ON `storage_series` (`integration_id`,`key`);