2

Tables (14)

ChatMessage

  • chatMessageId — BIGINT — Primary key — NOT NULL
  • userId — BIGINT — Foreign key → User.userId — NOT NULL
  • chatRoomId — BIGINT — Foreign key → ChatRoom.chatRoomId — NOT NULL
  • type — ENUM('TEXT', 'IMAGE', 'SYSTEM') — NOT NULL
  • detailMessage — TEXT — NOT NULL
  • createTime — DATETIME — NOT NULL

ChatRoom

  • chatRoomId — BIGINT — Primary key — NOT NULL
  • shareId — BIGINT — Foreign key → Share.shareId — NOT NULL
  • buyerId — BIGINT — Foreign key → User.userId — NOT NULL
  • status — ENUM('ACTIVE', 'CLOSED') — NOT NULL
  • createTime — DATETIME — NOT NULL
  • updateTime — DATETIME — NOT NULL

ChatRoomParticipant

  • chatRoomId — BIGINT — Foreign key → ChatRoom.chatRoomId — NOT NULL
  • userId — BIGINT — Foreign key → User.userId — NOT NULL
  • role — ENUM('SELLER', 'BUYER') — NOT NULL
  • lastReadAt — DATETIME
  • createTime — DATETIME — NOT NULL

Ingredient_Master

  • ingredientId — BIGINT — Primary key — NOT NULL
  • ingredientName — VARCHAR(100) — NOT NULL
  • category — VARCHAR(50)
  • storageType — VARCHAR(20)
  • baseUnit — VARCHAR(20)
  • createTime — DATETIME — NOT NULL
  • updateTime — DATETIME — NOT NULL

Ingredients

  • inventoryId — BIGINT — Primary key — NOT NULL
  • userId — BIGINT — Foreign key → User.userId — NOT NULL
  • ingredientId — BIGINT — Foreign key → Ingredient_Master.ingredientId — NOT NULL
  • quantity — DECIMAL(10,2) — NOT NULL
  • unit — VARCHAR(20)
  • purchaseDate — DATE
  • expirationDate — DATE
  • status — ENUM('IN_FRIDGE', 'USED', 'SHARED', 'EXPIRED', 'DELETED') — NOT NULL
  • createTime — DATETIME — NOT NULL
  • updateTime — DATETIME — NOT NULL

Location

  • locationId — BIGINT — Primary key — NOT NULL
  • userId — BIGINT — Foreign key → User.userId — NOT NULL
  • latitude — DECIMAL(10,7)
  • longitude — DECIMAL(10,7)
  • fullAddress — VARCHAR(255)
  • displayAddress — VARCHAR(100)
  • createTime — DATETIME — NOT NULL
  • updateTime — DATETIME — NOT NULL

Recipe

  • recipeId — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • category — VARCHAR(50)
  • cookingMethod — VARCHAR(50)
  • calories — INT
  • imageUrl — VARCHAR(255)
  • createTime — DATETIME — NOT NULL
  • updateTime — DATETIME — NOT NULL

Recipe_Ingredient

  • riId — BIGINT — Primary key — NOT NULL
  • recipeId — BIGINT — Foreign key → Recipe.recipeId — NOT NULL
  • ingredientId — BIGINT — Foreign key → Ingredient_Master.ingredientId — NOT NULL
  • amount — DECIMAL(10,2)
  • unit — VARCHAR(20)

Recipe_Step

  • rsId — BIGINT — Primary key — NOT NULL
  • recipeId — BIGINT — Foreign key → Recipe.recipeId — NOT NULL
  • stepOrder — INT — NOT NULL
  • description — TEXT — NOT NULL
  • createTime — DATETIME — NOT NULL

Report

  • reportId — BIGINT — Primary key — NOT NULL
  • reporterId — BIGINT — Foreign key → User.userId — NOT NULL
  • shareId — BIGINT — Foreign key → Share.shareId — NOT NULL
  • reasonCode — VARCHAR(50) — NOT NULL
  • reasonDetail — TEXT
  • status — ENUM('RECEIVED', 'REVIEWING', 'RESOLVED', 'REJECTED') — NOT NULL
  • handledBy — BIGINT — Foreign key → User.userId
  • resolution — TEXT
  • handledAt — DATETIME
  • createTime — DATETIME — NOT NULL
  • updateTime — DATETIME — NOT NULL

Share

  • shareId — BIGINT — Primary key — NOT NULL
  • userId — BIGINT — Foreign key → User.userId — NOT NULL
  • inventoryId — BIGINT — Foreign key → Ingredients.inventoryId — NOT NULL
  • locationId — BIGINT — Foreign key → Location.locationId
  • title — VARCHAR(255) — NOT NULL
  • content — TEXT
  • ingredientNameSnapshot — VARCHAR(100) — NOT NULL
  • quantitySnapshot — DECIMAL(10,2) — NOT NULL
  • unitSnapshot — VARCHAR(20)
  • expirationDateSnapshot — DATE
  • status — ENUM('PROCEEDING', 'RESERVED', 'COMPLETED', 'DELETED') — NOT NULL
  • createTime — DATETIME — NOT NULL
  • updateTime — DATETIME — NOT NULL

Share_Picture

  • spId — BIGINT — Primary key — NOT NULL
  • shareId — BIGINT — Foreign key → Share.shareId — NOT NULL
  • pictureUrl — VARCHAR(255) — NOT NULL
  • sortOrder — INT — NOT NULL
  • createTime — DATETIME — NOT NULL

User

  • userId — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(100) — NOT NULL
  • passwordHash — VARCHAR(255)
  • nickName — VARCHAR(50) — NOT NULL
  • address — VARCHAR(255)
  • authProvider — ENUM('local', 'kakao', 'google', 'apple') — NOT NULL
  • createTime — DATETIME — NOT NULL
  • updateTime — DATETIME — NOT NULL

User_Preference

  • prefId — BIGINT — Primary key — NOT NULL
  • userId — BIGINT — Foreign key → User.userId — NOT NULL
  • ingredientId — BIGINT — Foreign key → Ingredient_Master.ingredientId
  • preferenceType — ENUM('ALLERGY', 'FAVORITE', 'DISLIKE') — NOT NULL
  • preferenceValue — VARCHAR(100) — NOT NULL
  • createTime — DATETIME — NOT NULL