{ "version": "6", "dialect": "sqlite", "id": "bf7ffa06-45b1-43d1-ba9a-193681f05bf2", "prevId": "5c9f981a-cccd-4832-806c-4b156078d34d", "tables": { "admin_credentials": { "name": "admin_credentials", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": false }, "password_hash": { "name": "password_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "updated_at": { "name": "updated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "ai_settings": { "name": "ai_settings", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": false }, "enabled": { "name": "enabled", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "base_url": { "name": "base_url", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "api_key": { "name": "api_key", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "model": { "name": "model", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "updated_at": { "name": "updated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "checks": { "name": "checks", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "monitor_id": { "name": "monitor_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "ok": { "name": "ok", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "status_code": { "name": "status_code", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "latency_ms": { "name": "latency_ms", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "error": { "name": "error", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "checked_at": { "name": "checked_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "maintenance": { "name": "maintenance", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false } }, "indexes": { "checks_monitor_id_checked_at_idx": { "name": "checks_monitor_id_checked_at_idx", "columns": [ "monitor_id", "checked_at" ], "isUnique": false } }, "foreignKeys": { "checks_monitor_id_monitors_id_fk": { "name": "checks_monitor_id_monitors_id_fk", "tableFrom": "checks", "tableTo": "monitors", "columnsFrom": [ "monitor_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "incidents": { "name": "incidents", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "monitor_id": { "name": "monitor_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "started_at": { "name": "started_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "resolved_at": { "name": "resolved_at", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "start_status_code": { "name": "start_status_code", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "start_error": { "name": "start_error", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "ai_message": { "name": "ai_message", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "duration_ms": { "name": "duration_ms", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "updated_at": { "name": "updated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "incidents_monitor_id_started_at_idx": { "name": "incidents_monitor_id_started_at_idx", "columns": [ "monitor_id", "started_at" ], "isUnique": false } }, "foreignKeys": { "incidents_monitor_id_monitors_id_fk": { "name": "incidents_monitor_id_monitors_id_fk", "tableFrom": "incidents", "tableTo": "monitors", "columnsFrom": [ "monitor_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "login_attempts": { "name": "login_attempts", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "ip_address": { "name": "ip_address", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "attempted_at": { "name": "attempted_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "login_attempts_ip_attempted_at_idx": { "name": "login_attempts_ip_attempted_at_idx", "columns": [ "ip_address", "attempted_at" ], "isUnique": false } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "maintenance_window_monitors": { "name": "maintenance_window_monitors", "columns": { "window_id": { "name": "window_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "monitor_id": { "name": "monitor_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "maintenance_window_monitors_monitor_id_idx": { "name": "maintenance_window_monitors_monitor_id_idx", "columns": [ "monitor_id" ], "isUnique": false } }, "foreignKeys": { "maintenance_window_monitors_window_id_maintenance_windows_id_fk": { "name": "maintenance_window_monitors_window_id_maintenance_windows_id_fk", "tableFrom": "maintenance_window_monitors", "tableTo": "maintenance_windows", "columnsFrom": [ "window_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "maintenance_window_monitors_monitor_id_monitors_id_fk": { "name": "maintenance_window_monitors_monitor_id_monitors_id_fk", "tableFrom": "maintenance_window_monitors", "tableTo": "monitors", "columnsFrom": [ "monitor_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "maintenance_window_monitors_window_id_monitor_id_pk": { "columns": [ "window_id", "monitor_id" ], "name": "maintenance_window_monitors_window_id_monitor_id_pk" } }, "uniqueConstraints": {}, "checkConstraints": {} }, "maintenance_windows": { "name": "maintenance_windows", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "start_minute": { "name": "start_minute", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "duration_minutes": { "name": "duration_minutes", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "timezone": { "name": "timezone", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'UTC'" }, "enabled": { "name": "enabled", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": true }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "updated_at": { "name": "updated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "maintenance_windows_enabled_idx": { "name": "maintenance_windows_enabled_idx", "columns": [ "enabled" ], "isUnique": false } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "monitor_daily_stats": { "name": "monitor_daily_stats", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "monitor_id": { "name": "monitor_id", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "day": { "name": "day", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "total_checks": { "name": "total_checks", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "up_checks": { "name": "up_checks", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "avg_latency_ms": { "name": "avg_latency_ms", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "min_latency_ms": { "name": "min_latency_ms", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "max_latency_ms": { "name": "max_latency_ms", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": { "monitor_daily_stats_monitor_id_day_uidx": { "name": "monitor_daily_stats_monitor_id_day_uidx", "columns": [ "monitor_id", "day" ], "isUnique": true } }, "foreignKeys": { "monitor_daily_stats_monitor_id_monitors_id_fk": { "name": "monitor_daily_stats_monitor_id_monitors_id_fk", "tableFrom": "monitor_daily_stats", "tableTo": "monitors", "columnsFrom": [ "monitor_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "monitors": { "name": "monitors", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "url": { "name": "url", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "method": { "name": "method", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'GET'" }, "expected_status": { "name": "expected_status", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 200 }, "interval_seconds": { "name": "interval_seconds", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 300 }, "timeout_ms": { "name": "timeout_ms", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 10000 }, "enabled": { "name": "enabled", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": true }, "alerts_enabled": { "name": "alerts_enabled", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": true }, "last_ok": { "name": "last_ok", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "last_status_code": { "name": "last_status_code", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "last_latency_ms": { "name": "last_latency_ms", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "last_error": { "name": "last_error", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "last_checked_at": { "name": "last_checked_at", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "updated_at": { "name": "updated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "monitors_enabled_last_checked_at_idx": { "name": "monitors_enabled_last_checked_at_idx", "columns": [ "enabled", "last_checked_at" ], "isUnique": false } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "notification_settings": { "name": "notification_settings", "columns": { "id": { "name": "id", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": false }, "webhook_url": { "name": "webhook_url", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "webhook_enabled": { "name": "webhook_enabled", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "updated_at": { "name": "updated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "sessions": { "name": "sessions", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "expires_at": { "name": "expires_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "user_agent": { "name": "user_agent", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": { "sessions_expires_at_idx": { "name": "sessions_expires_at_idx", "columns": [ "expires_at" ], "isUnique": false } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} } }, "views": {}, "enums": {}, "_meta": { "schemas": {}, "tables": {}, "columns": {} }, "internal": { "indexes": {} } }