{
  "id": "d7d29b2a-044a-4d64-b9db-59211ca849f9",
  "prevId": "87836133-99ce-41ef-a9b4-ce3051eaeb89",
  "version": "7",
  "dialect": "postgresql",
  "tables": {
    "public.notification_delivery_attempts": {
      "name": "notification_delivery_attempts",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "notification_id": {
          "name": "notification_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "strategy_qualified_id": {
          "name": "strategy_qualified_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "attempted_at": {
          "name": "attempted_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "status": {
          "name": "status",
          "type": "notification_delivery_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true
        },
        "error_message": {
          "name": "error_message",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "duration_ms": {
          "name": "duration_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "notification_delivery_attempts_notification_idx": {
          "name": "notification_delivery_attempts_notification_idx",
          "columns": [
            {
              "expression": "notification_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "notification_delivery_attempts_attempted_at_idx": {
          "name": "notification_delivery_attempts_attempted_at_idx",
          "columns": [
            {
              "expression": "attempted_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "notification_delivery_attempts_notification_id_notifications_id_fk": {
          "name": "notification_delivery_attempts_notification_id_notifications_id_fk",
          "tableFrom": "notification_delivery_attempts",
          "tableTo": "notifications",
          "columnsFrom": [
            "notification_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.notification_groups": {
      "name": "notification_groups",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "owner_plugin": {
          "name": "owner_plugin",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.notification_resource_parents": {
      "name": "notification_resource_parents",
      "schema": "",
      "columns": {
        "child_target_type_id": {
          "name": "child_target_type_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "child_resource_key": {
          "name": "child_resource_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "parent_target_type_id": {
          "name": "parent_target_type_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "parent_resource_key": {
          "name": "parent_resource_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "notification_resource_parents_child_idx": {
          "name": "notification_resource_parents_child_idx",
          "columns": [
            {
              "expression": "child_target_type_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "child_resource_key",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "notification_resource_parents_child_target_type_id_child_resource_key_parent_target_type_id_parent_resource_key_pk": {
          "name": "notification_resource_parents_child_target_type_id_child_resource_key_parent_target_type_id_parent_resource_key_pk",
          "columns": [
            "child_target_type_id",
            "child_resource_key",
            "parent_target_type_id",
            "parent_resource_key"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.notification_resources": {
      "name": "notification_resources",
      "schema": "",
      "columns": {
        "target_type_id": {
          "name": "target_type_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "resource_key": {
          "name": "resource_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "display_label": {
          "name": "display_label",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "upserted_at": {
          "name": "upserted_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "notification_resources_target_type_id_notification_targets_target_type_id_fk": {
          "name": "notification_resources_target_type_id_notification_targets_target_type_id_fk",
          "tableFrom": "notification_resources",
          "tableTo": "notification_targets",
          "columnsFrom": [
            "target_type_id"
          ],
          "columnsTo": [
            "target_type_id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "notification_resources_target_type_id_resource_key_pk": {
          "name": "notification_resources_target_type_id_resource_key_pk",
          "columns": [
            "target_type_id",
            "resource_key"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.notification_subscriptions": {
      "name": "notification_subscriptions",
      "schema": "",
      "columns": {
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "group_id": {
          "name": "group_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "subscribed_at": {
          "name": "subscribed_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "notification_subscriptions_group_id_notification_groups_id_fk": {
          "name": "notification_subscriptions_group_id_notification_groups_id_fk",
          "tableFrom": "notification_subscriptions",
          "tableTo": "notification_groups",
          "columnsFrom": [
            "group_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "notification_subscriptions_user_id_group_id_pk": {
          "name": "notification_subscriptions_user_id_group_id_pk",
          "columns": [
            "user_id",
            "group_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.notification_targets": {
      "name": "notification_targets",
      "schema": "",
      "columns": {
        "target_type_id": {
          "name": "target_type_id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "owner_plugin": {
          "name": "owner_plugin",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "resource_kind": {
          "name": "resource_kind",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "parent_target_type_id": {
          "name": "parent_target_type_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "legacy_group_id_template": {
          "name": "legacy_group_id_template",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "registered_at": {
          "name": "registered_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.notifications": {
      "name": "notifications",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "body": {
          "name": "body",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "action": {
          "name": "action",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "importance": {
          "name": "importance",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'info'"
        },
        "is_read": {
          "name": "is_read",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "group_id": {
          "name": "group_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "subjects": {
          "name": "subjects",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "notifications_user_collapse_idx": {
          "name": "notifications_user_collapse_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "group_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "notifications_user_created_idx": {
          "name": "notifications_user_created_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "created_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.subscription_migrations": {
      "name": "subscription_migrations",
      "schema": "",
      "columns": {
        "spec_id": {
          "name": "spec_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "resource_key": {
          "name": "resource_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "migrated_at": {
          "name": "migrated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "subscription_migrations_spec_id_resource_key_pk": {
          "name": "subscription_migrations_spec_id_resource_key_pk",
          "columns": [
            "spec_id",
            "resource_key"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.subscription_specs": {
      "name": "subscription_specs",
      "schema": "",
      "columns": {
        "spec_id": {
          "name": "spec_id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "owner_plugin": {
          "name": "owner_plugin",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "local_id": {
          "name": "local_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "target_type_id": {
          "name": "target_type_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "display_title": {
          "name": "display_title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "display_description": {
          "name": "display_description",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "display_icon_name": {
          "name": "display_icon_name",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "registered_at": {
          "name": "registered_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "subscription_specs_target_type_id_notification_targets_target_type_id_fk": {
          "name": "subscription_specs_target_type_id_notification_targets_target_type_id_fk",
          "tableFrom": "subscription_specs",
          "tableTo": "notification_targets",
          "columnsFrom": [
            "target_type_id"
          ],
          "columnsTo": [
            "target_type_id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    }
  },
  "enums": {
    "public.notification_delivery_status": {
      "name": "notification_delivery_status",
      "schema": "public",
      "values": [
        "success",
        "failure"
      ]
    }
  },
  "schemas": {},
  "sequences": {},
  "roles": {},
  "policies": {},
  "views": {},
  "_meta": {
    "columns": {},
    "schemas": {},
    "tables": {}
  }
}