{
  "id": "c55b640c-f0aa-486b-b052-d95104ec899d",
  "prevId": "d8b57dfe-223d-4124-8c4a-d1f05c6d62c1",
  "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.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_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
        },
        "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": {},
      "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": {},
      "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": "text",
          "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
        },
        "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
    }
  },
  "enums": {
    "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"
      ]
    }
  },
  "schemas": {},
  "sequences": {},
  "roles": {},
  "policies": {},
  "views": {},
  "_meta": {
    "columns": {},
    "schemas": {},
    "tables": {}
  }
}