---
# System prepended metadata

title: Untitled

---

#### users

- id INT (11) (AUTO INCREMENT)
- email VARCHAR(255)
- password VARCHAR(255)
- role INT(11) DEFAULT VALUE: 1
- created_at TIMESTAMP
- updated_at TIMESTAMP
- deleted_at TIMESTAMP

---

#### user_profiles
- id INT (11) (AUTO INCREMENT)
- user_id (FK) ~ (users) -> (id)
- address_id (FK) ~ (address) -> (id)
- name VARCHAR(255)
- taxid VARCHAR(20)
- birth TIMESTAMP
- genre INT(3)
- telephone VARCHAR(25)
- cellphone VARCHAR(25)
- updated_at TIMESTAMP
---

#### states

- id INT (11) (AUTO INCREMENT)
- state VARCHAR(130)
- uf VARCHAR(10)

---

####  city

- id INT (11) (AUTO INCREMENT)
- city VARCHAR(130)
- state_id (FK) ~ (states) -> (id)

---

#### address 
- id INT (11) (AUTO INCREMENT)
- city_id (FK) ~ (city) -> (id)
- address VARCHAR(255)
- district VARCHAR(255)
- zipcode VARCHAR(10)
- number VARCHAR(10)
- complement VARCHAR(255)
- reference_point VARCHAR(255)
- billing INT(3)
    - Valor: 1 definir endereço de pagamento
    - Valor: 2 definir como endereço de entrega
    - Valor: 3 Ambos
- updated_at TIMESTAMP
---

#### products

- id INT (11) (AUTO INCREMENT)
- name VARCHAR(255)
- price DECIMAL(13,2)
- description VARCHAR(255)
- quantity INT(11)
- size INT(11)
- type INT(3)
- brand VARCHAR(255)
- weight DECIMAL(5,2)
- created_at TIMESTAMP
- updated_at TIMESTAMP
- deleted_at TIMESTAMP
---

#### colors

- id INT (11) (AUTO INCREMENT)
- name VARCHAR(100)
- color VARCHAR(10)

---

#### product_colors

- id INT (11) (AUTO INCREMENT)
- product_id (FK) ~ (products) -> (id)
- color_id (FK) ~ (colors) -> (id)

---


#### product_images

- id INT (11) (AUTO INCREMENT)
- product_id (FK) ~ (products) -> (id)
- image VARCHAR(255)

---

#### product_discounts

- id INT (11) (AUTO INCREMENT)
- product_id (FK) ~ (products) -> (id)
- discount DECIMAL(5,2)