{
  "dialect": "sqlite",
  "id": "b5b3acff-51d7-45ae-b9d2-4b07a6286fc3",
  "prevIds": [
    "d5a60aea-4490-423e-8725-6ace87a76c9b"
  ],
  "version": "7",
  "ddl": [
    {
      "name": "app_metadata",
      "entityType": "tables"
    },
    {
      "type": "text",
      "notNull": false,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "key",
      "table": "app_metadata",
      "entityType": "columns"
    },
    {
      "columns": [
        "key"
      ],
      "nameExplicit": false,
      "name": "app_metadata_pk",
      "table": "app_metadata",
      "entityType": "pks"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "value",
      "table": "app_metadata",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "(unixepoch() * 1000)",
      "generated": null,
      "name": "created_at",
      "table": "app_metadata",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "(unixepoch() * 1000)",
      "generated": null,
      "name": "updated_at",
      "table": "app_metadata",
      "entityType": "columns"
    },
    {
      "name": "backup_schedule_mirrors_table",
      "entityType": "tables"
    },
    {
      "type": "integer",
      "notNull": false,
      "autoincrement": true,
      "default": null,
      "generated": null,
      "name": "id",
      "table": "backup_schedule_mirrors_table",
      "entityType": "columns"
    },
    {
      "columns": [
        "id"
      ],
      "nameExplicit": false,
      "name": "backup_schedule_mirrors_table_pk",
      "table": "backup_schedule_mirrors_table",
      "entityType": "pks"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "schedule_id",
      "table": "backup_schedule_mirrors_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "repository_id",
      "table": "backup_schedule_mirrors_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "true",
      "generated": null,
      "name": "enabled",
      "table": "backup_schedule_mirrors_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": false,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "last_copy_at",
      "table": "backup_schedule_mirrors_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": false,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "last_copy_status",
      "table": "backup_schedule_mirrors_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": false,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "last_copy_error",
      "table": "backup_schedule_mirrors_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "(unixepoch() * 1000)",
      "generated": null,
      "name": "created_at",
      "table": "backup_schedule_mirrors_table",
      "entityType": "columns"
    },
    {
      "columns": [
        {
          "value": "schedule_id",
          "isExpression": false
        },
        {
          "value": "repository_id",
          "isExpression": false
        }
      ],
      "isUnique": true,
      "where": null,
      "origin": "manual",
      "name": "backup_schedule_mirrors_table_schedule_id_repository_id_unique",
      "table": "backup_schedule_mirrors_table",
      "entityType": "indexes"
    },
    {
      "columns": [
        "schedule_id"
      ],
      "tableTo": "backup_schedules_table",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "CASCADE",
      "nameExplicit": false,
      "name": "backup_schedule_mirrors_table_schedule_id_backup_schedules_table_id_fk",
      "table": "backup_schedule_mirrors_table",
      "entityType": "fks"
    },
    {
      "columns": [
        "repository_id"
      ],
      "tableTo": "repositories_table",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "CASCADE",
      "nameExplicit": false,
      "name": "backup_schedule_mirrors_table_repository_id_repositories_table_id_fk",
      "table": "backup_schedule_mirrors_table",
      "entityType": "fks"
    },
    {
      "name": "backup_schedule_notifications_table",
      "entityType": "tables"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "schedule_id",
      "table": "backup_schedule_notifications_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "destination_id",
      "table": "backup_schedule_notifications_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "false",
      "generated": null,
      "name": "notify_on_start",
      "table": "backup_schedule_notifications_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "false",
      "generated": null,
      "name": "notify_on_success",
      "table": "backup_schedule_notifications_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "true",
      "generated": null,
      "name": "notify_on_failure",
      "table": "backup_schedule_notifications_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "(unixepoch() * 1000)",
      "generated": null,
      "name": "created_at",
      "table": "backup_schedule_notifications_table",
      "entityType": "columns"
    },
    {
      "columns": [
        "schedule_id",
        "destination_id"
      ],
      "nameExplicit": false,
      "name": "backup_schedule_notifications_table_schedule_id_destination_id_pk",
      "table": "backup_schedule_notifications_table",
      "entityType": "pks"
    },
    {
      "columns": [
        "schedule_id"
      ],
      "tableTo": "backup_schedules_table",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "CASCADE",
      "nameExplicit": false,
      "name": "backup_schedule_notifications_table_schedule_id_backup_schedules_table_id_fk",
      "table": "backup_schedule_notifications_table",
      "entityType": "fks"
    },
    {
      "columns": [
        "destination_id"
      ],
      "tableTo": "notification_destinations_table",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "CASCADE",
      "nameExplicit": false,
      "name": "backup_schedule_notifications_table_destination_id_notification_destinations_table_id_fk",
      "table": "backup_schedule_notifications_table",
      "entityType": "fks"
    },
    {
      "name": "backup_schedules_table",
      "entityType": "tables"
    },
    {
      "type": "integer",
      "notNull": false,
      "autoincrement": true,
      "default": null,
      "generated": null,
      "name": "id",
      "table": "backup_schedules_table",
      "entityType": "columns"
    },
    {
      "columns": [
        "id"
      ],
      "nameExplicit": false,
      "name": "backup_schedules_table_pk",
      "table": "backup_schedules_table",
      "entityType": "pks"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "name",
      "table": "backup_schedules_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "volume_id",
      "table": "backup_schedules_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "repository_id",
      "table": "backup_schedules_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "true",
      "generated": null,
      "name": "enabled",
      "table": "backup_schedules_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "cron_expression",
      "table": "backup_schedules_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": false,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "retention_policy",
      "table": "backup_schedules_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": false,
      "autoincrement": false,
      "default": "'[]'",
      "generated": null,
      "name": "exclude_patterns",
      "table": "backup_schedules_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": false,
      "autoincrement": false,
      "default": "'[]'",
      "generated": null,
      "name": "include_patterns",
      "table": "backup_schedules_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": false,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "last_backup_at",
      "table": "backup_schedules_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": false,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "last_backup_status",
      "table": "backup_schedules_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": false,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "last_backup_error",
      "table": "backup_schedules_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": false,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "next_backup_at",
      "table": "backup_schedules_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "(unixepoch() * 1000)",
      "generated": null,
      "name": "created_at",
      "table": "backup_schedules_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "(unixepoch() * 1000)",
      "generated": null,
      "name": "updated_at",
      "table": "backup_schedules_table",
      "entityType": "columns"
    },
    {
      "columns": [
        {
          "value": "name",
          "isExpression": false
        }
      ],
      "isUnique": true,
      "where": null,
      "origin": "manual",
      "name": "backup_schedules_table_name_unique",
      "table": "backup_schedules_table",
      "entityType": "indexes"
    },
    {
      "columns": [
        "volume_id"
      ],
      "tableTo": "volumes_table",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "CASCADE",
      "nameExplicit": false,
      "name": "backup_schedules_table_volume_id_volumes_table_id_fk",
      "table": "backup_schedules_table",
      "entityType": "fks"
    },
    {
      "columns": [
        "repository_id"
      ],
      "tableTo": "repositories_table",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "CASCADE",
      "nameExplicit": false,
      "name": "backup_schedules_table_repository_id_repositories_table_id_fk",
      "table": "backup_schedules_table",
      "entityType": "fks"
    },
    {
      "name": "notification_destinations_table",
      "entityType": "tables"
    },
    {
      "type": "integer",
      "notNull": false,
      "autoincrement": true,
      "default": null,
      "generated": null,
      "name": "id",
      "table": "notification_destinations_table",
      "entityType": "columns"
    },
    {
      "columns": [
        "id"
      ],
      "nameExplicit": false,
      "name": "notification_destinations_table_pk",
      "table": "notification_destinations_table",
      "entityType": "pks"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "name",
      "table": "notification_destinations_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "true",
      "generated": null,
      "name": "enabled",
      "table": "notification_destinations_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "type",
      "table": "notification_destinations_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "config",
      "table": "notification_destinations_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "(unixepoch() * 1000)",
      "generated": null,
      "name": "created_at",
      "table": "notification_destinations_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "(unixepoch() * 1000)",
      "generated": null,
      "name": "updated_at",
      "table": "notification_destinations_table",
      "entityType": "columns"
    },
    {
      "columns": [
        {
          "value": "name",
          "isExpression": false
        }
      ],
      "isUnique": true,
      "where": null,
      "origin": "manual",
      "name": "notification_destinations_table_name_unique",
      "table": "notification_destinations_table",
      "entityType": "indexes"
    },
    {
      "name": "repositories_table",
      "entityType": "tables"
    },
    {
      "type": "text",
      "notNull": false,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "id",
      "table": "repositories_table",
      "entityType": "columns"
    },
    {
      "columns": [
        "id"
      ],
      "nameExplicit": false,
      "name": "repositories_table_pk",
      "table": "repositories_table",
      "entityType": "pks"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "short_id",
      "table": "repositories_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "name",
      "table": "repositories_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "type",
      "table": "repositories_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "config",
      "table": "repositories_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": false,
      "autoincrement": false,
      "default": "'auto'",
      "generated": null,
      "name": "compression_mode",
      "table": "repositories_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": false,
      "autoincrement": false,
      "default": "'unknown'",
      "generated": null,
      "name": "status",
      "table": "repositories_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": false,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "last_checked",
      "table": "repositories_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": false,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "last_error",
      "table": "repositories_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "(unixepoch() * 1000)",
      "generated": null,
      "name": "created_at",
      "table": "repositories_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "(unixepoch() * 1000)",
      "generated": null,
      "name": "updated_at",
      "table": "repositories_table",
      "entityType": "columns"
    },
    {
      "columns": [
        {
          "value": "short_id",
          "isExpression": false
        }
      ],
      "isUnique": true,
      "where": null,
      "origin": "manual",
      "name": "repositories_table_short_id_unique",
      "table": "repositories_table",
      "entityType": "indexes"
    },
    {
      "columns": [
        {
          "value": "name",
          "isExpression": false
        }
      ],
      "isUnique": true,
      "where": null,
      "origin": "manual",
      "name": "repositories_table_name_unique",
      "table": "repositories_table",
      "entityType": "indexes"
    },
    {
      "name": "sessions_table",
      "entityType": "tables"
    },
    {
      "type": "text",
      "notNull": false,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "id",
      "table": "sessions_table",
      "entityType": "columns"
    },
    {
      "columns": [
        "id"
      ],
      "nameExplicit": false,
      "name": "sessions_table_pk",
      "table": "sessions_table",
      "entityType": "pks"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "user_id",
      "table": "sessions_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "expires_at",
      "table": "sessions_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "(unixepoch() * 1000)",
      "generated": null,
      "name": "created_at",
      "table": "sessions_table",
      "entityType": "columns"
    },
    {
      "columns": [
        "user_id"
      ],
      "tableTo": "users_table",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "CASCADE",
      "nameExplicit": false,
      "name": "sessions_table_user_id_users_table_id_fk",
      "table": "sessions_table",
      "entityType": "fks"
    },
    {
      "name": "users_table",
      "entityType": "tables"
    },
    {
      "type": "integer",
      "notNull": false,
      "autoincrement": true,
      "default": null,
      "generated": null,
      "name": "id",
      "table": "users_table",
      "entityType": "columns"
    },
    {
      "columns": [
        "id"
      ],
      "nameExplicit": false,
      "name": "users_table_pk",
      "table": "users_table",
      "entityType": "pks"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "username",
      "table": "users_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "password_hash",
      "table": "users_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "false",
      "generated": null,
      "name": "has_downloaded_restic_password",
      "table": "users_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "(unixepoch() * 1000)",
      "generated": null,
      "name": "created_at",
      "table": "users_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "(unixepoch() * 1000)",
      "generated": null,
      "name": "updated_at",
      "table": "users_table",
      "entityType": "columns"
    },
    {
      "columns": [
        {
          "value": "username",
          "isExpression": false
        }
      ],
      "isUnique": true,
      "where": null,
      "origin": "manual",
      "name": "users_table_username_unique",
      "table": "users_table",
      "entityType": "indexes"
    },
    {
      "name": "volumes_table",
      "entityType": "tables"
    },
    {
      "type": "integer",
      "notNull": false,
      "autoincrement": true,
      "default": null,
      "generated": null,
      "name": "id",
      "table": "volumes_table",
      "entityType": "columns"
    },
    {
      "columns": [
        "id"
      ],
      "nameExplicit": false,
      "name": "volumes_table_pk",
      "table": "volumes_table",
      "entityType": "pks"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "short_id",
      "table": "volumes_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "name",
      "table": "volumes_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "type",
      "table": "volumes_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": "'unmounted'",
      "generated": null,
      "name": "status",
      "table": "volumes_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": false,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "last_error",
      "table": "volumes_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "(unixepoch() * 1000)",
      "generated": null,
      "name": "last_health_check",
      "table": "volumes_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "(unixepoch() * 1000)",
      "generated": null,
      "name": "created_at",
      "table": "volumes_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "(unixepoch() * 1000)",
      "generated": null,
      "name": "updated_at",
      "table": "volumes_table",
      "entityType": "columns"
    },
    {
      "type": "text",
      "notNull": true,
      "autoincrement": false,
      "default": null,
      "generated": null,
      "name": "config",
      "table": "volumes_table",
      "entityType": "columns"
    },
    {
      "type": "integer",
      "notNull": true,
      "autoincrement": false,
      "default": "true",
      "generated": null,
      "name": "auto_remount",
      "table": "volumes_table",
      "entityType": "columns"
    },
    {
      "columns": [
        {
          "value": "short_id",
          "isExpression": false
        }
      ],
      "isUnique": true,
      "where": null,
      "origin": "manual",
      "name": "volumes_table_short_id_unique",
      "table": "volumes_table",
      "entityType": "indexes"
    },
    {
      "columns": [
        {
          "value": "name",
          "isExpression": false
        }
      ],
      "isUnique": true,
      "where": null,
      "origin": "manual",
      "name": "volumes_table_name_unique",
      "table": "volumes_table",
      "entityType": "indexes"
    }
  ],
  "renames": []
}