diff --git a/app/drizzle/migrations/0190_swift_green_goblin.sql b/app/drizzle/migrations/0190_swift_green_goblin.sql new file mode 100644 index 00000000..3a69bd69 --- /dev/null +++ b/app/drizzle/migrations/0190_swift_green_goblin.sql @@ -0,0 +1,4 @@ +DROP INDEX `AuctionRequest_acceptedById_idx` ON `AuctionRequest`; +DROP INDEX `Bid_acceptedById_idx` ON `Bid`; +ALTER TABLE `ShopItem` MODIFY COLUMN `quantity` int NOT NULL DEFAULT 1; +ALTER TABLE `AuctionRequest` DROP COLUMN `itemId`; diff --git a/app/drizzle/migrations/meta/0190_snapshot.json b/app/drizzle/migrations/meta/0190_snapshot.json new file mode 100644 index 00000000..afb21928 --- /dev/null +++ b/app/drizzle/migrations/meta/0190_snapshot.json @@ -0,0 +1,7955 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "1ee2f12d-e0bf-40c3-a487-fdcffbbbd2f7", + "prevId": "1c0ae4a7-cf17-4734-b72c-8804e6211b89", + "tables": { + "ActionLog": { + "name": "ActionLog", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "tableName": { + "name": "tableName", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "changes": { + "name": "changes", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "relatedId": { + "name": "relatedId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "relatedText": { + "name": "relatedText", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "relatedImage": { + "name": "relatedImage", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "ActionLog_userId_idx": { + "name": "ActionLog_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ActionLog_id": { + "name": "ActionLog_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "AiProfile": { + "name": "AiProfile", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rules": { + "name": "rules", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "includeDefaultRules": { + "name": "includeDefaultRules", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + } + }, + "indexes": { + "AiProfile_userId_idx": { + "name": "AiProfile_userId_idx", + "columns": [ + "userId" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "AiProfile_id": { + "name": "AiProfile_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "AnbuSquad": { + "name": "AnbuSquad", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "leaderId": { + "name": "leaderId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "villageId": { + "name": "villageId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "pvpActivity": { + "name": "pvpActivity", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "kageOrderId": { + "name": "kageOrderId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "leaderOrderId": { + "name": "leaderOrderId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "AnbuSquad_name_key": { + "name": "AnbuSquad_name_key", + "columns": [ + "name" + ], + "isUnique": true + }, + "AnbuSquad_leaderId_idx": { + "name": "AnbuSquad_leaderId_idx", + "columns": [ + "leaderId" + ], + "isUnique": false + }, + "AnbuSquad_villageId_idx": { + "name": "AnbuSquad_villageId_idx", + "columns": [ + "villageId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "AnbuSquad_id": { + "name": "AnbuSquad_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "AuctionRequest": { + "name": "AuctionRequest", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "enum('CRAFT','REPAIR')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "details": { + "name": "details", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "price": { + "name": "price", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "creatorId": { + "name": "creatorId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "enum('PENDING','ACCEPTED','COMPLETED')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'PENDING'" + }, + "acceptedById": { + "name": "acceptedById", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "AuctionRequest_creatorId_idx": { + "name": "AuctionRequest_creatorId_idx", + "columns": [ + "creatorId" + ], + "isUnique": false + }, + "AuctionRequest_status_idx": { + "name": "AuctionRequest_status_idx", + "columns": [ + "status" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "AuctionRequest_id": { + "name": "AuctionRequest_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "AutomatedModeration": { + "name": "AutomatedModeration", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "relationType": { + "name": "relationType", + "type": "enum('comment','privateMessage','forumPost','userReport','userNindo','clanOrder','anbuOrder','kageOrder','userAvatar')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "sexual": { + "name": "sexual", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "sexual_minors": { + "name": "sexual_minors", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "harassment": { + "name": "harassment", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "harassment_threatening": { + "name": "harassment_threatening", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "hate": { + "name": "hate", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "hate_threatening": { + "name": "hate_threatening", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "illicit": { + "name": "illicit", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "illicit_violent": { + "name": "illicit_violent", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "self_harm": { + "name": "self_harm", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "self_harm_intent": { + "name": "self_harm_intent", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "self_harm_instructions": { + "name": "self_harm_instructions", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "violence": { + "name": "violence", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "violence_graphic": { + "name": "violence_graphic", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "AutoMod_userId_idx": { + "name": "AutoMod_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + }, + "AutoMod_relationType_idx": { + "name": "AutoMod_relationType_idx", + "columns": [ + "relationType" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "AutomatedModeration_id": { + "name": "AutomatedModeration_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "backgroundSchema": { + "name": "backgroundSchema", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(UUID())" + }, + "schema": { + "name": "schema", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "isActive": { + "name": "isActive", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "backgroundSchema_name_key": { + "name": "backgroundSchema_name_key", + "columns": [ + "name" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "backgroundSchema_id": { + "name": "backgroundSchema_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "Badge": { + "name": "Badge", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "varchar(500)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "Badge_name_key": { + "name": "Badge_name_key", + "columns": [ + "name" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "Badge_id": { + "name": "Badge_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "BankTransfers": { + "name": "BankTransfers", + "columns": { + "senderId": { + "name": "senderId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "receiverId": { + "name": "receiverId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "enum('bank','sensei','recruiter')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'bank'" + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "BankTransfers_senderId_idx": { + "name": "BankTransfers_senderId_idx", + "columns": [ + "senderId" + ], + "isUnique": false + }, + "BankTransfers_receiverId_idx": { + "name": "BankTransfers_receiverId_idx", + "columns": [ + "receiverId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "Battle": { + "name": "Battle", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "roundStartAt": { + "name": "roundStartAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "background": { + "name": "background", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "battleType": { + "name": "battleType", + "type": "enum('ARENA','COMBAT','SPARRING','KAGE_CHALLENGE','CLAN_CHALLENGE','CLAN_BATTLE','TOURNAMENT','QUEST','VILLAGE_PROTECTOR','TRAINING')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "usersState": { + "name": "usersState", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "usersEffects": { + "name": "usersEffects", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "groundEffects": { + "name": "groundEffects", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rewardScaling": { + "name": "rewardScaling", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "version": { + "name": "version", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "round": { + "name": "round", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "activeUserId": { + "name": "activeUserId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "Battle_id_version_key": { + "name": "Battle_id_version_key", + "columns": [ + "id", + "version" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "Battle_id": { + "name": "Battle_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "BattleAction": { + "name": "BattleAction", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "battleId": { + "name": "battleId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "battleVersion": { + "name": "battleVersion", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "battleRound": { + "name": "battleRound", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "appliedEffects": { + "name": "appliedEffects", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "BattleAction_round_key": { + "name": "BattleAction_round_key", + "columns": [ + "battleId", + "battleVersion", + "battleRound" + ], + "isUnique": true + }, + "BattleAction_createdAt_idx": { + "name": "BattleAction_createdAt_idx", + "columns": [ + "createdAt" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "BattleAction_id": { + "name": "BattleAction_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "BattleHistory": { + "name": "BattleHistory", + "columns": { + "id": { + "name": "id", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": true + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "battleId": { + "name": "battleId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "battleType": { + "name": "battleType", + "type": "enum('ARENA','COMBAT','SPARRING','KAGE_CHALLENGE','CLAN_CHALLENGE','CLAN_BATTLE','TOURNAMENT','QUEST','VILLAGE_PROTECTOR','TRAINING')", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "attackedId": { + "name": "attackedId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "defenderId": { + "name": "defenderId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "BattleHistory_battleId_idx": { + "name": "BattleHistory_battleId_idx", + "columns": [ + "battleId" + ], + "isUnique": false + }, + "BattleHistory_attackedId_idx": { + "name": "BattleHistory_attackedId_idx", + "columns": [ + "attackedId" + ], + "isUnique": false + }, + "BattleHistory_defenderId_idx": { + "name": "BattleHistory_defenderId_idx", + "columns": [ + "defenderId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "BattleHistory_id": { + "name": "BattleHistory_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "Bid": { + "name": "Bid", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reward": { + "name": "reward", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "startingPrice": { + "name": "startingPrice", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "closureDate": { + "name": "closureDate", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "creatorId": { + "name": "creatorId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "enum('ACTIVE','COMPLETED','CANCELLED')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'ACTIVE'" + }, + "acceptedById": { + "name": "acceptedById", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "Bid_creatorId_idx": { + "name": "Bid_creatorId_idx", + "columns": [ + "creatorId" + ], + "isUnique": false + }, + "Bid_status_idx": { + "name": "Bid_status_idx", + "columns": [ + "status" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "Bid_id": { + "name": "Bid_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "Bloodline": { + "name": "Bloodline", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "statClassification": { + "name": "statClassification", + "type": "enum('Highest','Ninjutsu','Genjutsu','Taijutsu','Bukijutsu')", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "effects": { + "name": "effects", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "regenIncrease": { + "name": "regenIncrease", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "villageId": { + "name": "villageId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "NULL" + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "rank": { + "name": "rank", + "type": "enum('D','C','B','A','S','H')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "hidden": { + "name": "hidden", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + } + }, + "indexes": { + "Bloodline_name_key": { + "name": "Bloodline_name_key", + "columns": [ + "name" + ], + "isUnique": true + }, + "Bloodline_image_key": { + "name": "Bloodline_image_key", + "columns": [ + "image" + ], + "isUnique": true + }, + "Bloodline_village_idx": { + "name": "Bloodline_village_idx", + "columns": [ + "villageId" + ], + "isUnique": false + }, + "Bloodline_rank_idx": { + "name": "Bloodline_rank_idx", + "columns": [ + "rank" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "Bloodline_id": { + "name": "Bloodline_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "BloodlineRolls": { + "name": "BloodlineRolls", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "bloodlineId": { + "name": "bloodlineId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "used": { + "name": "used", + "type": "smallint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "pityRolls": { + "name": "pityRolls", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "type": { + "name": "type", + "type": "enum('NATURAL','ITEM')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'NATURAL'" + }, + "rank": { + "name": "rank", + "type": "enum('D','C','B','A','S','H')", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "BloodlineRolls_userId_idx": { + "name": "BloodlineRolls_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + }, + "BloodlineRolls_bloodlineId_idx": { + "name": "BloodlineRolls_bloodlineId_idx", + "columns": [ + "bloodlineId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "BloodlineRolls_id": { + "name": "BloodlineRolls_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "Captcha": { + "name": "Captcha", + "columns": { + "id": { + "name": "id", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": true + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "captcha": { + "name": "captcha", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3) + INTERVAL 1 DAY )" + }, + "success": { + "name": "success", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "used": { + "name": "used", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + } + }, + "indexes": { + "Captcha_userId_key": { + "name": "Captcha_userId_key", + "columns": [ + "userId" + ], + "isUnique": false + }, + "Captcha_used_idx": { + "name": "Captcha_used_idx", + "columns": [ + "used" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "Captcha_id": { + "name": "Captcha_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "Clan": { + "name": "Clan", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "villageId": { + "name": "villageId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "founderId": { + "name": "founderId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "leaderId": { + "name": "leaderId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "coLeader1": { + "name": "coLeader1", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "coLeader2": { + "name": "coLeader2", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "coLeader3": { + "name": "coLeader3", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "coLeader4": { + "name": "coLeader4", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "leaderOrderId": { + "name": "leaderOrderId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "trainingBoost": { + "name": "trainingBoost", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "ryoBoost": { + "name": "ryoBoost", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "regenBoost": { + "name": "regenBoost", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "points": { + "name": "points", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "bank": { + "name": "bank", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "pvpActivity": { + "name": "pvpActivity", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "Clan_name_key": { + "name": "Clan_name_key", + "columns": [ + "name" + ], + "isUnique": true + }, + "Clan_village_idx": { + "name": "Clan_village_idx", + "columns": [ + "villageId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "Clan_id": { + "name": "Clan_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ConceptImage": { + "name": "ConceptImage", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "status": { + "name": "status", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'started'" + }, + "hidden": { + "name": "hidden", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "prompt": { + "name": "prompt", + "type": "varchar(5000)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "negative_prompt": { + "name": "negative_prompt", + "type": "varchar(5000)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "seed": { + "name": "seed", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 42 + }, + "guidance_scale": { + "name": "guidance_scale", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 4 + }, + "n_likes": { + "name": "n_likes", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "n_loves": { + "name": "n_loves", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "n_laugh": { + "name": "n_laugh", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "n_comments": { + "name": "n_comments", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "description": { + "name": "description", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "done": { + "name": "done", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + } + }, + "indexes": { + "image_avatar_key": { + "name": "image_avatar_key", + "columns": [ + "image" + ], + "isUnique": true + }, + "image_done_idx": { + "name": "image_done_idx", + "columns": [ + "done" + ], + "isUnique": false + }, + "image_userId_idx": { + "name": "image_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ConceptImage_id": { + "name": "ConceptImage_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ContentTag": { + "name": "ContentTag", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "ContentTag_name_key": { + "name": "ContentTag_name_key", + "columns": [ + "name" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ContentTag_id": { + "name": "ContentTag_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "Conversation": { + "name": "Conversation", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdById": { + "name": "createdById", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "isLocked": { + "name": "isLocked", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "isPublic": { + "name": "isPublic", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + } + }, + "indexes": { + "Conversation_title_key": { + "name": "Conversation_title_key", + "columns": [ + "title" + ], + "isUnique": false + }, + "Conversation_createdById_idx": { + "name": "Conversation_createdById_idx", + "columns": [ + "createdById" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "Conversation_id": { + "name": "Conversation_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ConversationComment": { + "name": "ConversationComment", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "conversationId": { + "name": "conversationId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "isPinned": { + "name": "isPinned", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "isReported": { + "name": "isReported", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + } + }, + "indexes": { + "ConversationComment_userId_idx": { + "name": "ConversationComment_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + }, + "ConversationComment_createdAt_idx": { + "name": "ConversationComment_createdAt_idx", + "columns": [ + "createdAt" + ], + "isUnique": false + }, + "ConversationComment_conversationId_idx": { + "name": "ConversationComment_conversationId_idx", + "columns": [ + "conversationId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ConversationComment_id": { + "name": "ConversationComment_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "DamageCalculation": { + "name": "DamageCalculation", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "state": { + "name": "state", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "active": { + "name": "active", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + } + }, + "indexes": { + "DamageCalculation_userId_idx": { + "name": "DamageCalculation_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + }, + "DamageCalculation_createdAt_idx": { + "name": "DamageCalculation_createdAt_idx", + "columns": [ + "createdAt" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "DamageCalculation_id": { + "name": "DamageCalculation_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "DataBattleAction": { + "name": "DataBattleAction", + "columns": { + "id": { + "name": "id", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": true + }, + "type": { + "name": "type", + "type": "enum('jutsu','item','bloodline','basic','ai')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "contentId": { + "name": "contentId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "battleType": { + "name": "battleType", + "type": "enum('ARENA','COMBAT','SPARRING','KAGE_CHALLENGE','CLAN_CHALLENGE','CLAN_BATTLE','TOURNAMENT','QUEST','VILLAGE_PROTECTOR','TRAINING')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "battleWon": { + "name": "battleWon", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "DataBattleActions_contentId_idx": { + "name": "DataBattleActions_contentId_idx", + "columns": [ + "contentId" + ], + "isUnique": false + }, + "DataBattleActions_type": { + "name": "DataBattleActions_type", + "columns": [ + "type" + ], + "isUnique": false + }, + "DataBattleActions_battleWon": { + "name": "DataBattleActions_battleWon", + "columns": [ + "battleWon" + ], + "isUnique": false + }, + "DataBattleActions_battleType": { + "name": "DataBattleActions_battleType", + "columns": [ + "battleType" + ], + "isUnique": false + }, + "DataBattleActions_createdAt": { + "name": "DataBattleActions_createdAt", + "columns": [ + "createdAt" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "DataBattleAction_id": { + "name": "DataBattleAction_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ForumBoard": { + "name": "ForumBoard", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "summary": { + "name": "summary", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "group": { + "name": "group", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "nPosts": { + "name": "nPosts", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "nThreads": { + "name": "nThreads", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + } + }, + "indexes": { + "ForumBoard_name_key": { + "name": "ForumBoard_name_key", + "columns": [ + "name" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ForumBoard_id": { + "name": "ForumBoard_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ForumPost": { + "name": "ForumPost", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "threadId": { + "name": "threadId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "isReported": { + "name": "isReported", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + } + }, + "indexes": { + "ForumPost_userId_idx": { + "name": "ForumPost_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + }, + "ForumPost_threadId_idx": { + "name": "ForumPost_threadId_idx", + "columns": [ + "threadId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ForumPost_id": { + "name": "ForumPost_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ForumThread": { + "name": "ForumThread", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "boardId": { + "name": "boardId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "nPosts": { + "name": "nPosts", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "isPinned": { + "name": "isPinned", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "isLocked": { + "name": "isLocked", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + } + }, + "indexes": { + "ForumThread_boardId_idx": { + "name": "ForumThread_boardId_idx", + "columns": [ + "boardId" + ], + "isUnique": false + }, + "ForumThread_userId_idx": { + "name": "ForumThread_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ForumThread_id": { + "name": "ForumThread_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "GameAsset": { + "name": "GameAsset", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "enum('STATIC','ANIMATION')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "frames": { + "name": "frames", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "speed": { + "name": "speed", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "hidden": { + "name": "hidden", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "licenseDetails": { + "name": "licenseDetails", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "('TNR')" + }, + "createdByUserId": { + "name": "createdByUserId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "onInitialBattleField": { + "name": "onInitialBattleField", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + } + }, + "indexes": { + "GameAsset_type_idx": { + "name": "GameAsset_type_idx", + "columns": [ + "type" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "GameAsset_id": { + "name": "GameAsset_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "GameAssetTag": { + "name": "GameAssetTag", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "assetId": { + "name": "assetId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "tagId": { + "name": "tagId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "GameAssetTag_assetId_tag_key": { + "name": "GameAssetTag_assetId_tag_key", + "columns": [ + "assetId", + "tagId" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "GameAssetTag_id": { + "name": "GameAssetTag_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "GameRule": { + "name": "GameRule", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "varchar(500)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + } + }, + "indexes": { + "name": { + "name": "name", + "columns": [ + "name" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "GameRule_id": { + "name": "GameRule_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "GameSetting": { + "name": "GameSetting", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time": { + "name": "time", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + } + }, + "indexes": { + "name": { + "name": "name", + "columns": [ + "name" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "GameSetting_id": { + "name": "GameSetting_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "HistoricalAvatar": { + "name": "HistoricalAvatar", + "columns": { + "id": { + "name": "id", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": true + }, + "avatar": { + "name": "avatar", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "avatarLight": { + "name": "avatarLight", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "replicateId": { + "name": "replicateId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "status": { + "name": "status", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'started'" + }, + "done": { + "name": "done", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + } + }, + "indexes": { + "HistoricalAvatar_replicateId_key": { + "name": "HistoricalAvatar_replicateId_key", + "columns": [ + "replicateId" + ], + "isUnique": true + }, + "HistoricalAvatar_avatar_key": { + "name": "HistoricalAvatar_avatar_key", + "columns": [ + "avatar" + ], + "isUnique": true + }, + "HistoricalAvatar_done_idx": { + "name": "HistoricalAvatar_done_idx", + "columns": [ + "done" + ], + "isUnique": false + }, + "HistoricalAvatar_userId_idx": { + "name": "HistoricalAvatar_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "HistoricalAvatar_id": { + "name": "HistoricalAvatar_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "Item": { + "name": "Item", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "effects": { + "name": "effects", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "itemType": { + "name": "itemType", + "type": "enum('WEAPON','CONSUMABLE','ARMOR','ACCESSORY','MATERIAL','OTHER')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rarity": { + "name": "rarity", + "type": "enum('COMMON','RARE','EPIC','LEGENDARY')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slot": { + "name": "slot", + "type": "enum('HEAD','CHEST','LEGS','FEET','HAND','ITEM','NONE')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "cooldown": { + "name": "cooldown", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "weaponType": { + "name": "weaponType", + "type": "enum('STAFF','AXE','FIST_WEAPON','SHURIKEN','SICKLE','DAGGER','SWORD','POLEARM','FLAIL','CHAIN','FAN','BOW','HAMMER','NONE')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'NONE'" + }, + "target": { + "name": "target", + "type": "enum('SELF','OTHER_USER','OPPONENT','ALLY','CHARACTER','GROUND','EMPTY_GROUND')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "method": { + "name": "method", + "type": "enum('SINGLE','ALL','AOE_CIRCLE_SPAWN','AOE_LINE_SHOOT','AOE_WALL_SHOOT','AOE_CIRCLE_SHOOT','AOE_SPIRAL_SHOOT')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'SINGLE'" + }, + "cost": { + "name": "cost", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "reputationCost": { + "name": "reputationCost", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "stackSize": { + "name": "stackSize", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "image": { + "name": "image", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "destroyOnUse": { + "name": "destroyOnUse", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "range": { + "name": "range", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "chakraCost": { + "name": "chakraCost", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "staminaCost": { + "name": "staminaCost", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "healthCost": { + "name": "healthCost", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "staminaCostReducePerLvl": { + "name": "staminaCostReducePerLvl", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "chakraCostReducePerLvl": { + "name": "chakraCostReducePerLvl", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "healthCostReducePerLvl": { + "name": "healthCostReducePerLvl", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "actionCostPerc": { + "name": "actionCostPerc", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 60 + }, + "battleDescription": { + "name": "battleDescription", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "('')" + }, + "canStack": { + "name": "canStack", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "inShop": { + "name": "inShop", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "isEventItem": { + "name": "isEventItem", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "hidden": { + "name": "hidden", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "maxEquips": { + "name": "maxEquips", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "preventBattleUsage": { + "name": "preventBattleUsage", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + } + }, + "indexes": { + "Item_name_key": { + "name": "Item_name_key", + "columns": [ + "name" + ], + "isUnique": true + }, + "Item_rarity_idx": { + "name": "Item_rarity_idx", + "columns": [ + "rarity" + ], + "isUnique": false + }, + "Item_itemType_idx": { + "name": "Item_itemType_idx", + "columns": [ + "itemType" + ], + "isUnique": false + }, + "Item_slot_idx": { + "name": "Item_slot_idx", + "columns": [ + "slot" + ], + "isUnique": false + }, + "Item_method_idx": { + "name": "Item_method_idx", + "columns": [ + "method" + ], + "isUnique": false + }, + "Item_target_idx": { + "name": "Item_target_idx", + "columns": [ + "target" + ], + "isUnique": false + }, + "Item_isEventItem_idx": { + "name": "Item_isEventItem_idx", + "columns": [ + "isEventItem" + ], + "isUnique": false + }, + "Item_onlyInShop_idx": { + "name": "Item_onlyInShop_idx", + "columns": [ + "inShop" + ], + "isUnique": false + }, + "Item_cost_idx": { + "name": "Item_cost_idx", + "columns": [ + "cost" + ], + "isUnique": false + }, + "Item_repsCost_idx": { + "name": "Item_repsCost_idx", + "columns": [ + "reputationCost" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "Item_id": { + "name": "Item_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "Jutsu": { + "name": "Jutsu", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "extraBaseCost": { + "name": "extraBaseCost", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "effects": { + "name": "effects", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "target": { + "name": "target", + "type": "enum('SELF','OTHER_USER','OPPONENT','ALLY','CHARACTER','GROUND','EMPTY_GROUND')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "range": { + "name": "range", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "cooldown": { + "name": "cooldown", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "bloodlineId": { + "name": "bloodlineId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "requiredLevel": { + "name": "requiredLevel", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "requiredRank": { + "name": "requiredRank", + "type": "enum('STUDENT','GENIN','CHUNIN','JONIN','COMMANDER','ELDER','NONE')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "jutsuType": { + "name": "jutsuType", + "type": "enum('NORMAL','SPECIAL','BLOODLINE','FORBIDDEN','LOYALTY','CLAN','EVENT','AI')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "jutsuWeapon": { + "name": "jutsuWeapon", + "type": "enum('STAFF','AXE','FIST_WEAPON','SHURIKEN','SICKLE','DAGGER','SWORD','POLEARM','FLAIL','CHAIN','FAN','BOW','HAMMER','NONE')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'NONE'" + }, + "statClassification": { + "name": "statClassification", + "type": "enum('Highest','Ninjutsu','Genjutsu','Taijutsu','Bukijutsu')", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "battleDescription": { + "name": "battleDescription", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "jutsuRank": { + "name": "jutsuRank", + "type": "enum('D','C','B','A','S','H')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'D'" + }, + "actionCostPerc": { + "name": "actionCostPerc", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 80 + }, + "staminaCost": { + "name": "staminaCost", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0.05 + }, + "chakraCost": { + "name": "chakraCost", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0.05 + }, + "staminaCostReducePerLvl": { + "name": "staminaCostReducePerLvl", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "chakraCostReducePerLvl": { + "name": "chakraCostReducePerLvl", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "healthCostReducePerLvl": { + "name": "healthCostReducePerLvl", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "healthCost": { + "name": "healthCost", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "villageId": { + "name": "villageId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "method": { + "name": "method", + "type": "enum('SINGLE','ALL','AOE_CIRCLE_SPAWN','AOE_LINE_SHOOT','AOE_WALL_SHOOT','AOE_CIRCLE_SHOOT','AOE_SPIRAL_SHOOT')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'SINGLE'" + }, + "hidden": { + "name": "hidden", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + } + }, + "indexes": { + "Jutsu_name_key": { + "name": "Jutsu_name_key", + "columns": [ + "name" + ], + "isUnique": true + }, + "Jutsu_image_key": { + "name": "Jutsu_image_key", + "columns": [ + "image" + ], + "isUnique": true + }, + "Jutsu_bloodlineId_idx": { + "name": "Jutsu_bloodlineId_idx", + "columns": [ + "bloodlineId" + ], + "isUnique": false + }, + "Jutsu_villageId_idx": { + "name": "Jutsu_villageId_idx", + "columns": [ + "villageId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "Jutsu_id": { + "name": "Jutsu_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "JutsuLoadout": { + "name": "JutsuLoadout", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "content": { + "name": "content", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "JutsuLoadout_userId_idx": { + "name": "JutsuLoadout_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "JutsuLoadout_id": { + "name": "JutsuLoadout_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "KageDefendedChallenges": { + "name": "KageDefendedChallenges", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "villageId": { + "name": "villageId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "kageId": { + "name": "kageId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "didWin": { + "name": "didWin", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "rounds": { + "name": "rounds", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "VillageKageChallenges_villageId_idx": { + "name": "VillageKageChallenges_villageId_idx", + "columns": [ + "villageId" + ], + "isUnique": false + }, + "VillageKageChallenges_userId_idx": { + "name": "VillageKageChallenges_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + }, + "VillageKageChallenges_kageID_idx": { + "name": "VillageKageChallenges_kageID_idx", + "columns": [ + "kageId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "KageDefendedChallenges_id": { + "name": "KageDefendedChallenges_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "LinkPromotion": { + "name": "LinkPromotion", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "url": { + "name": "url", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "points": { + "name": "points", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "reviewed": { + "name": "reviewed", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "reviewedBy": { + "name": "reviewedBy", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reviewedAt": { + "name": "reviewedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "LinkPromotion_userId_idx": { + "name": "LinkPromotion_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + }, + "LinkPromotion_reviewedBy_idx": { + "name": "LinkPromotion_reviewedBy_idx", + "columns": [ + "reviewedBy" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "LinkPromotion_id": { + "name": "LinkPromotion_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "MpvpBattleQueue": { + "name": "MpvpBattleQueue", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "clan1Id": { + "name": "clan1Id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "clan2Id": { + "name": "clan2Id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "winnerId": { + "name": "winnerId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "battleId": { + "name": "battleId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "MpvpBattleQueue_battleId_idx": { + "name": "MpvpBattleQueue_battleId_idx", + "columns": [ + "battleId" + ], + "isUnique": false + }, + "MpvpBattleQueue_clan1Id_idx": { + "name": "MpvpBattleQueue_clan1Id_idx", + "columns": [ + "clan1Id" + ], + "isUnique": false + }, + "MpvpBattleQueue_clan2Id_idx": { + "name": "MpvpBattleQueue_clan2Id_idx", + "columns": [ + "clan2Id" + ], + "isUnique": false + }, + "MpvpBattleQueue_winnerId_idx": { + "name": "MpvpBattleQueue_winnerId_idx", + "columns": [ + "winnerId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "MpvpBattleQueue_id": { + "name": "MpvpBattleQueue_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "MpvpBattleUser": { + "name": "MpvpBattleUser", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "clanBattleId": { + "name": "clanBattleId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "MpvpBattleUser_clanBattleId_idx": { + "name": "MpvpBattleUser_clanBattleId_idx", + "columns": [ + "clanBattleId" + ], + "isUnique": false + }, + "MpvpBattleUser_userId_idx": { + "name": "MpvpBattleUser_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "MpvpBattleUser_id": { + "name": "MpvpBattleUser_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "Notification": { + "name": "Notification", + "columns": { + "id": { + "name": "id", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": true + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "Notification_createdAt_idx": { + "name": "Notification_createdAt_idx", + "columns": [ + "createdAt" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "Notification_id": { + "name": "Notification_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "PaypalSubscription": { + "name": "PaypalSubscription", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdById": { + "name": "createdById", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "affectedUserId": { + "name": "affectedUserId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "federalStatus": { + "name": "federalStatus", + "type": "enum('NONE','NORMAL','SILVER','GOLD')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "orderId": { + "name": "orderId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscriptionId": { + "name": "subscriptionId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "PaypalSubscription_subscriptionId_key": { + "name": "PaypalSubscription_subscriptionId_key", + "columns": [ + "subscriptionId" + ], + "isUnique": true + }, + "PaypalSubscription_orderId_key": { + "name": "PaypalSubscription_orderId_key", + "columns": [ + "orderId" + ], + "isUnique": true + }, + "PaypalSubscription_createdById_idx": { + "name": "PaypalSubscription_createdById_idx", + "columns": [ + "createdById" + ], + "isUnique": false + }, + "PaypalSubscription_affectedUserId_idx": { + "name": "PaypalSubscription_affectedUserId_idx", + "columns": [ + "affectedUserId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "PaypalSubscription_id": { + "name": "PaypalSubscription_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "PaypalTransaction": { + "name": "PaypalTransaction", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdById": { + "name": "createdById", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "affectedUserId": { + "name": "affectedUserId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "transactionId": { + "name": "transactionId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "transactionUpdatedDate": { + "name": "transactionUpdatedDate", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "orderId": { + "name": "orderId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoiceId": { + "name": "invoiceId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "amount": { + "name": "amount", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "enum('REP_PURCHASE','REFERRAL')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'REP_PURCHASE'" + }, + "reputationPoints": { + "name": "reputationPoints", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "currency": { + "name": "currency", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'USD'" + }, + "status": { + "name": "status", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rawData": { + "name": "rawData", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "PaypalTransaction_orderId_key": { + "name": "PaypalTransaction_orderId_key", + "columns": [ + "orderId" + ], + "isUnique": true + }, + "PaypalTransaction_createdById_idx": { + "name": "PaypalTransaction_createdById_idx", + "columns": [ + "createdById" + ], + "isUnique": false + }, + "PaypalTransaction_affectedUserId_idx": { + "name": "PaypalTransaction_affectedUserId_idx", + "columns": [ + "affectedUserId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "PaypalTransaction_id": { + "name": "PaypalTransaction_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "PaypalWebhookMessage": { + "name": "PaypalWebhookMessage", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "eventType": { + "name": "eventType", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rawData": { + "name": "rawData", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "handled": { + "name": "handled", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "PaypalWebhookMessage_id": { + "name": "PaypalWebhookMessage_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "PlayerShop": { + "name": "PlayerShop", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "ownerId": { + "name": "ownerId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "notice": { + "name": "notice", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "PlayerShop_ownerId_idx": { + "name": "PlayerShop_ownerId_idx", + "columns": [ + "ownerId" + ], + "isUnique": false + }, + "PlayerShop_name_key": { + "name": "PlayerShop_name_key", + "columns": [ + "name" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "PlayerShop_id": { + "name": "PlayerShop_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "Quest": { + "name": "Quest", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "varchar(5000)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "successDescription": { + "name": "successDescription", + "type": "varchar(5000)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "questRank": { + "name": "questRank", + "type": "enum('D','C','B','A','S','H')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'D'" + }, + "requiredLevel": { + "name": "requiredLevel", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "maxLevel": { + "name": "maxLevel", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 100 + }, + "requiredVillage": { + "name": "requiredVillage", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tierLevel": { + "name": "tierLevel", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "timeFrame": { + "name": "timeFrame", + "type": "enum('daily','weekly','monthly','all_time')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "questType": { + "name": "questType", + "type": "enum('mission','crime','event','exam','errand','tier','daily','achievement')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "content": { + "name": "content", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "hidden": { + "name": "hidden", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "consecutiveObjectives": { + "name": "consecutiveObjectives", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "expiresAt": { + "name": "expiresAt", + "type": "date", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "Quest_questType_idx": { + "name": "Quest_questType_idx", + "columns": [ + "questType" + ], + "isUnique": false + }, + "Quest_questRank_idx": { + "name": "Quest_questRank_idx", + "columns": [ + "questRank" + ], + "isUnique": false + }, + "Quest_requiredLevel_idx": { + "name": "Quest_requiredLevel_idx", + "columns": [ + "requiredLevel" + ], + "isUnique": false + }, + "Quest_maxLevel_idx": { + "name": "Quest_maxLevel_idx", + "columns": [ + "maxLevel" + ], + "isUnique": false + }, + "Quest_requiredVillage_idx": { + "name": "Quest_requiredVillage_idx", + "columns": [ + "requiredVillage" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "Quest_id": { + "name": "Quest_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": { + "tierLevel": { + "name": "tierLevel", + "columns": [ + "tierLevel" + ] + } + }, + "checkConstraint": {} + }, + "QuestHistory": { + "name": "QuestHistory", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "questId": { + "name": "questId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "questType": { + "name": "questType", + "type": "enum('mission','crime','event','exam','errand','tier','daily','achievement')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "startedAt": { + "name": "startedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "endedAt": { + "name": "endedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "completed": { + "name": "completed", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "previousCompletes": { + "name": "previousCompletes", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "previousAttempts": { + "name": "previousAttempts", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + } + }, + "indexes": { + "QuestHistory_userId_idx": { + "name": "QuestHistory_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + }, + "QuestHistory_questType_idx": { + "name": "QuestHistory_questType_idx", + "columns": [ + "questType" + ], + "isUnique": false + }, + "QuestHistory_endedAt_idx": { + "name": "QuestHistory_endedAt_idx", + "columns": [ + "endedAt" + ], + "isUnique": false + }, + "QuestHistory_questId_idx": { + "name": "QuestHistory_questId_idx", + "columns": [ + "questId" + ], + "isUnique": false + }, + "QuestHistory_completed_idx": { + "name": "QuestHistory_completed_idx", + "columns": [ + "completed" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "QuestHistory_id": { + "name": "QuestHistory_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ReportLog": { + "name": "ReportLog", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "targetUserId": { + "name": "targetUserId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "staffUserId": { + "name": "staffUserId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "action": { + "name": "action", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "ReportLog_targetUserId_idx": { + "name": "ReportLog_targetUserId_idx", + "columns": [ + "targetUserId" + ], + "isUnique": false + }, + "ReportLog_staffUserId_idx": { + "name": "ReportLog_staffUserId_idx", + "columns": [ + "staffUserId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ReportLog_id": { + "name": "ReportLog_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "RyoTrade": { + "name": "RyoTrade", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "creatorUserId": { + "name": "creatorUserId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "repsForSale": { + "name": "repsForSale", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "requestedRyo": { + "name": "requestedRyo", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "ryoPerRep": { + "name": "ryoPerRep", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "purchaserUserId": { + "name": "purchaserUserId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "allowedPurchaserId": { + "name": "allowedPurchaserId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "RyoTrade_creatorUserId_idx": { + "name": "RyoTrade_creatorUserId_idx", + "columns": [ + "creatorUserId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "RyoTrade_id": { + "name": "RyoTrade_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ShopItem": { + "name": "ShopItem", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "shopId": { + "name": "shopId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "itemId": { + "name": "itemId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "price": { + "name": "price", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "quantity": { + "name": "quantity", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + } + }, + "indexes": { + "ShopItem_shopId_idx": { + "name": "ShopItem_shopId_idx", + "columns": [ + "shopId" + ], + "isUnique": false + }, + "ShopItem_itemId_idx": { + "name": "ShopItem_itemId_idx", + "columns": [ + "itemId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ShopItem_id": { + "name": "ShopItem_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "Tournament": { + "name": "Tournament", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "round": { + "name": "round", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "type": { + "name": "type", + "type": "enum('CLAN')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rewards": { + "name": "rewards", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "startedAt": { + "name": "startedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3) + INTERVAL 1 DAY )" + }, + "roundStartedAt": { + "name": "roundStartedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3) + INTERVAL 1 DAY )" + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "status": { + "name": "status", + "type": "enum('OPEN','IN_PROGRESS','COMPLETED')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'OPEN'" + } + }, + "indexes": { + "Tournament_name_key": { + "name": "Tournament_name_key", + "columns": [ + "name" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "Tournament_id": { + "name": "Tournament_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "TournamentMatch": { + "name": "TournamentMatch", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "tournamentId": { + "name": "tournamentId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "round": { + "name": "round", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "match": { + "name": "match", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "state": { + "name": "state", + "type": "enum('WAITING','PLAYED','NO_SHOW')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'WAITING'" + }, + "winnerId": { + "name": "winnerId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "battleId": { + "name": "battleId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "userId1": { + "name": "userId1", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userId2": { + "name": "userId2", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "startedAt": { + "name": "startedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "TournamentMatch_tournamentId_idx": { + "name": "TournamentMatch_tournamentId_idx", + "columns": [ + "tournamentId" + ], + "isUnique": false + }, + "TournamentMatch_userId1_idx": { + "name": "TournamentMatch_userId1_idx", + "columns": [ + "userId1" + ], + "isUnique": false + }, + "TournamentMatch_userId2_idx": { + "name": "TournamentMatch_userId2_idx", + "columns": [ + "userId2" + ], + "isUnique": false + }, + "TournamentMatch_winnerId_idx": { + "name": "TournamentMatch_winnerId_idx", + "columns": [ + "winnerId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "TournamentMatch_id": { + "name": "TournamentMatch_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "TournamentRecord": { + "name": "TournamentRecord", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "round": { + "name": "round", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "type": { + "name": "type", + "type": "enum('CLAN')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rewards": { + "name": "rewards", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "startedAt": { + "name": "startedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3) + INTERVAL 1 DAY )" + }, + "winnerId": { + "name": "winnerId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "HistoricalTournament_name_key": { + "name": "HistoricalTournament_name_key", + "columns": [ + "name" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "TournamentRecord_id": { + "name": "TournamentRecord_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "TrainingLog": { + "name": "TrainingLog", + "columns": { + "id": { + "name": "id", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": true + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "stat": { + "name": "stat", + "type": "enum('ninjutsuOffence','taijutsuOffence','genjutsuOffence','bukijutsuOffence','ninjutsuDefence','taijutsuDefence','genjutsuDefence','bukijutsuDefence','strength','speed','intelligence','willpower')", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "speed": { + "name": "speed", + "type": "enum('15min','1hr','4hrs','8hrs')", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "trainingFinishedAt": { + "name": "trainingFinishedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "TrainingLog_userId_idx": { + "name": "TrainingLog_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + }, + "TrainingLog_speed_idx": { + "name": "TrainingLog_speed_idx", + "columns": [ + "speed" + ], + "isUnique": false + }, + "TrainingLog_stat_idx": { + "name": "TrainingLog_stat_idx", + "columns": [ + "stat" + ], + "isUnique": false + }, + "TrainingLog_trainingFinishedAt_idx": { + "name": "TrainingLog_trainingFinishedAt_idx", + "columns": [ + "trainingFinishedAt" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "TrainingLog_id": { + "name": "TrainingLog_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "UsersInConversation": { + "name": "UsersInConversation", + "columns": { + "conversationId": { + "name": "conversationId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "assignedAt": { + "name": "assignedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "lastReadAt": { + "name": "lastReadAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "UsersInConversation_userId_idx": { + "name": "UsersInConversation_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "UsersInConversation_conversationId_userId_pk": { + "name": "UsersInConversation_conversationId_userId_pk", + "columns": [ + "conversationId", + "userId" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "UserAssociation": { + "name": "UserAssociation", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userOne": { + "name": "userOne", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userTwo": { + "name": "userTwo", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "associationType": { + "name": "associationType", + "type": "enum('MARRIAGE','DIVORCED')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'MARRIAGE'" + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "UserOne_UserTwo_UserAssociation_key": { + "name": "UserOne_UserTwo_UserAssociation_key", + "columns": [ + "userOne", + "userTwo", + "associationType" + ], + "isUnique": true + }, + "UserAttribute_userOne_idx": { + "name": "UserAttribute_userOne_idx", + "columns": [ + "userOne" + ], + "isUnique": false + }, + "UserAttribute_userTwo_idx": { + "name": "UserAttribute_userTwo_idx", + "columns": [ + "userTwo" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "UserAssociation_id": { + "name": "UserAssociation_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "UserAttribute": { + "name": "UserAttribute", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "attribute": { + "name": "attribute", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "UserAttribute_attribute_userId_key": { + "name": "UserAttribute_attribute_userId_key", + "columns": [ + "attribute", + "userId" + ], + "isUnique": true + }, + "UserAttribute_userId_idx": { + "name": "UserAttribute_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "UserAttribute_id": { + "name": "UserAttribute_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "UserBadge": { + "name": "UserBadge", + "columns": { + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "badgeId": { + "name": "badgeId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "UserBadge_userId_idx": { + "name": "UserBadge_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + }, + "UserBadge_badgeId_idx": { + "name": "UserBadge_badgeId_idx", + "columns": [ + "badgeId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "UserBlackList": { + "name": "UserBlackList", + "columns": { + "id": { + "name": "id", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": true + }, + "creatorUserId": { + "name": "creatorUserId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "targetUserId": { + "name": "targetUserId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "BlackList_creatorUserId_idx": { + "name": "BlackList_creatorUserId_idx", + "columns": [ + "creatorUserId" + ], + "isUnique": false + }, + "BlackList_targetUserId_idx": { + "name": "BlackList_targetUserId_idx", + "columns": [ + "targetUserId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "UserBlackList_id": { + "name": "UserBlackList_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "UserData": { + "name": "UserData", + "columns": { + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "recruiterId": { + "name": "recruiterId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "anbuId": { + "name": "anbuId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "clanId": { + "name": "clanId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "jutsuLoadout": { + "name": "jutsuLoadout", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "nRecruited": { + "name": "nRecruited", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "lastIp": { + "name": "lastIp", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "username": { + "name": "username", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "gender": { + "name": "gender", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "curHealth": { + "name": "curHealth", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 100 + }, + "maxHealth": { + "name": "maxHealth", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 100 + }, + "curChakra": { + "name": "curChakra", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 100 + }, + "maxChakra": { + "name": "maxChakra", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 100 + }, + "curStamina": { + "name": "curStamina", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 100 + }, + "maxStamina": { + "name": "maxStamina", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 100 + }, + "regeneration": { + "name": "regeneration", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 60 + }, + "money": { + "name": "money", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 100 + }, + "bank": { + "name": "bank", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 100 + }, + "experience": { + "name": "experience", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "earnedExperience": { + "name": "earnedExperience", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "rank": { + "name": "rank", + "type": "enum('STUDENT','GENIN','CHUNIN','JONIN','COMMANDER','ELDER','NONE')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'STUDENT'" + }, + "isOutlaw": { + "name": "isOutlaw", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "level": { + "name": "level", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "villageId": { + "name": "villageId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bloodlineId": { + "name": "bloodlineId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "enum('AWAKE','HOSPITALIZED','TRAVEL','BATTLE','QUEUED','ASLEEP')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'AWAKE'" + }, + "strength": { + "name": "strength", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 10 + }, + "intelligence": { + "name": "intelligence", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 10 + }, + "willpower": { + "name": "willpower", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 10 + }, + "speed": { + "name": "speed", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 10 + }, + "ninjutsuOffence": { + "name": "ninjutsuOffence", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 10 + }, + "ninjutsuDefence": { + "name": "ninjutsuDefence", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 10 + }, + "genjutsuOffence": { + "name": "genjutsuOffence", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 10 + }, + "genjutsuDefence": { + "name": "genjutsuDefence", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 10 + }, + "taijutsuOffence": { + "name": "taijutsuOffence", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 10 + }, + "taijutsuDefence": { + "name": "taijutsuDefence", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 10 + }, + "bukijutsuDefence": { + "name": "bukijutsuDefence", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 10 + }, + "bukijutsuOffence": { + "name": "bukijutsuOffence", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 10 + }, + "statsMultiplier": { + "name": "statsMultiplier", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "poolsMultiplier": { + "name": "poolsMultiplier", + "type": "double", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "reputationPoints": { + "name": "reputationPoints", + "type": "float", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 5 + }, + "primaryElement": { + "name": "primaryElement", + "type": "enum('Fire','Water','Wind','Earth','Lightning','Ice','Crystal','Dust','Shadow','Wood','Scorch','Storm','Magnet','Yin-Yang','Lava','Explosion','Light','None')", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "secondaryElement": { + "name": "secondaryElement", + "type": "enum('Fire','Water','Wind','Earth','Lightning','Ice','Crystal','Dust','Shadow','Wood','Scorch','Storm','Magnet','Yin-Yang','Lava','Explosion','Light','None')", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reputationPointsTotal": { + "name": "reputationPointsTotal", + "type": "float", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 5 + }, + "villagePrestige": { + "name": "villagePrestige", + "type": "float", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "federalStatus": { + "name": "federalStatus", + "type": "enum('NONE','NORMAL','SILVER','GOLD')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'NONE'" + }, + "approvedTos": { + "name": "approvedTos", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "avatar": { + "name": "avatar", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "avatarLight": { + "name": "avatarLight", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sector": { + "name": "sector", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "longitude": { + "name": "longitude", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 10 + }, + "latitude": { + "name": "latitude", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 7 + }, + "location": { + "name": "location", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "''" + }, + "joinedVillageAt": { + "name": "joinedVillageAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3) - INTERVAL 7 DAY)" + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "questFinishAt": { + "name": "questFinishAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "activityStreak": { + "name": "activityStreak", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "deletionAt": { + "name": "deletionAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "travelFinishAt": { + "name": "travelFinishAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "isBanned": { + "name": "isBanned", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "isSilenced": { + "name": "isSilenced", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "role": { + "name": "role", + "type": "enum('USER','CODING-ADMIN','CONTENT-ADMIN','MODERATOR-ADMIN','HEAD_MODERATOR','MODERATOR','JR_MODERATOR','CONTENT','EVENT','CODER')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'USER'" + }, + "battleId": { + "name": "battleId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "isAi": { + "name": "isAi", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "isSummon": { + "name": "isSummon", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "isEvent": { + "name": "isEvent", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "inArena": { + "name": "inArena", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "inboxNews": { + "name": "inboxNews", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "regenAt": { + "name": "regenAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "immunityUntil": { + "name": "immunityUntil", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "robImmunityUntil": { + "name": "robImmunityUntil", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "trainingStartedAt": { + "name": "trainingStartedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "trainingSpeed": { + "name": "trainingSpeed", + "type": "enum('15min','1hr','4hrs','8hrs')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'15min'" + }, + "currentlyTraining": { + "name": "currentlyTraining", + "type": "enum('ninjutsuOffence','taijutsuOffence','genjutsuOffence','bukijutsuOffence','ninjutsuDefence','taijutsuDefence','genjutsuDefence','bukijutsuDefence','strength','speed','intelligence','willpower')", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "unreadNotifications": { + "name": "unreadNotifications", + "type": "smallint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "unreadNews": { + "name": "unreadNews", + "type": "smallint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "questData": { + "name": "questData", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "senseiId": { + "name": "senseiId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "medicalExperience": { + "name": "medicalExperience", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "pvpFights": { + "name": "pvpFights", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "pveFights": { + "name": "pveFights", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "pvpActivity": { + "name": "pvpActivity", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "pvpStreak": { + "name": "pvpStreak", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "errands": { + "name": "errands", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "missionsD": { + "name": "missionsD", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "missionsC": { + "name": "missionsC", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "missionsB": { + "name": "missionsB", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "missionsA": { + "name": "missionsA", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "missionsS": { + "name": "missionsS", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "missionsH": { + "name": "missionsH", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "crimesD": { + "name": "crimesD", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "crimesC": { + "name": "crimesC", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "crimesB": { + "name": "crimesB", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "crimesA": { + "name": "crimesA", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "crimesS": { + "name": "crimesS", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "crimesH": { + "name": "crimesH", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "dailyArenaFights": { + "name": "dailyArenaFights", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "dailyMissions": { + "name": "dailyMissions", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "dailyErrands": { + "name": "dailyErrands", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "dailyTrainings": { + "name": "dailyTrainings", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "movedTooFastCount": { + "name": "movedTooFastCount", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "extraItemSlots": { + "name": "extraItemSlots", + "type": "smallint unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "extraJutsuSlots": { + "name": "extraJutsuSlots", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "customTitle": { + "name": "customTitle", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "marriageSlots": { + "name": "marriageSlots", + "type": "int unsigned", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "aiProfileId": { + "name": "aiProfileId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "effects": { + "name": "effects", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "('[]')" + }, + "showBattleDescription": { + "name": "showBattleDescription", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + } + }, + "indexes": { + "UserData_userId_key": { + "name": "UserData_userId_key", + "columns": [ + "userId" + ], + "isUnique": true + }, + "UserData_isAi_idx": { + "name": "UserData_isAi_idx", + "columns": [ + "isAi" + ], + "isUnique": false + }, + "UserData_rank_idx": { + "name": "UserData_rank_idx", + "columns": [ + "rank" + ], + "isUnique": false + }, + "UserData_role_idx": { + "name": "UserData_role_idx", + "columns": [ + "role" + ], + "isUnique": false + }, + "UserData_clanId_idx": { + "name": "UserData_clanId_idx", + "columns": [ + "clanId" + ], + "isUnique": false + }, + "UserData_anbuId_idx": { + "name": "UserData_anbuId_idx", + "columns": [ + "anbuId" + ], + "isUnique": false + }, + "UserData_jutsuLoadout_idx": { + "name": "UserData_jutsuLoadout_idx", + "columns": [ + "jutsuLoadout" + ], + "isUnique": false + }, + "UserData_level_idx": { + "name": "UserData_level_idx", + "columns": [ + "level" + ], + "isUnique": false + }, + "UserData_username_key": { + "name": "UserData_username_key", + "columns": [ + "username" + ], + "isUnique": true + }, + "UserData_bloodlineId_idx": { + "name": "UserData_bloodlineId_idx", + "columns": [ + "bloodlineId" + ], + "isUnique": false + }, + "UserData_villageId_idx": { + "name": "UserData_villageId_idx", + "columns": [ + "villageId" + ], + "isUnique": false + }, + "UserData_battleId_idx": { + "name": "UserData_battleId_idx", + "columns": [ + "battleId" + ], + "isUnique": false + }, + "UserData_status_idx": { + "name": "UserData_status_idx", + "columns": [ + "status" + ], + "isUnique": false + }, + "UserData_sector_idx": { + "name": "UserData_sector_idx", + "columns": [ + "sector" + ], + "isUnique": false + }, + "UserData_senseiId_idx": { + "name": "UserData_senseiId_idx", + "columns": [ + "senseiId" + ], + "isUnique": false + }, + "UserData_latitude_idx": { + "name": "UserData_latitude_idx", + "columns": [ + "latitude" + ], + "isUnique": false + }, + "UserData_longitude_idx": { + "name": "UserData_longitude_idx", + "columns": [ + "longitude" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "UserData_userId": { + "name": "UserData_userId", + "columns": [ + "userId" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "UserItem": { + "name": "UserItem", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "itemId": { + "name": "itemId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "quantity": { + "name": "quantity", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "equipped": { + "name": "equipped", + "type": "enum('HEAD','CHEST','LEGS','FEET','HAND_1','HAND_2','ITEM_1','ITEM_2','ITEM_3','ITEM_4','ITEM_5','ITEM_6','ITEM_7','NONE')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'NONE'" + } + }, + "indexes": { + "UserItem_userId_idx": { + "name": "UserItem_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + }, + "UserItem_itemId_idx": { + "name": "UserItem_itemId_idx", + "columns": [ + "itemId" + ], + "isUnique": false + }, + "UserItem_quantity_idx": { + "name": "UserItem_quantity_idx", + "columns": [ + "quantity" + ], + "isUnique": false + }, + "UserItem_equipped_idx": { + "name": "UserItem_equipped_idx", + "columns": [ + "equipped" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "UserItem_id": { + "name": "UserItem_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "UserJutsu": { + "name": "UserJutsu", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "jutsuId": { + "name": "jutsuId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "level": { + "name": "level", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "experience": { + "name": "experience", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "equipped": { + "name": "equipped", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "finishTraining": { + "name": "finishTraining", + "type": "datetime(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "UserJutsu_userId_jutsuId_key": { + "name": "UserJutsu_userId_jutsuId_key", + "columns": [ + "userId", + "jutsuId" + ], + "isUnique": true + }, + "UserJutsu_jutsuId_idx": { + "name": "UserJutsu_jutsuId_idx", + "columns": [ + "jutsuId" + ], + "isUnique": false + }, + "Jutsu_equipped_idx": { + "name": "Jutsu_equipped_idx", + "columns": [ + "equipped" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "UserJutsu_id": { + "name": "UserJutsu_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "UserLikes": { + "name": "UserLikes", + "columns": { + "type": { + "name": "type", + "type": "enum('like','love','laugh')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "imageId": { + "name": "imageId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "userLikes_userId_idx": { + "name": "userLikes_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + }, + "userLikes_imageId_idx": { + "name": "userLikes_imageId_idx", + "columns": [ + "imageId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "UserNindo": { + "name": "UserNindo", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "UserNindo_userId_idx": { + "name": "UserNindo_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "UserNindo_id": { + "name": "UserNindo_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "UserReport": { + "name": "UserReport", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reporterUserId": { + "name": "reporterUserId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reportedUserId": { + "name": "reportedUserId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "system": { + "name": "system", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "infraction": { + "name": "infraction", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "banEnd": { + "name": "banEnd", + "type": "datetime(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "adminResolved": { + "name": "adminResolved", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "status": { + "name": "status", + "type": "enum('UNVIEWED','REPORT_CLEARED','BAN_ACTIVATED','SILENCE_ACTIVATED','BAN_ESCALATED','SILENCE_ESCALATED','OFFICIAL_WARNING')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'UNVIEWED'" + }, + "aiInterpretation": { + "name": "aiInterpretation", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "predictedStatus": { + "name": "predictedStatus", + "type": "enum('UNVIEWED','REPORT_CLEARED','BAN_ACTIVATED','SILENCE_ACTIVATED','BAN_ESCALATED','SILENCE_ESCALATED','OFFICIAL_WARNING')", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "additionalContext": { + "name": "additionalContext", + "type": "json", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "('[]')" + } + }, + "indexes": { + "UserReport_reporterUserId_idx": { + "name": "UserReport_reporterUserId_idx", + "columns": [ + "reporterUserId" + ], + "isUnique": false + }, + "UserReport_reportedUserId_idx": { + "name": "UserReport_reportedUserId_idx", + "columns": [ + "reportedUserId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "UserReport_id": { + "name": "UserReport_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "UserReportComment": { + "name": "UserReportComment", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reportId": { + "name": "reportId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "decision": { + "name": "decision", + "type": "enum('UNVIEWED','REPORT_CLEARED','BAN_ACTIVATED','SILENCE_ACTIVATED','BAN_ESCALATED','SILENCE_ESCALATED','OFFICIAL_WARNING')", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "isReported": { + "name": "isReported", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + } + }, + "indexes": { + "UserReportComment_userId_idx": { + "name": "UserReportComment_userId_idx", + "columns": [ + "userId" + ], + "isUnique": false + }, + "UserReportComment_reportId_idx": { + "name": "UserReportComment_reportId_idx", + "columns": [ + "reportId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "UserReportComment_id": { + "name": "UserReportComment_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "UserRequest": { + "name": "UserRequest", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "senderId": { + "name": "senderId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "receiverId": { + "name": "receiverId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "enum('PENDING','ACCEPTED','REJECTED','CANCELLED','EXPIRED')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "enum('SPAR','ALLIANCE','SURRENDER','SENSEI','ANBU','CLAN','MARRIAGE')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "UserRequest_createdAt_idx": { + "name": "UserRequest_createdAt_idx", + "columns": [ + "createdAt" + ], + "isUnique": false + }, + "UserRequest_senderId_idx": { + "name": "UserRequest_senderId_idx", + "columns": [ + "senderId" + ], + "isUnique": false + }, + "UserRequest_receiverId_idx": { + "name": "UserRequest_receiverId_idx", + "columns": [ + "receiverId" + ], + "isUnique": false + }, + "UserRequest_type_idx": { + "name": "UserRequest_type_idx", + "columns": [ + "type" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "UserRequest_id": { + "name": "UserRequest_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "UserReview": { + "name": "UserReview", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "authorUserId": { + "name": "authorUserId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "targetUserId": { + "name": "targetUserId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "positive": { + "name": "positive", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "review": { + "name": "review", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "authorIp": { + "name": "authorIp", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "UserReview_authorUserId_idx": { + "name": "UserReview_authorUserId_idx", + "columns": [ + "authorUserId" + ], + "isUnique": false + }, + "UserReview_targetUserId_idx": { + "name": "UserReview_targetUserId_idx", + "columns": [ + "targetUserId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "UserReview_id": { + "name": "UserReview_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "UserRewards": { + "name": "UserRewards", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "awardedById": { + "name": "awardedById", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "receiverId": { + "name": "receiverId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reputationAmount": { + "name": "reputationAmount", + "type": "float", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "moneyAmount": { + "name": "moneyAmount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "UserRewards_awardedById_idx": { + "name": "UserRewards_awardedById_idx", + "columns": [ + "awardedById" + ], + "isUnique": false + }, + "UserRewards_receiverId_idx": { + "name": "UserRewards_receiverId_idx", + "columns": [ + "receiverId" + ], + "isUnique": false + }, + "UserRewards_createdAt_idx": { + "name": "UserRewards_createdAt_idx", + "columns": [ + "createdAt" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "UserRewards_id": { + "name": "UserRewards_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "UserVote": { + "name": "UserVote", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "userId": { + "name": "userId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "topWebGames": { + "name": "topWebGames", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "top100Arena": { + "name": "top100Arena", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "mmoHub": { + "name": "mmoHub", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "arenaTop100": { + "name": "arenaTop100", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "xtremeTop100": { + "name": "xtremeTop100", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "topOnlineMmorpg": { + "name": "topOnlineMmorpg", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "gamesTop200": { + "name": "gamesTop200", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "browserMmorpg": { + "name": "browserMmorpg", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "apexWebGaming": { + "name": "apexWebGaming", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "mmorpg100": { + "name": "mmorpg100", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "claimed": { + "name": "claimed", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "secret": { + "name": "secret", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "lastVoteAt": { + "name": "lastVoteAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + } + }, + "indexes": { + "UserVote_userId_idx": { + "name": "UserVote_userId_idx", + "columns": [ + "userId" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "UserVote_id": { + "name": "UserVote_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "Village": { + "name": "Village", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "mapName": { + "name": "mapName", + "type": "varchar(191)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sector": { + "name": "sector", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "description": { + "name": "description", + "type": "varchar(512)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "kageId": { + "name": "kageId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "tokens": { + "name": "tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "type": { + "name": "type", + "type": "enum('VILLAGE','OUTLAW','SAFEZONE')", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'VILLAGE'" + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "leaderUpdatedAt": { + "name": "leaderUpdatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP(3))" + }, + "hexColor": { + "name": "hexColor", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'#000000'" + }, + "populationCount": { + "name": "populationCount", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "allianceSystem": { + "name": "allianceSystem", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "joinable": { + "name": "joinable", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "pvpDisabled": { + "name": "pvpDisabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "villageLogo": { + "name": "villageLogo", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "villageGraphic": { + "name": "villageGraphic", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + } + }, + "indexes": { + "Village_name_key": { + "name": "Village_name_key", + "columns": [ + "name" + ], + "isUnique": true + }, + "Village_sector_key": { + "name": "Village_sector_key", + "columns": [ + "sector" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "Village_id": { + "name": "Village_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "VillageAlliance": { + "name": "VillageAlliance", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "villageIdA": { + "name": "villageIdA", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "villageIdB": { + "name": "villageIdB", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "enum('NEUTRAL','ALLY','ENEMY')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updatedAt": { + "name": "updatedAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "datetime(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "VillageAlliance_villageIdA_idx": { + "name": "VillageAlliance_villageIdA_idx", + "columns": [ + "villageIdA" + ], + "isUnique": false + }, + "VillageAlliance_villageIdB_idx": { + "name": "VillageAlliance_villageIdB_idx", + "columns": [ + "villageIdB" + ], + "isUnique": false + }, + "VillageAlliance_status_idx": { + "name": "VillageAlliance_status_idx", + "columns": [ + "status" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "VillageAlliance_id": { + "name": "VillageAlliance_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "VillageStructure": { + "name": "VillageStructure", + "columns": { + "id": { + "name": "id", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "route": { + "name": "route", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "image": { + "name": "image", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "villageId": { + "name": "villageId", + "type": "varchar(191)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "longitude": { + "name": "longitude", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 10 + }, + "latitude": { + "name": "latitude", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 10 + }, + "hasPage": { + "name": "hasPage", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "curSp": { + "name": "curSp", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 100 + }, + "maxSp": { + "name": "maxSp", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 100 + }, + "allyAccess": { + "name": "allyAccess", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "baseCost": { + "name": "baseCost", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 10000 + }, + "level": { + "name": "level", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 1 + }, + "maxLevel": { + "name": "maxLevel", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 10 + }, + "anbuSquadsPerLvl": { + "name": "anbuSquadsPerLvl", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "arenaRewardPerLvl": { + "name": "arenaRewardPerLvl", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "bankInterestPerLvl": { + "name": "bankInterestPerLvl", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "blackDiscountPerLvl": { + "name": "blackDiscountPerLvl", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "clansPerLvl": { + "name": "clansPerLvl", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "hospitalSpeedupPerLvl": { + "name": "hospitalSpeedupPerLvl", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "itemDiscountPerLvl": { + "name": "itemDiscountPerLvl", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "patrolsPerLvl": { + "name": "patrolsPerLvl", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "ramenDiscountPerLvl": { + "name": "ramenDiscountPerLvl", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "regenIncreasePerLvl": { + "name": "regenIncreasePerLvl", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "sleepRegenPerLvl": { + "name": "sleepRegenPerLvl", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "structureDiscountPerLvl": { + "name": "structureDiscountPerLvl", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "trainBoostPerLvl": { + "name": "trainBoostPerLvl", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "villageDefencePerLvl": { + "name": "villageDefencePerLvl", + "type": "tinyint", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + } + }, + "indexes": { + "VillageStructure_name_villageId_key": { + "name": "VillageStructure_name_villageId_key", + "columns": [ + "name", + "villageId" + ], + "isUnique": true + }, + "VillageStructure_villageId_idx": { + "name": "VillageStructure_villageId_idx", + "columns": [ + "villageId" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "VillageStructure_id": { + "name": "VillageStructure_id", + "columns": [ + "id" + ] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/app/drizzle/migrations/meta/_journal.json b/app/drizzle/migrations/meta/_journal.json index 3048ef0c..509defba 100644 --- a/app/drizzle/migrations/meta/_journal.json +++ b/app/drizzle/migrations/meta/_journal.json @@ -1331,6 +1331,13 @@ "when": 1738129394570, "tag": "0189_messy_mesmero", "breakpoints": false + }, + { + "idx": 190, + "version": "5", + "when": 1738164219206, + "tag": "0190_swift_green_goblin", + "breakpoints": false } ] } diff --git a/app/drizzle/schema.ts b/app/drizzle/schema.ts index ba57647b..a8f4f92f 100644 --- a/app/drizzle/schema.ts +++ b/app/drizzle/schema.ts @@ -463,6 +463,132 @@ export const clanRelations = relations(clan, ({ one, many }) => ({ }), })); +export const auctionRequests = mysqlTable( + "AuctionRequest", + { + id: varchar("id", { length: 191 }).primaryKey().notNull(), + type: mysqlEnum("type", ["CRAFT", "REPAIR"] as const).notNull(), + details: text("details").notNull(), + price: int("price").notNull(), + creatorId: varchar("creatorId", { length: 191 }).notNull(), + status: mysqlEnum("status", ["PENDING", "ACCEPTED", "COMPLETED"] as const) + .default("PENDING") + .notNull(), + acceptedById: varchar("acceptedById", { length: 191 }), + createdAt: datetime("createdAt", { mode: "date", fsp: 3 }) + .default(sql`(CURRENT_TIMESTAMP(3))`) + .notNull(), + }, + (table) => { + return { + creatorIdIdx: index("AuctionRequest_creatorId_idx").on(table.creatorId), + statusIdx: index("AuctionRequest_status_idx").on(table.status), + }; + }, +); + +export const auctionRequestsRelations = relations(auctionRequests, ({ one }) => ({ + creator: one(userData, { + fields: [auctionRequests.creatorId], + references: [userData.userId], + }), + acceptedBy: one(userData, { + fields: [auctionRequests.acceptedById], + references: [userData.userId], + }), +})); + +export const playerShops = mysqlTable( + "PlayerShop", + { + id: varchar("id", { length: 191 }).primaryKey().notNull(), + name: varchar("name", { length: 191 }).notNull(), + description: text("description").notNull(), + ownerId: varchar("ownerId", { length: 191 }).notNull(), + notice: text("notice"), + createdAt: datetime("createdAt", { mode: "date", fsp: 3 }) + .default(sql`(CURRENT_TIMESTAMP(3))`) + .notNull(), + }, + (table) => { + return { + ownerIdIdx: index("PlayerShop_ownerId_idx").on(table.ownerId), + nameKey: uniqueIndex("PlayerShop_name_key").on(table.name), + }; + }, +); + +export const playerShopsRelations = relations(playerShops, ({ one, many }) => ({ + owner: one(userData, { + fields: [playerShops.ownerId], + references: [userData.userId], + }), + items: many(shopItems), +})); + +export const shopItems = mysqlTable( + "ShopItem", + { + id: varchar("id", { length: 191 }).primaryKey().notNull(), + shopId: varchar("shopId", { length: 191 }).notNull(), + itemId: varchar("itemId", { length: 191 }).notNull(), + price: int("price").notNull(), + quantity: int("quantity").default(1).notNull(), + }, + (table) => { + return { + shopIdIdx: index("ShopItem_shopId_idx").on(table.shopId), + itemIdIdx: index("ShopItem_itemId_idx").on(table.itemId), + }; + }, +); + +export const shopItemsRelations = relations(shopItems, ({ one }) => ({ + shop: one(playerShops, { + fields: [shopItems.shopId], + references: [playerShops.id], + }), +})); + +export const bids = mysqlTable( + "Bid", + { + id: varchar("id", { length: 191 }).primaryKey().notNull(), + name: varchar("name", { length: 191 }).notNull(), + description: text("description").notNull(), + reward: json("reward") + .$type<{ type: "ITEM" | "MATERIAL" | "OTHER"; details: string }>() + .notNull(), + startingPrice: int("startingPrice").notNull(), + closureDate: datetime("closureDate", { mode: "date", fsp: 3 }).notNull(), + creatorId: varchar("creatorId", { length: 191 }).notNull(), + status: mysqlEnum("status", ["ACTIVE", "COMPLETED", "CANCELLED"] as const) + .default("ACTIVE") + .notNull(), + acceptedById: varchar("acceptedById", { length: 191 }), + createdAt: datetime("createdAt", { mode: "date", fsp: 3 }) + .default(sql`(CURRENT_TIMESTAMP(3))`) + .notNull(), + }, + (table) => { + return { + creatorIdIdx: index("Bid_creatorId_idx").on(table.creatorId), + statusIdx: index("Bid_status_idx").on(table.status), + }; + }, +); + +export const bidsRelations = relations(bids, ({ one }) => ({ + creator: one(userData, { + fields: [bids.creatorId], + references: [userData.userId], + }), + acceptedBy: one(userData, { + fields: [bids.acceptedById], + references: [userData.userId], + }), +})); + export const mpvpBattleQueue = mysqlTable( "MpvpBattleQueue", { diff --git a/app/src/app/blackmarket/AuctionHouse.tsx b/app/src/app/blackmarket/AuctionHouse.tsx index 5e6fa7e2..b2cd311d 100644 --- a/app/src/app/blackmarket/AuctionHouse.tsx +++ b/app/src/app/blackmarket/AuctionHouse.tsx @@ -27,13 +27,142 @@ import { api } from "@/app/_trpc/client"; import { showMutationToast } from "@/libs/toast"; import type { UserWithRelations } from "@/server/api/routers/profile"; import type { AuctionRequestType } from "@/types/auction"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { Badge } from "@/components/ui/badge"; +import { ScrollArea } from "@/components/ui/scroll-area"; interface AuctionHouseProps { userData: NonNullable; } +const ShopDetails: React.FC<{ + shopId: string; + onBack: () => void; +}> = ({ shopId, onBack }) => { + const { data: shop } = api.auction.getShop.useQuery({ shopId }); + const { data: items } = api.auction.getShopItems.useQuery({ shopId }); + + if (!shop) { + return ( +
+

Loading shop...

+
+ ); + } + + return ( +
+
+ +

{shop.name}

+
+

{shop.description}

+ {shop.notice && ( +
+

+ {shop.notice} +

+
+ )} +
+ {items?.map((item) => ( + + + {item.name} + + +
+ + Quantity: {item.quantity} + + + {item.price} Ryo + +
+ +
+
+ ))} +
+
+ ); +}; + export default function AuctionHouse({ userData }: AuctionHouseProps) { const [tab, setTab] = useState<"Request" | "Player Shop" | "Bidding Hall">("Request"); + const [selectedShopId, setSelectedShopId] = useState(null); + const isCrafterOrHunter = ["CRAFTER", "HUNTER"].includes(userData.role); + + const { data: requestPages } = api.auction.getRequests.useInfiniteQuery( + { limit: 10 }, + { + getNextPageParam: (lastPage) => lastPage.nextCursor, + } + ); + + const { data: shopPages } = api.auction.getShops.useInfiniteQuery( + { limit: 10 }, + { + getNextPageParam: (lastPage) => lastPage.nextCursor, + } + ); + + const { data: bidPages } = api.auction.getBids.useInfiniteQuery( + { limit: 10 }, + { + getNextPageParam: (lastPage) => lastPage.nextCursor, + } + ); + + const { mutate: acceptRequest } = api.auction.acceptRequest.useMutation({ + onSuccess: async (data) => { + showMutationToast(data); + if (data.success) { + await utils.auction.getRequests.invalidate(); + } + }, + }); + + const { mutate: completeRequest } = api.auction.completeRequest.useMutation({ + onSuccess: async (data) => { + showMutationToast(data); + if (data.success) { + await utils.auction.getRequests.invalidate(); + } + }, + }); + + const { mutate: acceptBid } = api.auction.acceptBid.useMutation({ + onSuccess: async (data) => { + showMutationToast(data); + if (data.success) { + await utils.auction.getBids.invalidate(); + } + }, + }); + + const { mutate: completeBid } = api.auction.completeBid.useMutation({ + onSuccess: async (data) => { + showMutationToast(data); + if (data.success) { + await utils.auction.getBids.invalidate(); + } + }, + }); + + const { mutate: cancelBid } = api.auction.cancelBid.useMutation({ + onSuccess: async (data) => { + showMutationToast(data); + if (data.success) { + await utils.auction.getBids.invalidate(); + } + }, + }); return ( } > - {tab === "Request" && } - {tab === "Player Shop" && } - {tab === "Bidding Hall" && } +
+ {tab === "Request" && ( + + + Browse Requests + Create Request + + + + page.data) ?? []} + onAccept={(id) => acceptRequest({ requestId: id })} + onComplete={(id) => completeRequest({ requestId: id })} + isCrafterOrHunter={isCrafterOrHunter} + /> + + + + + + + )} + {tab === "Player Shop" && ( + <> + {selectedShopId ? ( + setSelectedShopId(null)} + /> + ) : ( + + + Browse Shops + Manage Shop + + + + page.data) ?? []} + onVisit={(id) => setSelectedShopId(id)} + /> + + + + + + + )} + + )} + {tab === "Bidding Hall" && ( + + + Browse Bids + Create Bid + + + + page.data) ?? []} + onAccept={(id) => acceptBid({ bidId: id })} + onComplete={(id) => completeBid({ bidId: id })} + onCancel={(id) => cancelBid({ bidId: id })} + isModerator={["MODERATOR", "ADMIN"].includes(userData.role)} + /> + + + + + + + )} +
); } +const RequestList: React.FC<{ + requests: { + id: string; + type: AuctionRequestType; + details: string; + price: number; + creatorId: string; + status: "PENDING" | "ACCEPTED" | "COMPLETED"; + acceptedById?: string; + createdAt: Date; + }[]; + onAccept: (requestId: string) => void; + onComplete: (requestId: string) => void; + isCrafterOrHunter: boolean; +}> = ({ requests, onAccept, onComplete, isCrafterOrHunter }) => { + return ( +
+ {requests.map((request) => ( +
+
+
+ + {request.type} + + + {request.status} + +
+
+ {new Date(request.createdAt).toLocaleDateString()} +
+
+

+ {request.details} +

+
+
+ {request.price} Ryo +
+
+ {isCrafterOrHunter && request.status === "PENDING" && ( + + )} + {request.status === "ACCEPTED" && + request.acceptedById === request.creatorId && ( + + )} +
+
+
+ ))} +
+ ); +}; + +const ShopList: React.FC<{ + shops: { + id: string; + name: string; + description: string; + ownerId: string; + notice?: string; + createdAt: Date; + }[]; + onVisit: (shopId: string) => void; +}> = ({ shops, onVisit }) => { + return ( +
+ {shops.map((shop) => ( + + + + {shop.name} + + + + +

+ {shop.description} +

+ {shop.notice && ( +
+

+ {shop.notice} +

+
+ )} +
+
+ ))} +
+ ); +}; + +const BidList: React.FC<{ + bids: { + id: string; + name: string; + description: string; + reward: { + type: "ITEM" | "MATERIAL" | "OTHER"; + details: string; + }; + startingPrice: number; + closureDate: Date; + creatorId: string; + status: "ACTIVE" | "COMPLETED" | "CANCELLED"; + acceptedById?: string; + createdAt: Date; + }[]; + onAccept: (bidId: string) => void; + onComplete: (bidId: string) => void; + onCancel: (bidId: string) => void; + isModerator: boolean; +}> = ({ bids, onAccept, onComplete, onCancel, isModerator }) => { + return ( +
+ {bids.map((bid) => ( + + + +
+ {bid.name} + + {bid.status} + +
+
+ Closes {new Date(bid.closureDate).toLocaleDateString()} +
+
+
+ +

+ {bid.description} +

+
+
+ + {bid.reward.type} + + + {bid.reward.details} + +
+
+ {bid.startingPrice} Ryo +
+
+
+ {bid.status === "ACTIVE" && !bid.acceptedById && ( + + )} + {bid.status === "ACTIVE" && bid.acceptedById && ( + + )} + {isModerator && bid.status === "ACTIVE" && ( + + )} +
+
+
+ ))} +
+ ); +}; + const RequestTab: React.FC<{ userData: NonNullable }> = ({ userData, }) => { const utils = api.useUtils(); + const isCrafterOrHunter = ["CRAFTER", "HUNTER"].includes(userData.role); + + const { data: requestPages, fetchNextPage, hasNextPage } = api.auction.getRequests.useInfiniteQuery( + { limit: 10 }, + { + getNextPageParam: (lastPage) => lastPage.nextCursor, + } + ); + + const { mutate: acceptRequest } = api.auction.acceptRequest.useMutation({ + onSuccess: async (data) => { + showMutationToast(data); + if (data.success) { + await utils.auction.getRequests.invalidate(); + } + }, + }); + + const { mutate: completeRequest } = api.auction.completeRequest.useMutation({ + onSuccess: async (data) => { + showMutationToast(data); + if (data.success) { + await utils.auction.getRequests.invalidate(); + } + }, + }); const RequestFormSchema = z.object({ type: z.enum(["CRAFT", "REPAIR"] as const), diff --git a/app/src/server/api/routers/auction.ts b/app/src/server/api/routers/auction.ts index b03d96b3..4ef8755b 100644 --- a/app/src/server/api/routers/auction.ts +++ b/app/src/server/api/routers/auction.ts @@ -5,6 +5,9 @@ import { nanoid } from "nanoid"; import { eq } from "drizzle-orm"; import { auctionRequests, playerShops, shopItems, bids } from "@/drizzle/schema"; +import { and, isNull } from "drizzle-orm"; +import { users } from "@/drizzle/schema"; + export const auctionRouter = createTRPCRouter({ createRequest: protectedProcedure .input( @@ -197,6 +200,47 @@ export const auctionRouter = createTRPCRouter({ }; }), + getShop: protectedProcedure + .input( + z.object({ + shopId: z.string(), + }) + ) + .query(async ({ ctx, input }) => { + const { shopId } = input; + + const shop = await ctx.db.query.playerShops.findFirst({ + where: eq(playerShops.id, shopId), + }); + + if (!shop) { + throw new TRPCError({ + code: "NOT_FOUND", + message: "Shop not found", + }); + } + + return shop; + }), + + getShopItems: protectedProcedure + .input( + z.object({ + shopId: z.string(), + }) + ) + .query(async ({ ctx, input }) => { + const { shopId } = input; + + const items = await ctx.db.query.shopItems.findMany({ + where: eq(shopItems.shopId, shopId), + }); + + // TODO: Load item details from the items table + + return items; + }), + getBids: protectedProcedure .input( z.object({ @@ -226,4 +270,321 @@ export const auctionRouter = createTRPCRouter({ nextCursor, }; }), + + updateShopNotice: protectedProcedure + .input( + z.object({ + notice: z.string().max(500), + }) + ) + .mutation(async ({ ctx, input }) => { + const { notice } = input; + const userId = ctx.auth.userId; + + const shop = await ctx.db.query.playerShops.findFirst({ + where: eq(playerShops.ownerId, userId), + }); + + if (!shop) { + throw new TRPCError({ + code: "NOT_FOUND", + message: "You don't have a shop", + }); + } + + await ctx.db + .update(playerShops) + .set({ notice }) + .where(eq(playerShops.id, shop.id)); + + return { + success: true, + message: "Shop notice updated successfully", + }; + }), + + listItem: protectedProcedure + .input( + z.object({ + itemId: z.string(), + price: z.number().int().min(1), + quantity: z.number().int().min(1), + }) + ) + .mutation(async ({ ctx, input }) => { + const { itemId, price, quantity } = input; + const userId = ctx.auth.userId; + + const shop = await ctx.db.query.playerShops.findFirst({ + where: eq(playerShops.ownerId, userId), + }); + + if (!shop) { + throw new TRPCError({ + code: "NOT_FOUND", + message: "You don't have a shop", + }); + } + + // TODO: Validate if user owns the item and it's tradable + + await ctx.db.insert(shopItems).values({ + id: nanoid(), + shopId: shop.id, + itemId, + price, + quantity, + }); + + return { + success: true, + message: "Item listed successfully", + }; + }), + + removeItem: protectedProcedure + .input( + z.object({ + itemId: z.string(), + }) + ) + .mutation(async ({ ctx, input }) => { + const { itemId } = input; + const userId = ctx.auth.userId; + + const shop = await ctx.db.query.playerShops.findFirst({ + where: eq(playerShops.ownerId, userId), + }); + + if (!shop) { + throw new TRPCError({ + code: "NOT_FOUND", + message: "You don't have a shop", + }); + } + + await ctx.db + .delete(shopItems) + .where( + and(eq(shopItems.shopId, shop.id), eq(shopItems.itemId, itemId)) + ); + + return { + success: true, + message: "Item removed successfully", + }; + }), + + acceptRequest: protectedProcedure + .input( + z.object({ + requestId: z.string(), + }) + ) + .mutation(async ({ ctx, input }) => { + const { requestId } = input; + const userId = ctx.auth.userId; + + // Check if user is a crafter or hunter + const user = await ctx.db.query.users.findFirst({ + where: eq(users.userId, userId), + }); + + if (!user || !["CRAFTER", "HUNTER"].includes(user.role)) { + throw new TRPCError({ + code: "FORBIDDEN", + message: "Only crafters and hunters can accept requests", + }); + } + + const request = await ctx.db.query.auctionRequests.findFirst({ + where: and( + eq(auctionRequests.id, requestId), + eq(auctionRequests.status, "PENDING") + ), + }); + + if (!request) { + throw new TRPCError({ + code: "NOT_FOUND", + message: "Request not found or already accepted", + }); + } + + await ctx.db + .update(auctionRequests) + .set({ + status: "ACCEPTED", + acceptedById: userId, + }) + .where(eq(auctionRequests.id, requestId)); + + return { + success: true, + message: "Request accepted successfully", + }; + }), + + completeRequest: protectedProcedure + .input( + z.object({ + requestId: z.string(), + }) + ) + .mutation(async ({ ctx, input }) => { + const { requestId } = input; + const userId = ctx.auth.userId; + + const request = await ctx.db.query.auctionRequests.findFirst({ + where: and( + eq(auctionRequests.id, requestId), + eq(auctionRequests.status, "ACCEPTED"), + eq(auctionRequests.acceptedById, userId) + ), + }); + + if (!request) { + throw new TRPCError({ + code: "NOT_FOUND", + message: "Request not found or not accepted by you", + }); + } + + await ctx.db + .update(auctionRequests) + .set({ status: "COMPLETED" }) + .where(eq(auctionRequests.id, requestId)); + + // TODO: Handle payment transfer + + return { + success: true, + message: "Request completed successfully", + }; + }), + + acceptBid: protectedProcedure + .input( + z.object({ + bidId: z.string(), + }) + ) + .mutation(async ({ ctx, input }) => { + const { bidId } = input; + const userId = ctx.auth.userId; + + const bid = await ctx.db.query.bids.findFirst({ + where: and( + eq(bids.id, bidId), + eq(bids.status, "ACTIVE"), + isNull(bids.acceptedById) + ), + }); + + if (!bid) { + throw new TRPCError({ + code: "NOT_FOUND", + message: "Bid not found or already accepted", + }); + } + + await ctx.db + .update(bids) + .set({ acceptedById: userId }) + .where(eq(bids.id, bidId)); + + return { + success: true, + message: "Bid accepted successfully", + }; + }), + + completeBid: protectedProcedure + .input( + z.object({ + bidId: z.string(), + }) + ) + .mutation(async ({ ctx, input }) => { + const { bidId } = input; + const userId = ctx.auth.userId; + + const bid = await ctx.db.query.bids.findFirst({ + where: and( + eq(bids.id, bidId), + eq(bids.status, "ACTIVE"), + eq(bids.creatorId, userId) + ), + }); + + if (!bid) { + throw new TRPCError({ + code: "NOT_FOUND", + message: "Bid not found or not created by you", + }); + } + + if (!bid.acceptedById) { + throw new TRPCError({ + code: "BAD_REQUEST", + message: "Bid has not been accepted yet", + }); + } + + await ctx.db + .update(bids) + .set({ status: "COMPLETED" }) + .where(eq(bids.id, bidId)); + + // TODO: Handle payment transfer + + return { + success: true, + message: "Bid completed successfully", + }; + }), + + cancelBid: protectedProcedure + .input( + z.object({ + bidId: z.string(), + }) + ) + .mutation(async ({ ctx, input }) => { + const { bidId } = input; + const userId = ctx.auth.userId; + + // Check if user is a moderator + const user = await ctx.db.query.users.findFirst({ + where: eq(users.userId, userId), + }); + + if (!user || !["MODERATOR", "ADMIN"].includes(user.role)) { + throw new TRPCError({ + code: "FORBIDDEN", + message: "Only moderators can cancel bids", + }); + } + + const bid = await ctx.db.query.bids.findFirst({ + where: eq(bids.id, bidId), + }); + + if (!bid) { + throw new TRPCError({ + code: "NOT_FOUND", + message: "Bid not found", + }); + } + + await ctx.db + .update(bids) + .set({ status: "CANCELLED" }) + .where(eq(bids.id, bidId)); + + return { + success: true, + message: "Bid cancelled successfully", + }; + }), });