{
  "id": "a35d133f-4419-4265-a683-8ac00185c0f4",
  "prevId": "72cb5e22-fb44-4db8-9527-020dbec017d0",
  "version": "7",
  "dialect": "postgresql",
  "tables": {
    "public.classes": {
      "name": "classes",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "bigint",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true
        },
        "balance": {
          "name": "balance",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false,
          "default": "0"
        },
        "role_id": {
          "name": "role_id",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "classes_name_unique": {
          "name": "classes_name_unique",
          "nullsNotDistinct": false,
          "columns": [
            "name"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.inventory": {
      "name": "inventory",
      "schema": "",
      "columns": {
        "user_id": {
          "name": "user_id",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "item_id": {
          "name": "item_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "quantity": {
          "name": "quantity",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false,
          "default": "1"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "inventory_user_id_users_id_fk": {
          "name": "inventory_user_id_users_id_fk",
          "tableFrom": "inventory",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "inventory_item_id_items_id_fk": {
          "name": "inventory_item_id_items_id_fk",
          "tableFrom": "inventory",
          "tableTo": "items",
          "columnsFrom": [
            "item_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "inventory_user_id_item_id_pk": {
          "name": "inventory_user_id_item_id_pk",
          "columns": [
            "user_id",
            "item_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {
        "quantity_check": {
          "name": "quantity_check",
          "value": "\"inventory\".\"quantity\" > 0"
        }
      },
      "isRLSEnabled": false
    },
    "public.item_transactions": {
      "name": "item_transactions",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "bigserial",
          "primaryKey": true,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "related_user_id": {
          "name": "related_user_id",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        },
        "item_id": {
          "name": "item_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "quantity": {
          "name": "quantity",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "item_transactions_user_id_users_id_fk": {
          "name": "item_transactions_user_id_users_id_fk",
          "tableFrom": "item_transactions",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "item_transactions_related_user_id_users_id_fk": {
          "name": "item_transactions_related_user_id_users_id_fk",
          "tableFrom": "item_transactions",
          "tableTo": "users",
          "columnsFrom": [
            "related_user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "item_transactions_item_id_items_id_fk": {
          "name": "item_transactions_item_id_items_id_fk",
          "tableFrom": "item_transactions",
          "tableTo": "items",
          "columnsFrom": [
            "item_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.items": {
      "name": "items",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "rarity": {
          "name": "rarity",
          "type": "varchar(20)",
          "primaryKey": false,
          "notNull": false,
          "default": "'Common'"
        },
        "type": {
          "name": "type",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": true,
          "default": "'MATERIAL'"
        },
        "usage_data": {
          "name": "usage_data",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'{}'::jsonb"
        },
        "price": {
          "name": "price",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        },
        "icon_url": {
          "name": "icon_url",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "image_url": {
          "name": "image_url",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "items_name_unique": {
          "name": "items_name_unique",
          "nullsNotDistinct": false,
          "columns": [
            "name"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.lootdrops": {
      "name": "lootdrops",
      "schema": "",
      "columns": {
        "message_id": {
          "name": "message_id",
          "type": "varchar(255)",
          "primaryKey": true,
          "notNull": true
        },
        "channel_id": {
          "name": "channel_id",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true
        },
        "reward_amount": {
          "name": "reward_amount",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "currency": {
          "name": "currency",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": true
        },
        "claimed_by": {
          "name": "claimed_by",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "lootdrops_claimed_by_users_id_fk": {
          "name": "lootdrops_claimed_by_users_id_fk",
          "tableFrom": "lootdrops",
          "tableTo": "users",
          "columnsFrom": [
            "claimed_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.moderation_cases": {
      "name": "moderation_cases",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "bigserial",
          "primaryKey": true,
          "notNull": true
        },
        "case_id": {
          "name": "case_id",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "varchar(20)",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "username": {
          "name": "username",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true
        },
        "moderator_id": {
          "name": "moderator_id",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "moderator_name": {
          "name": "moderator_name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true
        },
        "reason": {
          "name": "reason",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "metadata": {
          "name": "metadata",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'{}'::jsonb"
        },
        "active": {
          "name": "active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "resolved_at": {
          "name": "resolved_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "resolved_by": {
          "name": "resolved_by",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        },
        "resolved_reason": {
          "name": "resolved_reason",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "moderation_cases_user_id_idx": {
          "name": "moderation_cases_user_id_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "moderation_cases_case_id_idx": {
          "name": "moderation_cases_case_id_idx",
          "columns": [
            {
              "expression": "case_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "moderation_cases_case_id_unique": {
          "name": "moderation_cases_case_id_unique",
          "nullsNotDistinct": false,
          "columns": [
            "case_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.quests": {
      "name": "quests",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "serial",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "trigger_event": {
          "name": "trigger_event",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": true
        },
        "requirements": {
          "name": "requirements",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true,
          "default": "'{}'::jsonb"
        },
        "rewards": {
          "name": "rewards",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true,
          "default": "'{}'::jsonb"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.transactions": {
      "name": "transactions",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "bigserial",
          "primaryKey": true,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        },
        "related_user_id": {
          "name": "related_user_id",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        },
        "amount": {
          "name": "amount",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "transactions_created_at_idx": {
          "name": "transactions_created_at_idx",
          "columns": [
            {
              "expression": "created_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "transactions_user_id_users_id_fk": {
          "name": "transactions_user_id_users_id_fk",
          "tableFrom": "transactions",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "transactions_related_user_id_users_id_fk": {
          "name": "transactions_related_user_id_users_id_fk",
          "tableFrom": "transactions",
          "tableTo": "users",
          "columnsFrom": [
            "related_user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.user_quests": {
      "name": "user_quests",
      "schema": "",
      "columns": {
        "user_id": {
          "name": "user_id",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "quest_id": {
          "name": "quest_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "progress": {
          "name": "progress",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "completed_at": {
          "name": "completed_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "user_quests_user_id_users_id_fk": {
          "name": "user_quests_user_id_users_id_fk",
          "tableFrom": "user_quests",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "user_quests_quest_id_quests_id_fk": {
          "name": "user_quests_quest_id_quests_id_fk",
          "tableFrom": "user_quests",
          "tableTo": "quests",
          "columnsFrom": [
            "quest_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "user_quests_user_id_quest_id_pk": {
          "name": "user_quests_user_id_quest_id_pk",
          "columns": [
            "user_id",
            "quest_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.user_timers": {
      "name": "user_timers",
      "schema": "",
      "columns": {
        "user_id": {
          "name": "user_id",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": true
        },
        "key": {
          "name": "key",
          "type": "varchar(100)",
          "primaryKey": false,
          "notNull": true
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true
        },
        "metadata": {
          "name": "metadata",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'{}'::jsonb"
        }
      },
      "indexes": {
        "user_timers_expires_at_idx": {
          "name": "user_timers_expires_at_idx",
          "columns": [
            {
              "expression": "expires_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "user_timers_lookup_idx": {
          "name": "user_timers_lookup_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "type",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "key",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "user_timers_user_id_users_id_fk": {
          "name": "user_timers_user_id_users_id_fk",
          "tableFrom": "user_timers",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "user_timers_user_id_type_key_pk": {
          "name": "user_timers_user_id_type_key_pk",
          "columns": [
            "user_id",
            "type",
            "key"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.users": {
      "name": "users",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "bigint",
          "primaryKey": true,
          "notNull": true
        },
        "class_id": {
          "name": "class_id",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false
        },
        "username": {
          "name": "username",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "balance": {
          "name": "balance",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false,
          "default": "0"
        },
        "xp": {
          "name": "xp",
          "type": "bigint",
          "primaryKey": false,
          "notNull": false,
          "default": "0"
        },
        "level": {
          "name": "level",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 1
        },
        "daily_streak": {
          "name": "daily_streak",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "settings": {
          "name": "settings",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'{}'::jsonb"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "users_username_idx": {
          "name": "users_username_idx",
          "columns": [
            {
              "expression": "username",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "users_balance_idx": {
          "name": "users_balance_idx",
          "columns": [
            {
              "expression": "balance",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "users_level_xp_idx": {
          "name": "users_level_xp_idx",
          "columns": [
            {
              "expression": "level",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "xp",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "users_class_id_classes_id_fk": {
          "name": "users_class_id_classes_id_fk",
          "tableFrom": "users",
          "tableTo": "classes",
          "columnsFrom": [
            "class_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "users_username_unique": {
          "name": "users_username_unique",
          "nullsNotDistinct": false,
          "columns": [
            "username"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    }
  },
  "enums": {},
  "schemas": {},
  "sequences": {},
  "roles": {},
  "policies": {},
  "views": {},
  "_meta": {
    "columns": {},
    "schemas": {},
    "tables": {}
  }
}