work2

Tables (4)

categories

  • id — INTEGER
  • name — TEXT — NOT NULL

comments

  • id — INTEGER
  • restaurant_id — INTEGER — Foreign key → restaurants.id — NOT NULL
  • user_id — INTEGER — Foreign key → users.id — NOT NULL
  • content — TEXT — NOT NULL
  • created_at — DATETIME
  • updated_at — DATETIME

restaurants

  • id — INTEGER
  • user_id — INTEGER — Foreign key → users.id — NOT NULL
  • category_id — INTEGER — Foreign key → categories.id — NOT NULL
  • name — TEXT — NOT NULL
  • address — TEXT — NOT NULL
  • rating — REAL — NOT NULL
  • content — TEXT — NOT NULL
  • views — INTEGER — NOT NULL
  • is_deleted — INTEGER — NOT NULL
  • created_at — DATETIME
  • updated_at — DATETIME

users

  • id — INTEGER
  • username — TEXT — NOT NULL
  • password_hash — TEXT — NOT NULL
  • role — TEXT — NOT NULL
  • created_at — DATETIME
  • updated_at — DATETIME