{
  "version": "8",
  "dialect": "postgres",
  "id": "cc315c2a-a79c-493f-8a80-7610617f6688",
  "prevIds": [
    "a51e9730-2132-43df-b726-e45b273c7943"
  ],
  "ddl": [
    {
      "values": [
        "admin",
        "manager",
        "staff"
      ],
      "name": "account_role",
      "entityType": "enums",
      "schema": "public"
    },
    {
      "values": [
        "once",
        "daily",
        "weekly",
        "monthly",
        "quarterly",
        "general"
      ],
      "name": "occurrence",
      "entityType": "enums",
      "schema": "public"
    },
    {
      "values": [
        "admin",
        "manager",
        "assistant_manager",
        "supervisor",
        "line_leader",
        "staff"
      ],
      "name": "position_level",
      "entityType": "enums",
      "schema": "public"
    },
    {
      "values": [
        "todo",
        "started",
        "finished",
        "checked",
        "missed"
      ],
      "name": "task_status",
      "entityType": "enums",
      "schema": "public"
    },
    {
      "values": [
        "mon_fri",
        "mon_sat"
      ],
      "name": "work_pattern",
      "entityType": "enums",
      "schema": "public"
    },
    {
      "isRlsEnabled": false,
      "name": "accounts",
      "entityType": "tables",
      "schema": "public"
    },
    {
      "isRlsEnabled": false,
      "name": "departments",
      "entityType": "tables",
      "schema": "public"
    },
    {
      "isRlsEnabled": false,
      "name": "holidays",
      "entityType": "tables",
      "schema": "public"
    },
    {
      "isRlsEnabled": false,
      "name": "people",
      "entityType": "tables",
      "schema": "public"
    },
    {
      "isRlsEnabled": false,
      "name": "positions",
      "entityType": "tables",
      "schema": "public"
    },
    {
      "isRlsEnabled": false,
      "name": "recurring_templates",
      "entityType": "tables",
      "schema": "public"
    },
    {
      "isRlsEnabled": false,
      "name": "task_instances",
      "entityType": "tables",
      "schema": "public"
    },
    {
      "isRlsEnabled": false,
      "name": "task_submissions",
      "entityType": "tables",
      "schema": "public"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": "gen_random_uuid()",
      "generated": null,
      "identity": null,
      "name": "id",
      "entityType": "columns",
      "schema": "public",
      "table": "accounts"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "person_id",
      "entityType": "columns",
      "schema": "public",
      "table": "accounts"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "password_hash",
      "entityType": "columns",
      "schema": "public",
      "table": "accounts"
    },
    {
      "type": "account_role",
      "typeSchema": "public",
      "notNull": true,
      "dimensions": 0,
      "default": "'staff'",
      "generated": null,
      "identity": null,
      "name": "role",
      "entityType": "columns",
      "schema": "public",
      "table": "accounts"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "last_login_at",
      "entityType": "columns",
      "schema": "public",
      "table": "accounts"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "disabled_at",
      "entityType": "columns",
      "schema": "public",
      "table": "accounts"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": "now()",
      "generated": null,
      "identity": null,
      "name": "created_at",
      "entityType": "columns",
      "schema": "public",
      "table": "accounts"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": "gen_random_uuid()",
      "generated": null,
      "identity": null,
      "name": "id",
      "entityType": "columns",
      "schema": "public",
      "table": "departments"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "name",
      "entityType": "columns",
      "schema": "public",
      "table": "departments"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "archived_at",
      "entityType": "columns",
      "schema": "public",
      "table": "departments"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": "now()",
      "generated": null,
      "identity": null,
      "name": "created_at",
      "entityType": "columns",
      "schema": "public",
      "table": "departments"
    },
    {
      "type": "date",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "holiday_date",
      "entityType": "columns",
      "schema": "public",
      "table": "holidays"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "name",
      "entityType": "columns",
      "schema": "public",
      "table": "holidays"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": "now()",
      "generated": null,
      "identity": null,
      "name": "created_at",
      "entityType": "columns",
      "schema": "public",
      "table": "holidays"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": "gen_random_uuid()",
      "generated": null,
      "identity": null,
      "name": "id",
      "entityType": "columns",
      "schema": "public",
      "table": "people"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "employee_code",
      "entityType": "columns",
      "schema": "public",
      "table": "people"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "first_name",
      "entityType": "columns",
      "schema": "public",
      "table": "people"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "last_name",
      "entityType": "columns",
      "schema": "public",
      "table": "people"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "display_name",
      "entityType": "columns",
      "schema": "public",
      "table": "people"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "position_id",
      "entityType": "columns",
      "schema": "public",
      "table": "people"
    },
    {
      "type": "work_pattern",
      "typeSchema": "public",
      "notNull": true,
      "dimensions": 0,
      "default": "'mon_fri'",
      "generated": null,
      "identity": null,
      "name": "work_pattern",
      "entityType": "columns",
      "schema": "public",
      "table": "people"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "archived_at",
      "entityType": "columns",
      "schema": "public",
      "table": "people"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": "now()",
      "generated": null,
      "identity": null,
      "name": "created_at",
      "entityType": "columns",
      "schema": "public",
      "table": "people"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": "gen_random_uuid()",
      "generated": null,
      "identity": null,
      "name": "id",
      "entityType": "columns",
      "schema": "public",
      "table": "positions"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "department_id",
      "entityType": "columns",
      "schema": "public",
      "table": "positions"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "title",
      "entityType": "columns",
      "schema": "public",
      "table": "positions"
    },
    {
      "type": "position_level",
      "typeSchema": "public",
      "notNull": true,
      "dimensions": 0,
      "default": "'staff'",
      "generated": null,
      "identity": null,
      "name": "level",
      "entityType": "columns",
      "schema": "public",
      "table": "positions"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "job_description",
      "entityType": "columns",
      "schema": "public",
      "table": "positions"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "archived_at",
      "entityType": "columns",
      "schema": "public",
      "table": "positions"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": "now()",
      "generated": null,
      "identity": null,
      "name": "created_at",
      "entityType": "columns",
      "schema": "public",
      "table": "positions"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": "gen_random_uuid()",
      "generated": null,
      "identity": null,
      "name": "id",
      "entityType": "columns",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "position_id",
      "entityType": "columns",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "description",
      "entityType": "columns",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "type": "occurrence",
      "typeSchema": "public",
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "occurrence",
      "entityType": "columns",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "deadline",
      "entityType": "columns",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "type": "smallint",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "day_of_week",
      "entityType": "columns",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "type": "smallint",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "day_of_month",
      "entityType": "columns",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "checker_person_id",
      "entityType": "columns",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "verifier_person_id",
      "entityType": "columns",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "report_to_deliver",
      "entityType": "columns",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "report_example_url",
      "entityType": "columns",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "wi_sop_url",
      "entityType": "columns",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "type": "integer",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "time_to_do_minutes",
      "entityType": "columns",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "customer_tag",
      "entityType": "columns",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "type": "boolean",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": "true",
      "generated": null,
      "identity": null,
      "name": "active",
      "entityType": "columns",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "created_by",
      "entityType": "columns",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": "now()",
      "generated": null,
      "identity": null,
      "name": "created_at",
      "entityType": "columns",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": "gen_random_uuid()",
      "generated": null,
      "identity": null,
      "name": "id",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "recurring_template_id",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "date",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "due_date",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "assignee_person_id",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "task_status",
      "typeSchema": "public",
      "notNull": true,
      "dimensions": 0,
      "default": "'todo'",
      "generated": null,
      "identity": null,
      "name": "status",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "started_at",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "finished_at",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "checked_at",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "checked_by",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "verified_at",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "verified_by",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "sent_back_at",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "sent_back_by",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "sent_back_note",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "issue_reported_at",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "issue_reported_by",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "issue_note",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": "now()",
      "generated": null,
      "identity": null,
      "name": "created_at",
      "entityType": "columns",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": "gen_random_uuid()",
      "generated": null,
      "identity": null,
      "name": "id",
      "entityType": "columns",
      "schema": "public",
      "table": "task_submissions"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "task_instance_id",
      "entityType": "columns",
      "schema": "public",
      "table": "task_submissions"
    },
    {
      "type": "uuid",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "submitted_by",
      "entityType": "columns",
      "schema": "public",
      "table": "task_submissions"
    },
    {
      "type": "timestamp with time zone",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": "now()",
      "generated": null,
      "identity": null,
      "name": "submitted_at",
      "entityType": "columns",
      "schema": "public",
      "table": "task_submissions"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": true,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "note",
      "entityType": "columns",
      "schema": "public",
      "table": "task_submissions"
    },
    {
      "type": "jsonb",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "readings",
      "entityType": "columns",
      "schema": "public",
      "table": "task_submissions"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "delivered_name",
      "entityType": "columns",
      "schema": "public",
      "table": "task_submissions"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "delivered_url",
      "entityType": "columns",
      "schema": "public",
      "table": "task_submissions"
    },
    {
      "type": "text",
      "typeSchema": null,
      "notNull": false,
      "dimensions": 0,
      "default": null,
      "generated": null,
      "identity": null,
      "name": "delivered_how",
      "entityType": "columns",
      "schema": "public",
      "table": "task_submissions"
    },
    {
      "nameExplicit": true,
      "columns": [
        {
          "value": "department_id",
          "isExpression": false,
          "asc": true,
          "nullsFirst": false,
          "opclass": null
        },
        {
          "value": "title",
          "isExpression": false,
          "asc": true,
          "nullsFirst": false,
          "opclass": null
        }
      ],
      "isUnique": true,
      "where": null,
      "with": "",
      "method": "btree",
      "concurrently": false,
      "name": "positions_department_title_key",
      "entityType": "indexes",
      "schema": "public",
      "table": "positions"
    },
    {
      "nameExplicit": true,
      "columns": [
        {
          "value": "position_id",
          "isExpression": false,
          "asc": true,
          "nullsFirst": false,
          "opclass": null
        }
      ],
      "isUnique": false,
      "where": null,
      "with": "",
      "method": "btree",
      "concurrently": false,
      "name": "recurring_templates_position_idx",
      "entityType": "indexes",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "nameExplicit": true,
      "columns": [
        {
          "value": "recurring_template_id",
          "isExpression": false,
          "asc": true,
          "nullsFirst": false,
          "opclass": null
        },
        {
          "value": "due_date",
          "isExpression": false,
          "asc": true,
          "nullsFirst": false,
          "opclass": null
        }
      ],
      "isUnique": true,
      "where": null,
      "with": "",
      "method": "btree",
      "concurrently": false,
      "name": "task_instances_template_due_key",
      "entityType": "indexes",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "nameExplicit": true,
      "columns": [
        {
          "value": "assignee_person_id",
          "isExpression": false,
          "asc": true,
          "nullsFirst": false,
          "opclass": null
        },
        {
          "value": "due_date",
          "isExpression": false,
          "asc": true,
          "nullsFirst": false,
          "opclass": null
        }
      ],
      "isUnique": false,
      "where": null,
      "with": "",
      "method": "btree",
      "concurrently": false,
      "name": "task_instances_assignee_due_idx",
      "entityType": "indexes",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "nameExplicit": true,
      "columns": [
        {
          "value": "status",
          "isExpression": false,
          "asc": true,
          "nullsFirst": false,
          "opclass": null
        },
        {
          "value": "due_date",
          "isExpression": false,
          "asc": true,
          "nullsFirst": false,
          "opclass": null
        }
      ],
      "isUnique": false,
      "where": null,
      "with": "",
      "method": "btree",
      "concurrently": false,
      "name": "task_instances_status_due_idx",
      "entityType": "indexes",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "nameExplicit": false,
      "columns": [
        "person_id"
      ],
      "schemaTo": "public",
      "tableTo": "people",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "NO ACTION",
      "name": "accounts_person_id_people_id_fkey",
      "entityType": "fks",
      "schema": "public",
      "table": "accounts"
    },
    {
      "nameExplicit": false,
      "columns": [
        "position_id"
      ],
      "schemaTo": "public",
      "tableTo": "positions",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "NO ACTION",
      "name": "people_position_id_positions_id_fkey",
      "entityType": "fks",
      "schema": "public",
      "table": "people"
    },
    {
      "nameExplicit": false,
      "columns": [
        "department_id"
      ],
      "schemaTo": "public",
      "tableTo": "departments",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "NO ACTION",
      "name": "positions_department_id_departments_id_fkey",
      "entityType": "fks",
      "schema": "public",
      "table": "positions"
    },
    {
      "nameExplicit": false,
      "columns": [
        "position_id"
      ],
      "schemaTo": "public",
      "tableTo": "positions",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "NO ACTION",
      "name": "recurring_templates_position_id_positions_id_fkey",
      "entityType": "fks",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "nameExplicit": false,
      "columns": [
        "checker_person_id"
      ],
      "schemaTo": "public",
      "tableTo": "people",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "NO ACTION",
      "name": "recurring_templates_checker_person_id_people_id_fkey",
      "entityType": "fks",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "nameExplicit": false,
      "columns": [
        "verifier_person_id"
      ],
      "schemaTo": "public",
      "tableTo": "people",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "NO ACTION",
      "name": "recurring_templates_verifier_person_id_people_id_fkey",
      "entityType": "fks",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "nameExplicit": false,
      "columns": [
        "created_by"
      ],
      "schemaTo": "public",
      "tableTo": "people",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "NO ACTION",
      "name": "recurring_templates_created_by_people_id_fkey",
      "entityType": "fks",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "nameExplicit": false,
      "columns": [
        "recurring_template_id"
      ],
      "schemaTo": "public",
      "tableTo": "recurring_templates",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "NO ACTION",
      "name": "task_instances_ChTF0cD0rNa5_fkey",
      "entityType": "fks",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "nameExplicit": false,
      "columns": [
        "assignee_person_id"
      ],
      "schemaTo": "public",
      "tableTo": "people",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "NO ACTION",
      "name": "task_instances_assignee_person_id_people_id_fkey",
      "entityType": "fks",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "nameExplicit": false,
      "columns": [
        "checked_by"
      ],
      "schemaTo": "public",
      "tableTo": "people",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "NO ACTION",
      "name": "task_instances_checked_by_people_id_fkey",
      "entityType": "fks",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "nameExplicit": false,
      "columns": [
        "verified_by"
      ],
      "schemaTo": "public",
      "tableTo": "people",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "NO ACTION",
      "name": "task_instances_verified_by_people_id_fkey",
      "entityType": "fks",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "nameExplicit": false,
      "columns": [
        "sent_back_by"
      ],
      "schemaTo": "public",
      "tableTo": "people",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "NO ACTION",
      "name": "task_instances_sent_back_by_people_id_fkey",
      "entityType": "fks",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "nameExplicit": false,
      "columns": [
        "issue_reported_by"
      ],
      "schemaTo": "public",
      "tableTo": "people",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "NO ACTION",
      "name": "task_instances_issue_reported_by_people_id_fkey",
      "entityType": "fks",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "nameExplicit": false,
      "columns": [
        "task_instance_id"
      ],
      "schemaTo": "public",
      "tableTo": "task_instances",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "NO ACTION",
      "name": "task_submissions_task_instance_id_task_instances_id_fkey",
      "entityType": "fks",
      "schema": "public",
      "table": "task_submissions"
    },
    {
      "nameExplicit": false,
      "columns": [
        "submitted_by"
      ],
      "schemaTo": "public",
      "tableTo": "people",
      "columnsTo": [
        "id"
      ],
      "onUpdate": "NO ACTION",
      "onDelete": "NO ACTION",
      "name": "task_submissions_submitted_by_people_id_fkey",
      "entityType": "fks",
      "schema": "public",
      "table": "task_submissions"
    },
    {
      "columns": [
        "id"
      ],
      "nameExplicit": false,
      "name": "accounts_pkey",
      "schema": "public",
      "table": "accounts",
      "entityType": "pks"
    },
    {
      "columns": [
        "id"
      ],
      "nameExplicit": false,
      "name": "departments_pkey",
      "schema": "public",
      "table": "departments",
      "entityType": "pks"
    },
    {
      "columns": [
        "holiday_date"
      ],
      "nameExplicit": false,
      "name": "holidays_pkey",
      "schema": "public",
      "table": "holidays",
      "entityType": "pks"
    },
    {
      "columns": [
        "id"
      ],
      "nameExplicit": false,
      "name": "people_pkey",
      "schema": "public",
      "table": "people",
      "entityType": "pks"
    },
    {
      "columns": [
        "id"
      ],
      "nameExplicit": false,
      "name": "positions_pkey",
      "schema": "public",
      "table": "positions",
      "entityType": "pks"
    },
    {
      "columns": [
        "id"
      ],
      "nameExplicit": false,
      "name": "recurring_templates_pkey",
      "schema": "public",
      "table": "recurring_templates",
      "entityType": "pks"
    },
    {
      "columns": [
        "id"
      ],
      "nameExplicit": false,
      "name": "task_instances_pkey",
      "schema": "public",
      "table": "task_instances",
      "entityType": "pks"
    },
    {
      "columns": [
        "id"
      ],
      "nameExplicit": false,
      "name": "task_submissions_pkey",
      "schema": "public",
      "table": "task_submissions",
      "entityType": "pks"
    },
    {
      "nameExplicit": false,
      "columns": [
        "person_id"
      ],
      "nullsNotDistinct": false,
      "name": "accounts_person_id_key",
      "schema": "public",
      "table": "accounts",
      "entityType": "uniques"
    },
    {
      "nameExplicit": false,
      "columns": [
        "name"
      ],
      "nullsNotDistinct": false,
      "name": "departments_name_key",
      "schema": "public",
      "table": "departments",
      "entityType": "uniques"
    },
    {
      "nameExplicit": false,
      "columns": [
        "employee_code"
      ],
      "nullsNotDistinct": false,
      "name": "people_employee_code_key",
      "schema": "public",
      "table": "people",
      "entityType": "uniques"
    },
    {
      "nameExplicit": false,
      "columns": [
        "task_instance_id"
      ],
      "nullsNotDistinct": false,
      "name": "task_submissions_task_instance_id_key",
      "schema": "public",
      "table": "task_submissions",
      "entityType": "uniques"
    },
    {
      "value": "\"day_of_week\" IS NULL OR \"day_of_week\" BETWEEN 1 AND 7",
      "name": "recurring_templates_day_of_week_range",
      "entityType": "checks",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "value": "\"day_of_month\" IS NULL OR \"day_of_month\" BETWEEN 1 AND 31",
      "name": "recurring_templates_day_of_month_range",
      "entityType": "checks",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "value": "\n        CASE \"occurrence\"\n          WHEN 'once' THEN \"deadline\" IS NOT NULL\n            AND \"day_of_week\" IS NULL AND \"day_of_month\" IS NULL\n          WHEN 'daily' THEN \"deadline\" IS NULL\n            AND \"day_of_week\" IS NULL AND \"day_of_month\" IS NULL\n          WHEN 'weekly' THEN \"deadline\" IS NULL\n            AND \"day_of_week\" IS NOT NULL AND \"day_of_month\" IS NULL\n          WHEN 'monthly' THEN \"deadline\" IS NULL\n            AND \"day_of_week\" IS NULL AND \"day_of_month\" IS NOT NULL\n          WHEN 'quarterly' THEN \"deadline\" IS NULL\n            AND \"day_of_week\" IS NULL AND \"day_of_month\" IS NOT NULL\n          WHEN 'general' THEN \"deadline\" IS NULL\n            AND \"day_of_week\" IS NULL AND \"day_of_month\" IS NULL\n        END\n      ",
      "name": "recurring_templates_schedule_matches_occurrence",
      "entityType": "checks",
      "schema": "public",
      "table": "recurring_templates"
    },
    {
      "value": "\"verified_at\" IS NULL OR \"checked_at\" IS NOT NULL",
      "name": "task_instances_verified_after_checked",
      "entityType": "checks",
      "schema": "public",
      "table": "task_instances"
    },
    {
      "value": "\"status\" <> 'missed' OR \"checked_at\" IS NULL",
      "name": "task_instances_checked_is_not_missed",
      "entityType": "checks",
      "schema": "public",
      "table": "task_instances"
    }
  ],
  "renames": []
}