Skip to content

Your favorite shift management application!

52.0 KB
Raw Blame
{
  "version": "6",
  "dialect": "sqlite",
  "id": "050fdae0-67a8-4a33-87a4-874c6ef5a42d",
  "prevId": "46c43bf1-957b-48a6-80b6-8bb2d5c9ac6c",
  "tables": {
    "account": {
      "name": "account",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "account_id": {
          "name": "account_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "provider_id": {
          "name": "provider_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "access_token": {
          "name": "access_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "refresh_token": {
          "name": "refresh_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "id_token": {
          "name": "id_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "access_token_expires_at": {
          "name": "access_token_expires_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "refresh_token_expires_at": {
          "name": "refresh_token_expires_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "scope": {
          "name": "scope",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "password": {
          "name": "password",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {
        "account_userId_idx": {
          "name": "account_userId_idx",
          "columns": [
            "user_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "account_user_id_user_id_fk": {
          "name": "account_user_id_user_id_fk",
          "tableFrom": "account",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "audit_logs": {
      "name": "audit_logs",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "action": {
          "name": "action",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "resource_type": {
          "name": "resource_type",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "resource_id": {
          "name": "resource_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "metadata": {
          "name": "metadata",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "ip_address": {
          "name": "ip_address",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "user_agent": {
          "name": "user_agent",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "severity": {
          "name": "severity",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'info'"
        },
        "is_user_visible": {
          "name": "is_user_visible",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "timestamp": {
          "name": "timestamp",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {
        "audit_logs_userId_timestamp_idx": {
          "name": "audit_logs_userId_timestamp_idx",
          "columns": [
            "user_id",
            "timestamp"
          ],
          "isUnique": false
        },
        "audit_logs_action_timestamp_idx": {
          "name": "audit_logs_action_timestamp_idx",
          "columns": [
            "action",
            "timestamp"
          ],
          "isUnique": false
        },
        "audit_logs_userVisible_userId_timestamp_idx": {
          "name": "audit_logs_userVisible_userId_timestamp_idx",
          "columns": [
            "is_user_visible",
            "user_id",
            "timestamp"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "audit_logs_user_id_user_id_fk": {
          "name": "audit_logs_user_id_user_id_fk",
          "tableFrom": "audit_logs",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "calendar_access_tokens": {
      "name": "calendar_access_tokens",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "calendar_id": {
          "name": "calendar_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "token": {
          "name": "token",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "bundle_id": {
          "name": "bundle_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "permission": {
          "name": "permission",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'read'"
        },
        "expires_at": {
          "name": "expires_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_by": {
          "name": "created_by",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        },
        "last_used_at": {
          "name": "last_used_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "usage_count": {
          "name": "usage_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "is_active": {
          "name": "is_active",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": true
        }
      },
      "indexes": {
        "calendar_access_tokens_token_unique": {
          "name": "calendar_access_tokens_token_unique",
          "columns": [
            "token"
          ],
          "isUnique": true
        },
        "calendar_access_tokens_token_idx": {
          "name": "calendar_access_tokens_token_idx",
          "columns": [
            "token"
          ],
          "isUnique": false
        },
        "calendar_access_tokens_calendarId_isActive_idx": {
          "name": "calendar_access_tokens_calendarId_isActive_idx",
          "columns": [
            "calendar_id",
            "is_active"
          ],
          "isUnique": false
        },
        "calendar_access_tokens_createdBy_idx": {
          "name": "calendar_access_tokens_createdBy_idx",
          "columns": [
            "created_by"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "calendar_access_tokens_calendar_id_calendars_id_fk": {
          "name": "calendar_access_tokens_calendar_id_calendars_id_fk",
          "tableFrom": "calendar_access_tokens",
          "tableTo": "calendars",
          "columnsFrom": [
            "calendar_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "calendar_access_tokens_bundle_id_calendar_permission_bundles_id_fk": {
          "name": "calendar_access_tokens_bundle_id_calendar_permission_bundles_id_fk",
          "tableFrom": "calendar_access_tokens",
          "tableTo": "calendar_permission_bundles",
          "columnsFrom": [
            "bundle_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "calendar_access_tokens_created_by_user_id_fk": {
          "name": "calendar_access_tokens_created_by_user_id_fk",
          "tableFrom": "calendar_access_tokens",
          "tableTo": "user",
          "columnsFrom": [
            "created_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "calendar_notes": {
      "name": "calendar_notes",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "calendar_id": {
          "name": "calendar_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "date": {
          "name": "date",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "note": {
          "name": "note",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'note'"
        },
        "color": {
          "name": "color",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "recurring_pattern": {
          "name": "recurring_pattern",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'none'"
        },
        "recurring_interval": {
          "name": "recurring_interval",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "calendar_notes_calendar_id_calendars_id_fk": {
          "name": "calendar_notes_calendar_id_calendars_id_fk",
          "tableFrom": "calendar_notes",
          "tableTo": "calendars",
          "columnsFrom": [
            "calendar_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "calendar_permission_bundles": {
      "name": "calendar_permission_bundles",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "calendar_id": {
          "name": "calendar_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "capabilities": {
          "name": "capabilities",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {
        "calendar_permission_bundles_calendarId_idx": {
          "name": "calendar_permission_bundles_calendarId_idx",
          "columns": [
            "calendar_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "calendar_permission_bundles_calendar_id_calendars_id_fk": {
          "name": "calendar_permission_bundles_calendar_id_calendars_id_fk",
          "tableFrom": "calendar_permission_bundles",
          "tableTo": "calendars",
          "columnsFrom": [
            "calendar_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "calendar_shares": {
      "name": "calendar_shares",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "calendar_id": {
          "name": "calendar_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "bundle_id": {
          "name": "bundle_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "permission": {
          "name": "permission",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'read'"
        },
        "shared_by": {
          "name": "shared_by",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {
        "calendar_shares_calendarId_idx": {
          "name": "calendar_shares_calendarId_idx",
          "columns": [
            "calendar_id"
          ],
          "isUnique": false
        },
        "calendar_shares_userId_idx": {
          "name": "calendar_shares_userId_idx",
          "columns": [
            "user_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "calendar_shares_calendar_id_calendars_id_fk": {
          "name": "calendar_shares_calendar_id_calendars_id_fk",
          "tableFrom": "calendar_shares",
          "tableTo": "calendars",
          "columnsFrom": [
            "calendar_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "calendar_shares_user_id_user_id_fk": {
          "name": "calendar_shares_user_id_user_id_fk",
          "tableFrom": "calendar_shares",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "calendar_shares_bundle_id_calendar_permission_bundles_id_fk": {
          "name": "calendar_shares_bundle_id_calendar_permission_bundles_id_fk",
          "tableFrom": "calendar_shares",
          "tableTo": "calendar_permission_bundles",
          "columnsFrom": [
            "bundle_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "calendar_shares_shared_by_user_id_fk": {
          "name": "calendar_shares_shared_by_user_id_fk",
          "tableFrom": "calendar_shares",
          "tableTo": "user",
          "columnsFrom": [
            "shared_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "calendars": {
      "name": "calendars",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "color": {
          "name": "color",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'#3b82f6'"
        },
        "owner_id": {
          "name": "owner_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "guest_bundle_id": {
          "name": "guest_bundle_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "guest_permission": {
          "name": "guest_permission",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'none'"
        },
        "allow_self_signup": {
          "name": "allow_self_signup",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": true
        },
        "signups_enabled": {
          "name": "signups_enabled",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": true
        },
        "view_settings": {
          "name": "view_settings",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {
        "calendars_ownerId_idx": {
          "name": "calendars_ownerId_idx",
          "columns": [
            "owner_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "calendars_owner_id_user_id_fk": {
          "name": "calendars_owner_id_user_id_fk",
          "tableFrom": "calendars",
          "tableTo": "user",
          "columnsFrom": [
            "owner_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "external_syncs": {
      "name": "external_syncs",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "calendar_id": {
          "name": "calendar_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "sync_type": {
          "name": "sync_type",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'icloud'"
        },
        "calendar_url": {
          "name": "calendar_url",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "color": {
          "name": "color",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'#3b82f6'"
        },
        "display_mode": {
          "name": "display_mode",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'normal'"
        },
        "is_hidden": {
          "name": "is_hidden",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "hide_from_stats": {
          "name": "hide_from_stats",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "auto_sync_interval": {
          "name": "auto_sync_interval",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "is_one_time_import": {
          "name": "is_one_time_import",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "last_synced_at": {
          "name": "last_synced_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "external_syncs_calendar_id_calendars_id_fk": {
          "name": "external_syncs_calendar_id_calendars_id_fk",
          "tableFrom": "external_syncs",
          "tableTo": "calendars",
          "columnsFrom": [
            "calendar_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "session": {
      "name": "session",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "expires_at": {
          "name": "expires_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "token": {
          "name": "token",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "ip_address": {
          "name": "ip_address",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "user_agent": {
          "name": "user_agent",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "impersonated_by": {
          "name": "impersonated_by",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "session_token_unique": {
          "name": "session_token_unique",
          "columns": [
            "token"
          ],
          "isUnique": true
        },
        "session_userId_idx": {
          "name": "session_userId_idx",
          "columns": [
            "user_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "session_user_id_user_id_fk": {
          "name": "session_user_id_user_id_fk",
          "tableFrom": "session",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "shift_presets": {
      "name": "shift_presets",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "calendar_id": {
          "name": "calendar_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "start_time": {
          "name": "start_time",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "end_time": {
          "name": "end_time",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "color": {
          "name": "color",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'#3b82f6'"
        },
        "notes": {
          "name": "notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "group_name": {
          "name": "group_name",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "is_secondary": {
          "name": "is_secondary",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "is_all_day": {
          "name": "is_all_day",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "hide_from_stats": {
          "name": "hide_from_stats",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "default_signup_capacity": {
          "name": "default_signup_capacity",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "order": {
          "name": "order",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "shift_presets_calendar_id_calendars_id_fk": {
          "name": "shift_presets_calendar_id_calendars_id_fk",
          "tableFrom": "shift_presets",
          "tableTo": "calendars",
          "columnsFrom": [
            "calendar_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "shift_signups": {
      "name": "shift_signups",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "shift_id": {
          "name": "shift_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "signed_up_by": {
          "name": "signed_up_by",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {
        "shift_signups_shiftId_idx": {
          "name": "shift_signups_shiftId_idx",
          "columns": [
            "shift_id"
          ],
          "isUnique": false
        },
        "shift_signups_userId_idx": {
          "name": "shift_signups_userId_idx",
          "columns": [
            "user_id"
          ],
          "isUnique": false
        },
        "shift_signups_shiftId_userId_idx": {
          "name": "shift_signups_shiftId_userId_idx",
          "columns": [
            "shift_id",
            "user_id"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {
        "shift_signups_shift_id_shifts_id_fk": {
          "name": "shift_signups_shift_id_shifts_id_fk",
          "tableFrom": "shift_signups",
          "tableTo": "shifts",
          "columnsFrom": [
            "shift_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "shift_signups_user_id_user_id_fk": {
          "name": "shift_signups_user_id_user_id_fk",
          "tableFrom": "shift_signups",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "shift_signups_signed_up_by_user_id_fk": {
          "name": "shift_signups_signed_up_by_user_id_fk",
          "tableFrom": "shift_signups",
          "tableTo": "user",
          "columnsFrom": [
            "signed_up_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "shifts": {
      "name": "shifts",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "calendar_id": {
          "name": "calendar_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "preset_id": {
          "name": "preset_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "date": {
          "name": "date",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "start_time": {
          "name": "start_time",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "end_time": {
          "name": "end_time",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "color": {
          "name": "color",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'#3b82f6'"
        },
        "notes": {
          "name": "notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "is_all_day": {
          "name": "is_all_day",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "is_secondary": {
          "name": "is_secondary",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "signup_capacity": {
          "name": "signup_capacity",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "external_event_id": {
          "name": "external_event_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "external_sync_id": {
          "name": "external_sync_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "synced_from_external": {
          "name": "synced_from_external",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "shifts_calendar_id_calendars_id_fk": {
          "name": "shifts_calendar_id_calendars_id_fk",
          "tableFrom": "shifts",
          "tableTo": "calendars",
          "columnsFrom": [
            "calendar_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "shifts_preset_id_shift_presets_id_fk": {
          "name": "shifts_preset_id_shift_presets_id_fk",
          "tableFrom": "shifts",
          "tableTo": "shift_presets",
          "columnsFrom": [
            "preset_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "shifts_external_sync_id_external_syncs_id_fk": {
          "name": "shifts_external_sync_id_external_syncs_id_fk",
          "tableFrom": "shifts",
          "tableTo": "external_syncs",
          "columnsFrom": [
            "external_sync_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "sync_logs": {
      "name": "sync_logs",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "calendar_id": {
          "name": "calendar_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "external_sync_id": {
          "name": "external_sync_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "external_sync_name": {
          "name": "external_sync_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "error_message": {
          "name": "error_message",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "shifts_created": {
          "name": "shifts_created",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "shifts_updated": {
          "name": "shifts_updated",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "shifts_deleted": {
          "name": "shifts_deleted",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "sync_type": {
          "name": "sync_type",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'auto'"
        },
        "is_read": {
          "name": "is_read",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "synced_at": {
          "name": "synced_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "sync_logs_calendar_id_calendars_id_fk": {
          "name": "sync_logs_calendar_id_calendars_id_fk",
          "tableFrom": "sync_logs",
          "tableTo": "calendars",
          "columnsFrom": [
            "calendar_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "sync_logs_external_sync_id_external_syncs_id_fk": {
          "name": "sync_logs_external_sync_id_external_syncs_id_fk",
          "tableFrom": "sync_logs",
          "tableTo": "external_syncs",
          "columnsFrom": [
            "external_sync_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "system_settings": {
      "name": "system_settings",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false,
          "default": "'default'"
        },
        "update_check_enabled": {
          "name": "update_check_enabled",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": true
        },
        "update_banner_visibility": {
          "name": "update_banner_visibility",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'all'"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "user": {
      "name": "user",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "email_verified": {
          "name": "email_verified",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "image": {
          "name": "image",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
        },
        "role": {
          "name": "role",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "banned": {
          "name": "banned",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": false
        },
        "ban_reason": {
          "name": "ban_reason",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "ban_expires": {
          "name": "ban_expires",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "user_email_unique": {
          "name": "user_email_unique",
          "columns": [
            "email"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "user_calendar_subscriptions": {
      "name": "user_calendar_subscriptions",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "calendar_id": {
          "name": "calendar_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'subscribed'"
        },
        "source": {
          "name": "source",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'guest'"
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {
        "user_calendar_subscriptions_userId_idx": {
          "name": "user_calendar_subscriptions_userId_idx",
          "columns": [
            "user_id"
          ],
          "isUnique": false
        },
        "user_calendar_subscriptions_calendarId_idx": {
          "name": "user_calendar_subscriptions_calendarId_idx",
          "columns": [
            "calendar_id"
          ],
          "isUnique": false
        },
        "user_calendar_subscriptions_status_idx": {
          "name": "user_calendar_subscriptions_status_idx",
          "columns": [
            "status"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "user_calendar_subscriptions_user_id_user_id_fk": {
          "name": "user_calendar_subscriptions_user_id_user_id_fk",
          "tableFrom": "user_calendar_subscriptions",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "user_calendar_subscriptions_calendar_id_calendars_id_fk": {
          "name": "user_calendar_subscriptions_calendar_id_calendars_id_fk",
          "tableFrom": "user_calendar_subscriptions",
          "tableTo": "calendars",
          "columnsFrom": [
            "calendar_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "user_preferences": {
      "name": "user_preferences",
      "columns": {
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "view_settings": {
          "name": "view_settings",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "user_preferences_user_id_user_id_fk": {
          "name": "user_preferences_user_id_user_id_fk",
          "tableFrom": "user_preferences",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "verification": {
      "name": "verification",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "identifier": {
          "name": "identifier",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "value": {
          "name": "value",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "expires_at": {
          "name": "expires_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    }
  },
  "views": {},
  "enums": {},
  "_meta": {
    "schemas": {},
    "tables": {},
    "columns": {}
  },
  "internal": {
    "indexes": {}
  }
}