{
  "id": "864a4a13-52fb-4ae7-a2a4-271b4ab68f02",
  "prevId": "3fcc4759-bbd3-40fa-bb0b-e4b73f38b188",
  "version": "7",
  "dialect": "postgresql",
  "tables": {
    "public.user_identities": {
      "name": "user_identities",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "user_id": {
          "name": "user_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "provider": {
          "name": "provider",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "external_id": {
          "name": "external_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "user_identities_user_id_users_id_fk": {
          "name": "user_identities_user_id_users_id_fk",
          "tableFrom": "user_identities",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.users": {
      "name": "users",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "display_name": {
          "name": "display_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "is_admin": {
          "name": "is_admin",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "watching_now_tv_slots": {
          "name": "watching_now_tv_slots",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 5
        },
        "watching_now_movie_slots": {
          "name": "watching_now_movie_slots",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 10
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "users_email_unique": {
          "name": "users_email_unique",
          "nullsNotDistinct": false,
          "columns": [
            "email"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.agent_heartbeats": {
      "name": "agent_heartbeats",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "agent": {
          "name": "agent",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "hostname": {
          "name": "hostname",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "version": {
          "name": "version",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "first_seen_at": {
          "name": "first_seen_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "last_seen_at": {
          "name": "last_seen_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "details": {
          "name": "details",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "agent_heartbeats_agent_unique": {
          "name": "agent_heartbeats_agent_unique",
          "nullsNotDistinct": false,
          "columns": [
            "agent"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.corrupt_files": {
      "name": "corrupt_files",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "full_path": {
          "name": "full_path",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "agent": {
          "name": "agent",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "tier": {
          "name": "tier",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "reason": {
          "name": "reason",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "size_bytes": {
          "name": "size_bytes",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "corrupt_file_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'pending'"
        },
        "first_detected_at": {
          "name": "first_detected_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "last_detected_at": {
          "name": "last_detected_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "reviewed_by": {
          "name": "reviewed_by",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "reviewed_at": {
          "name": "reviewed_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "deleted_at": {
          "name": "deleted_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "delete_error": {
          "name": "delete_error",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "corrupt_files_reviewed_by_users_id_fk": {
          "name": "corrupt_files_reviewed_by_users_id_fk",
          "tableFrom": "corrupt_files",
          "tableTo": "users",
          "columnsFrom": [
            "reviewed_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "corrupt_files_full_path_unique": {
          "name": "corrupt_files_full_path_unique",
          "nullsNotDistinct": false,
          "columns": [
            "full_path"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.storage_availability": {
      "name": "storage_availability",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "tier_id": {
          "name": "tier_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "online": {
          "name": "online",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true
        },
        "detected_at": {
          "name": "detected_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "resolved_at": {
          "name": "resolved_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "storage_availability_tier_id_storage_tiers_id_fk": {
          "name": "storage_availability_tier_id_storage_tiers_id_fk",
          "tableFrom": "storage_availability",
          "tableTo": "storage_tiers",
          "columnsFrom": [
            "tier_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.storage_files": {
      "name": "storage_files",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "tier_id": {
          "name": "tier_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "media_item_id": {
          "name": "media_item_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "episode_id": {
          "name": "episode_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "relative_path": {
          "name": "relative_path",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "full_path": {
          "name": "full_path",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "filename": {
          "name": "filename",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "extension": {
          "name": "extension",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "size_bytes": {
          "name": "size_bytes",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "modified_at": {
          "name": "modified_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "observed_at": {
          "name": "observed_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "missing_at": {
          "name": "missing_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "inferred_title": {
          "name": "inferred_title",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "inferred_year": {
          "name": "inferred_year",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "quality": {
          "name": "quality",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "codec": {
          "name": "codec",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "edition": {
          "name": "edition",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "width": {
          "name": "width",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "height": {
          "name": "height",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "video_codec": {
          "name": "video_codec",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "audio_codec": {
          "name": "audio_codec",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "audio_channels": {
          "name": "audio_channels",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "duration_seconds": {
          "name": "duration_seconds",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "bitrate": {
          "name": "bitrate",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        },
        "probed_at": {
          "name": "probed_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "probe_error": {
          "name": "probe_error",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "storage_files_tier_relative_path_idx": {
          "name": "storage_files_tier_relative_path_idx",
          "columns": [
            {
              "expression": "tier_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "relative_path",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "storage_files_tier_id_storage_tiers_id_fk": {
          "name": "storage_files_tier_id_storage_tiers_id_fk",
          "tableFrom": "storage_files",
          "tableTo": "storage_tiers",
          "columnsFrom": [
            "tier_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "storage_files_media_item_id_media_items_id_fk": {
          "name": "storage_files_media_item_id_media_items_id_fk",
          "tableFrom": "storage_files",
          "tableTo": "media_items",
          "columnsFrom": [
            "media_item_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "storage_files_episode_id_episodes_id_fk": {
          "name": "storage_files_episode_id_episodes_id_fk",
          "tableFrom": "storage_files",
          "tableTo": "episodes",
          "columnsFrom": [
            "episode_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.storage_tiers": {
      "name": "storage_tiers",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "tier": {
          "name": "tier",
          "type": "storage_tier",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true
        },
        "label": {
          "name": "label",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "base_path": {
          "name": "base_path",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "always_online": {
          "name": "always_online",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "agent_name": {
          "name": "agent_name",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "notes": {
          "name": "notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "storage_tiers_tier_unique": {
          "name": "storage_tiers_tier_unique",
          "nullsNotDistinct": false,
          "columns": [
            "tier"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.episodes": {
      "name": "episodes",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "season_id": {
          "name": "season_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "episode_number": {
          "name": "episode_number",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "overview": {
          "name": "overview",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "air_date": {
          "name": "air_date",
          "type": "date",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "episodes_season_id_episode_number_idx": {
          "name": "episodes_season_id_episode_number_idx",
          "columns": [
            {
              "expression": "season_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "episode_number",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "episodes_season_id_seasons_id_fk": {
          "name": "episodes_season_id_seasons_id_fk",
          "tableFrom": "episodes",
          "tableTo": "seasons",
          "columnsFrom": [
            "season_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.external_ids": {
      "name": "external_ids",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "media_item_id": {
          "name": "media_item_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "source": {
          "name": "source",
          "type": "external_id_source",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true
        },
        "external_id": {
          "name": "external_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "external_ids_source_external_id_idx": {
          "name": "external_ids_source_external_id_idx",
          "columns": [
            {
              "expression": "source",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "external_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "external_ids_media_item_id_media_items_id_fk": {
          "name": "external_ids_media_item_id_media_items_id_fk",
          "tableFrom": "external_ids",
          "tableTo": "media_items",
          "columnsFrom": [
            "media_item_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.media_items": {
      "name": "media_items",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "media_type": {
          "name": "media_type",
          "type": "media_type",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "sort_title": {
          "name": "sort_title",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "overview": {
          "name": "overview",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "year": {
          "name": "year",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "poster_path": {
          "name": "poster_path",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.movies": {
      "name": "movies",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true
        },
        "release_date": {
          "name": "release_date",
          "type": "date",
          "primaryKey": false,
          "notNull": false
        },
        "runtime_minutes": {
          "name": "runtime_minutes",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "metadata_refreshed_at": {
          "name": "metadata_refreshed_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "movies_id_media_items_id_fk": {
          "name": "movies_id_media_items_id_fk",
          "tableFrom": "movies",
          "tableTo": "media_items",
          "columnsFrom": [
            "id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.seasons": {
      "name": "seasons",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "series_id": {
          "name": "series_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "season_number": {
          "name": "season_number",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "episode_count": {
          "name": "episode_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "air_date": {
          "name": "air_date",
          "type": "date",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "season_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'upcoming'"
        }
      },
      "indexes": {
        "seasons_series_id_season_number_idx": {
          "name": "seasons_series_id_season_number_idx",
          "columns": [
            {
              "expression": "series_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "season_number",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "seasons_series_id_series_id_fk": {
          "name": "seasons_series_id_series_id_fk",
          "tableFrom": "seasons",
          "tableTo": "series",
          "columnsFrom": [
            "series_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.series": {
      "name": "series",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true
        },
        "status": {
          "name": "status",
          "type": "series_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'upcoming'"
        },
        "network": {
          "name": "network",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "first_air_date": {
          "name": "first_air_date",
          "type": "date",
          "primaryKey": false,
          "notNull": false
        },
        "last_air_date": {
          "name": "last_air_date",
          "type": "date",
          "primaryKey": false,
          "notNull": false
        },
        "is_currently_relevant": {
          "name": "is_currently_relevant",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false
        },
        "metadata_refreshed_at": {
          "name": "metadata_refreshed_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "series_id_media_items_id_fk": {
          "name": "series_id_media_items_id_fk",
          "tableFrom": "series",
          "tableTo": "media_items",
          "columnsFrom": [
            "id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.classics": {
      "name": "classics",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "media_item_id": {
          "name": "media_item_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "note": {
          "name": "note",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "added_by": {
          "name": "added_by",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "added_at": {
          "name": "added_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "classics_media_item_id_media_items_id_fk": {
          "name": "classics_media_item_id_media_items_id_fk",
          "tableFrom": "classics",
          "tableTo": "media_items",
          "columnsFrom": [
            "media_item_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "classics_added_by_users_id_fk": {
          "name": "classics_added_by_users_id_fk",
          "tableFrom": "classics",
          "tableTo": "users",
          "columnsFrom": [
            "added_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "classics_media_item_id_unique": {
          "name": "classics_media_item_id_unique",
          "nullsNotDistinct": false,
          "columns": [
            "media_item_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.watching_now_items": {
      "name": "watching_now_items",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "user_id": {
          "name": "user_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "media_item_id": {
          "name": "media_item_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "scope": {
          "name": "scope",
          "type": "watching_now_scope",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'show'"
        },
        "season_number": {
          "name": "season_number",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "slot_number": {
          "name": "slot_number",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "added_at": {
          "name": "added_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "removed_at": {
          "name": "removed_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "watching_now_items_user_id_users_id_fk": {
          "name": "watching_now_items_user_id_users_id_fk",
          "tableFrom": "watching_now_items",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "watching_now_items_media_item_id_media_items_id_fk": {
          "name": "watching_now_items_media_item_id_media_items_id_fk",
          "tableFrom": "watching_now_items",
          "tableTo": "media_items",
          "columnsFrom": [
            "media_item_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.watchlist_items": {
      "name": "watchlist_items",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "user_id": {
          "name": "user_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "media_item_id": {
          "name": "media_item_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "source": {
          "name": "source",
          "type": "watchlist_source",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'plex'"
        },
        "added_at": {
          "name": "added_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "removed_at": {
          "name": "removed_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "watchlist_items_user_id_users_id_fk": {
          "name": "watchlist_items_user_id_users_id_fk",
          "tableFrom": "watchlist_items",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "watchlist_items_media_item_id_media_items_id_fk": {
          "name": "watchlist_items_media_item_id_media_items_id_fk",
          "tableFrom": "watchlist_items",
          "tableTo": "media_items",
          "columnsFrom": [
            "media_item_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.admin_overrides": {
      "name": "admin_overrides",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "media_item_id": {
          "name": "media_item_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "season_number": {
          "name": "season_number",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "episode_number": {
          "name": "episode_number",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "override_type": {
          "name": "override_type",
          "type": "override_type",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true
        },
        "value": {
          "name": "value",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "reason": {
          "name": "reason",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "created_by": {
          "name": "created_by",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "admin_overrides_media_item_id_media_items_id_fk": {
          "name": "admin_overrides_media_item_id_media_items_id_fk",
          "tableFrom": "admin_overrides",
          "tableTo": "media_items",
          "columnsFrom": [
            "media_item_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "admin_overrides_created_by_users_id_fk": {
          "name": "admin_overrides_created_by_users_id_fk",
          "tableFrom": "admin_overrides",
          "tableTo": "users",
          "columnsFrom": [
            "created_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.desired_states": {
      "name": "desired_states",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "policy_run_id": {
          "name": "policy_run_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "media_item_id": {
          "name": "media_item_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "season_number": {
          "name": "season_number",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "episode_number": {
          "name": "episode_number",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "wanted": {
          "name": "wanted",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "storage_tier": {
          "name": "storage_tier",
          "type": "storage_tier",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false
        },
        "min_quality": {
          "name": "min_quality",
          "type": "quality",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false
        },
        "preferred_quality": {
          "name": "preferred_quality",
          "type": "quality",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false
        },
        "monitored": {
          "name": "monitored",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "reason_codes": {
          "name": "reason_codes",
          "type": "text[]",
          "primaryKey": false,
          "notNull": true,
          "default": "'{}'"
        },
        "computed_at": {
          "name": "computed_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "desired_states_policy_run_id_policy_runs_id_fk": {
          "name": "desired_states_policy_run_id_policy_runs_id_fk",
          "tableFrom": "desired_states",
          "tableTo": "policy_runs",
          "columnsFrom": [
            "policy_run_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "desired_states_media_item_id_media_items_id_fk": {
          "name": "desired_states_media_item_id_media_items_id_fk",
          "tableFrom": "desired_states",
          "tableTo": "media_items",
          "columnsFrom": [
            "media_item_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.policy_runs": {
      "name": "policy_runs",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "trigger": {
          "name": "trigger",
          "type": "policy_trigger",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true
        },
        "started_at": {
          "name": "started_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "completed_at": {
          "name": "completed_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "items_evaluated": {
          "name": "items_evaluated",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "items_changed": {
          "name": "items_changed",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.maintenance_jobs": {
      "name": "maintenance_jobs",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "job": {
          "name": "job",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "trigger": {
          "name": "trigger",
          "type": "maintenance_trigger",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'scheduled'"
        },
        "status": {
          "name": "status",
          "type": "maintenance_job_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'running'"
        },
        "started_at": {
          "name": "started_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "completed_at": {
          "name": "completed_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "duration_ms": {
          "name": "duration_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "exit_code": {
          "name": "exit_code",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "detail": {
          "name": "detail",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "output": {
          "name": "output",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "summary": {
          "name": "summary",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "maintenance_jobs_job_started_idx": {
          "name": "maintenance_jobs_job_started_idx",
          "columns": [
            {
              "expression": "job",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "started_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.grab_files": {
      "name": "grab_files",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "grab_id": {
          "name": "grab_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "storage_file_id": {
          "name": "storage_file_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "imported_path": {
          "name": "imported_path",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "season_number": {
          "name": "season_number",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "episode_number": {
          "name": "episode_number",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "grab_files_grab_path_idx": {
          "name": "grab_files_grab_path_idx",
          "columns": [
            {
              "expression": "grab_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "imported_path",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "grab_files_storage_file_idx": {
          "name": "grab_files_storage_file_idx",
          "columns": [
            {
              "expression": "storage_file_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "grab_files_grab_id_grabs_id_fk": {
          "name": "grab_files_grab_id_grabs_id_fk",
          "tableFrom": "grab_files",
          "tableTo": "grabs",
          "columnsFrom": [
            "grab_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "grab_files_storage_file_id_storage_files_id_fk": {
          "name": "grab_files_storage_file_id_storage_files_id_fk",
          "tableFrom": "grab_files",
          "tableTo": "storage_files",
          "columnsFrom": [
            "storage_file_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.grabs": {
      "name": "grabs",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "media_item_id": {
          "name": "media_item_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "season_number": {
          "name": "season_number",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "episode_number": {
          "name": "episode_number",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "info_hash": {
          "name": "info_hash",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "release_title": {
          "name": "release_title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "size_bytes": {
          "name": "size_bytes",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        },
        "magnet_url": {
          "name": "magnet_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "download_url": {
          "name": "download_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "indexer_name": {
          "name": "indexer_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "origin": {
          "name": "origin",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "seeders": {
          "name": "seeders",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "quality": {
          "name": "quality",
          "type": "quality",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false
        },
        "score": {
          "name": "score",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "score_reasons": {
          "name": "score_reasons",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "source": {
          "name": "source",
          "type": "grab_source",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true
        },
        "requested_by": {
          "name": "requested_by",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "grab_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'queued'"
        },
        "status_detail": {
          "name": "status_detail",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "progress": {
          "name": "progress",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "progress_changed_at": {
          "name": "progress_changed_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "content_path": {
          "name": "content_path",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "imported_path": {
          "name": "imported_path",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "imported_at": {
          "name": "imported_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "seed_path": {
          "name": "seed_path",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "seed_released_at": {
          "name": "seed_released_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "seed_release_reason": {
          "name": "seed_release_reason",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "grabs_info_hash_idx": {
          "name": "grabs_info_hash_idx",
          "columns": [
            {
              "expression": "info_hash",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "grabs_status_idx": {
          "name": "grabs_status_idx",
          "columns": [
            {
              "expression": "status",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "grabs_media_item_idx": {
          "name": "grabs_media_item_idx",
          "columns": [
            {
              "expression": "media_item_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "season_number",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "episode_number",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "grabs_media_item_id_media_items_id_fk": {
          "name": "grabs_media_item_id_media_items_id_fk",
          "tableFrom": "grabs",
          "tableTo": "media_items",
          "columnsFrom": [
            "media_item_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "grabs_requested_by_users_id_fk": {
          "name": "grabs_requested_by_users_id_fk",
          "tableFrom": "grabs",
          "tableTo": "users",
          "columnsFrom": [
            "requested_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.release_blocklist": {
      "name": "release_blocklist",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "info_hash": {
          "name": "info_hash",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "release_group": {
          "name": "release_group",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "release_title": {
          "name": "release_title",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "media_item_id": {
          "name": "media_item_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "reason": {
          "name": "reason",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "permanent": {
          "name": "permanent",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "created_by": {
          "name": "created_by",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "release_blocklist_info_hash_idx": {
          "name": "release_blocklist_info_hash_idx",
          "columns": [
            {
              "expression": "info_hash",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "release_blocklist_media_item_id_media_items_id_fk": {
          "name": "release_blocklist_media_item_id_media_items_id_fk",
          "tableFrom": "release_blocklist",
          "tableTo": "media_items",
          "columnsFrom": [
            "media_item_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "release_blocklist_created_by_users_id_fk": {
          "name": "release_blocklist_created_by_users_id_fk",
          "tableFrom": "release_blocklist",
          "tableTo": "users",
          "columnsFrom": [
            "created_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.search_runs": {
      "name": "search_runs",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "media_item_id": {
          "name": "media_item_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "season_number": {
          "name": "season_number",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "episode_number": {
          "name": "episode_number",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "source": {
          "name": "source",
          "type": "grab_source",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true
        },
        "query": {
          "name": "query",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "indexers_queried": {
          "name": "indexers_queried",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "results_found": {
          "name": "results_found",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "results_accepted": {
          "name": "results_accepted",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "skipped": {
          "name": "skipped",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "errors": {
          "name": "errors",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "grab_id": {
          "name": "grab_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "decision": {
          "name": "decision",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "started_at": {
          "name": "started_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "duration_ms": {
          "name": "duration_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "search_runs_media_item_idx": {
          "name": "search_runs_media_item_idx",
          "columns": [
            {
              "expression": "media_item_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "started_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "search_runs_media_item_id_media_items_id_fk": {
          "name": "search_runs_media_item_id_media_items_id_fk",
          "tableFrom": "search_runs",
          "tableTo": "media_items",
          "columnsFrom": [
            "media_item_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "search_runs_grab_id_grabs_id_fk": {
          "name": "search_runs_grab_id_grabs_id_fk",
          "tableFrom": "search_runs",
          "tableTo": "grabs",
          "columnsFrom": [
            "grab_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    }
  },
  "enums": {
    "public.corrupt_file_status": {
      "name": "corrupt_file_status",
      "schema": "public",
      "values": [
        "pending",
        "approved",
        "deleted",
        "dismissed",
        "failed"
      ]
    },
    "public.storage_tier": {
      "name": "storage_tier",
      "schema": "public",
      "values": [
        "live",
        "backup",
        "archive"
      ]
    },
    "public.external_id_source": {
      "name": "external_id_source",
      "schema": "public",
      "values": [
        "tvdb",
        "tmdb",
        "imdb",
        "plex"
      ]
    },
    "public.media_type": {
      "name": "media_type",
      "schema": "public",
      "values": [
        "tv_series",
        "movie"
      ]
    },
    "public.season_status": {
      "name": "season_status",
      "schema": "public",
      "values": [
        "upcoming",
        "airing",
        "complete"
      ]
    },
    "public.series_status": {
      "name": "series_status",
      "schema": "public",
      "values": [
        "upcoming",
        "continuing",
        "ended"
      ]
    },
    "public.watching_now_scope": {
      "name": "watching_now_scope",
      "schema": "public",
      "values": [
        "show",
        "season"
      ]
    },
    "public.watchlist_source": {
      "name": "watchlist_source",
      "schema": "public",
      "values": [
        "plex",
        "manual"
      ]
    },
    "public.override_type": {
      "name": "override_type",
      "schema": "public",
      "values": [
        "force_live",
        "force_archive",
        "force_quality",
        "force_monitor",
        "force_ignore",
        "temporary_promotion"
      ]
    },
    "public.policy_trigger": {
      "name": "policy_trigger",
      "schema": "public",
      "values": [
        "scheduled",
        "manual",
        "demand_change",
        "metadata_refresh"
      ]
    },
    "public.quality": {
      "name": "quality",
      "schema": "public",
      "values": [
        "sd",
        "720p",
        "1080p",
        "4k"
      ]
    },
    "public.maintenance_job_status": {
      "name": "maintenance_job_status",
      "schema": "public",
      "values": [
        "running",
        "succeeded",
        "failed",
        "skipped"
      ]
    },
    "public.maintenance_trigger": {
      "name": "maintenance_trigger",
      "schema": "public",
      "values": [
        "scheduled",
        "manual"
      ]
    },
    "public.grab_source": {
      "name": "grab_source",
      "schema": "public",
      "values": [
        "auto",
        "manual"
      ]
    },
    "public.grab_status": {
      "name": "grab_status",
      "schema": "public",
      "values": [
        "queued",
        "downloading",
        "completed",
        "importing",
        "imported",
        "failed",
        "orphaned"
      ]
    }
  },
  "schemas": {},
  "sequences": {},
  "roles": {},
  "policies": {},
  "views": {},
  "_meta": {
    "columns": {},
    "schemas": {},
    "tables": {}
  }
}