zerobyte/app/drizzle/20251126184005_wild_echo/snapshot.json
Nico 35773a6969
refactor: upgrade to drizzle v1 (#450)
* refactor: move migrations to new structure

* refactor: convert all findMany to new structure

* fix(backups-schedule): missing null matching for last backup status

* chore: move root lib to server
2026-02-01 19:14:52 +01:00

905 lines
No EOL
21 KiB
JSON

{
"dialect": "sqlite",
"id": "05309ea5-8ef2-4d63-b3d2-9842b2b4111b",
"prevIds": [
"794bddf6-1978-46e4-88d5-051d76cfa2f6"
],
"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())",
"generated": null,
"name": "created_at",
"table": "app_metadata",
"entityType": "columns"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": "(unixepoch())",
"generated": null,
"name": "updated_at",
"table": "app_metadata",
"entityType": "columns"
},
{
"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())",
"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": "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())",
"generated": null,
"name": "created_at",
"table": "backup_schedules_table",
"entityType": "columns"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": "(unixepoch())",
"generated": null,
"name": "updated_at",
"table": "backup_schedules_table",
"entityType": "columns"
},
{
"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())",
"generated": null,
"name": "created_at",
"table": "notification_destinations_table",
"entityType": "columns"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": "(unixepoch())",
"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": false,
"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())",
"generated": null,
"name": "created_at",
"table": "repositories_table",
"entityType": "columns"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": "(unixepoch())",
"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())",
"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())",
"generated": null,
"name": "created_at",
"table": "users_table",
"entityType": "columns"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": "(unixepoch())",
"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": false,
"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())",
"generated": null,
"name": "last_health_check",
"table": "volumes_table",
"entityType": "columns"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": "(unixepoch())",
"generated": null,
"name": "created_at",
"table": "volumes_table",
"entityType": "columns"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": "(unixepoch())",
"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": []
}