---
# System prepended metadata

title: Omni channel

---

# Omni channel

```sql

Table users {
  id int [pk] // auto-increment
  username varchar[20]
  password string
  full_name varchar[50]
  email varchar
  created_at timestamp
}



Table marketplaces {
  id int [pk]
  name string
  url string
}



Table marketplace_accounts {
  id int [pk]
  user_id int [ref: > users.id]
  marketplace_id int [ref: > marketplaces.id]
  account string
  password string
  displayname string
  status tinyint // 0, 1
  metadata json
  primary key (product_id, name)

}


Table products {
  id int [pk]
  created_at datetime
  updated_at datetime
  category_id int
  province_id int 
  district_id int
  ward_id int
  address varchar
  price int
  title varchar
  description varchar
  params json
  condition tinyint[1]
  user_id int [ref: > users.id]
}



Table product_images {
    image_id string [pk]
    product_id int [ref: > products.id]
    seq_no int
    hide bool
}

Table product_params {
    product_id int [ref: > products.id, pk]
    name string [pk]
    value string
}


Table product_marketplaces {
  id int [pk]
  product_id int [ref: > products.id]
  marketplace_account_id int [ref: > marketplace_accounts.id]
  published_at timestamp
  status tinyint[1]
  metadata json
  product_marketplace_url string
}

Table bump_histories {
    product_marketplace_id int [ref: > product_marketplaces.id]
    bump_at timestamp
}


Table product_histories {
  product_id int [ref: > products.id, pk]
  old_value json
  new_value json
  created_at timestamp
}

```