Database
The shared schema, table ownership, and column reference.
ERD
17 business tables; users, products and orders are the hubs.
Data dictionary 16 tables
cart_itemsCart & WishlistGroup 76 columns
app/Modules/Cart/database/migrations/2026_01_02_000400_create_cart_tables.php
| Column | Type | Key | Nullable | Default | Note |
|---|---|---|---|---|---|
id | bigint | PK | No | — | — |
user_id | bigint | FK | No | — | — |
product_id | bigint | FK | No | — | — |
quantity | int | No | — | — | |
created_at | timestamp | No | — | — | |
updated_at | timestamp | No | — | — |
wishlist_itemsCart & WishlistGroup 75 columns
app/Modules/Cart/database/migrations/2026_01_02_000400_create_cart_tables.php
| Column | Type | Key | Nullable | Default | Note |
|---|---|---|---|---|---|
id | bigint | PK | No | — | — |
user_id | bigint | FK | No | — | — |
product_id | bigint | FK | No | — | — |
created_at | timestamp | No | — | — | |
updated_at | timestamp | No | — | — |
stock_movementsInventory & StockGroup 2Two modules8 columns
app/Modules/Inventory/database/migrations/2026_01_02_000800_create_stock_movements_table.php
| Column | Type | Key | Nullable | Default | Note |
|---|---|---|---|---|---|
id | bigint | PK | No | — | — |
product_id | bigint | FK | No | — | — |
order_id | bigint | FK | Yes | — | — |
user_id | bigint | FK | Yes | — | admin who adjusted |
change | int | No | — | negative = out, positive = in | |
reason | string | No | — | sale | cancel | restock | adjustment | |
created_at | timestamp | No | — | — | |
updated_at | timestamp | No | — | — |
notification_logsNotificationsNot assigned in this section9 columns
app/Modules/Notifications/database/migrations/2026_01_02_001000_create_notification_logs_table.php
| Column | Type | Key | Nullable | Default | Note |
|---|---|---|---|---|---|
id | bigint | PK | No | — | — |
user_id | bigint | FK | Yes | — | — |
template | string | No | — | order_placed, payment_confirmed, ... | |
channel | string | No | mail | sms | ||
status | string | No | — | sent | failed | |
data | json | Yes | — | — | |
error | text | Yes | — | — | |
created_at | timestamp | No | — | — | |
updated_at | timestamp | No | — | — |
paymentsPaymentsGroup 110 columns
app/Modules/Payments/database/migrations/2026_01_02_000700_create_payments_table.php
| Column | Type | Key | Nullable | Default | Note |
|---|---|---|---|---|---|
id | bigint | PK | No | — | — |
order_id | bigint | FK | No | — | — |
method | string | No | — | cod | online | |
status | string | No | pending | pending | paid | failed | |
amount | decimal | No | — | — | |
gateway_reference | string | Yes | — | checkout session / payment id from the gateway | |
checkout_url | text | Yes | — | — | |
paid_at | timestamp | Yes | — | — | |
created_at | timestamp | No | — | — | |
updated_at | timestamp | No | — | — |
reviewsReviews & RatingsNot assigned in this section8 columns
app/Modules/Reviews/database/migrations/2026_01_02_001200_create_reviews_table.php
| Column | Type | Key | Nullable | Default | Note |
|---|---|---|---|---|---|
id | bigint | PK | No | — | — |
product_id | bigint | FK | No | — | — |
user_id | bigint | FK | No | — | — |
rating | tinyint | No | — | 1-5 | |
comment | text | Yes | — | — | |
is_approved | boolean | No | true | admin can hide a review | |
created_at | timestamp | No | — | — | |
updated_at | timestamp | No | — | — |
shipping_ratesShipping & TrackingNot assigned in this section6 columns
app/Modules/Shipping/database/migrations/2026_01_02_001100_create_shipping_tables.php
| Column | Type | Key | Nullable | Default | Note |
|---|---|---|---|---|---|
id | bigint | PK | No | — | — |
province | string | Yes | — | most specific match wins | |
region | string | Yes | — | — | |
fee | decimal | No | — | — | |
created_at | timestamp | No | — | — | |
updated_at | timestamp | No | — | — |
shipmentsShipping & TrackingNot assigned in this section9 columns
app/Modules/Shipping/database/migrations/2026_01_02_001100_create_shipping_tables.php
| Column | Type | Key | Nullable | Default | Note |
|---|---|---|---|---|---|
id | bigint | PK | No | — | — |
order_id | bigint | UK | No | — | — |
courier | string | Yes | — | — | |
tracking_number | string | Yes | — | — | |
status | string | No | preparing | preparing | shipped | delivered | |
shipped_at | timestamp | Yes | — | — | |
delivered_at | timestamp | Yes | — | — | |
created_at | timestamp | No | — | — | |
updated_at | timestamp | No | — | — |
addressesUsers & AuthGroup 613 columns
app/Modules/Users/database/migrations/2026_01_02_000100_create_addresses_table.php
| Column | Type | Key | Nullable | Default | Note |
|---|---|---|---|---|---|
id | bigint | PK | No | — | — |
user_id | bigint | FK | No | — | — |
recipient | string | No | — | — | |
phone | string | No | — | — | |
street | string | No | — | — | |
barangay | string | Yes | — | — | |
city | string | No | — | — | |
province | string | No | — | — | |
region | string | Yes | — | Shipping team uses province/region for shipping rates | |
postal_code | string | Yes | — | — | |
is_default | boolean | No | false | — | |
created_at | timestamp | No | — | — | |
updated_at | timestamp | No | — | — |
vouchersVouchers & DiscountsNot assigned in this section11 columns
app/Modules/Vouchers/database/migrations/2026_01_02_000500_create_vouchers_tables.php
| Column | Type | Key | Nullable | Default | Note |
|---|---|---|---|---|---|
id | bigint | PK | No | — | — |
code | string | UK | No | — | — |
type | string | No | fixed | fixed | percent | |
value | decimal | No | — | — | |
min_spend | decimal | No | 0 | — | |
usage_limit | int | Yes | — | null = unlimited | |
used_count | int | No | 0 | — | |
expires_at | timestamp | Yes | — | — | |
is_active | boolean | No | true | — | |
created_at | timestamp | No | — | — | |
updated_at | timestamp | No | — | — |
voucher_redemptionsVouchers & DiscountsNot assigned in this section5 columns
app/Modules/Vouchers/database/migrations/2026_01_02_000500_create_vouchers_tables.php
| Column | Type | Key | Nullable | Default | Note |
|---|---|---|---|---|---|
id | bigint | PK | No | — | — |
voucher_id | bigint | FK | No | — | — |
order_id | bigint | FK | No | — | — |
created_at | timestamp | No | — | — | |
updated_at | timestamp | No | — | — |
usersUsers & AuthGroup 69 columns
database/migrations/0001_01_01_000000_create_users_table.php
| Column | Type | Key | Nullable | Default | Note |
|---|---|---|---|---|---|
id | bigint | PK | No | — | — |
name | string | No | — | — | |
email | string | UK | No | — | — |
email_verified_at | timestamp | Yes | — | — | |
password | string | No | — | — | |
role | string | No | customer | customer | admin | |
remember_token | string | No | — | — | |
created_at | timestamp | No | — | — | |
updated_at | timestamp | No | — | — |
categoriesProduct CatalogGroup 4Two modules6 columns
database/migrations/2026_01_01_000100_create_catalog_tables.php
| Column | Type | Key | Nullable | Default | Note |
|---|---|---|---|---|---|
id | bigint | PK | No | — | — |
name | string | No | — | — | |
slug | string | UK | No | — | — |
parent_id | bigint | FK | Yes | — | — |
created_at | timestamp | No | — | — | |
updated_at | timestamp | No | — | — |
productsProduct CatalogGroup 4Two modules11 columns
database/migrations/2026_01_01_000100_create_catalog_tables.php
| Column | Type | Key | Nullable | Default | Note |
|---|---|---|---|---|---|
id | bigint | PK | No | — | — |
category_id | bigint | FK | No | — | — |
name | string | No | — | — | |
slug | string | UK | No | — | — |
description | text | Yes | — | — | |
price | decimal | No | — | — | |
stock | int | No | 0 | written by Inventory team only | |
image | string | Yes | — | — | |
is_active | boolean | No | true | — | |
created_at | timestamp | No | — | — | |
updated_at | timestamp | No | — | — |
ordersCheckout & OrdersGroup 313 columns
database/migrations/2026_01_01_000200_create_orders_tables.php
| Column | Type | Key | Nullable | Default | Note |
|---|---|---|---|---|---|
id | bigint | PK | No | — | — |
user_id | bigint | FK | No | — | — |
status | string | No | pending | see Order::STATUSES | |
subtotal | decimal | No | — | — | |
discount | decimal | No | 0 | — | |
shipping_fee | decimal | No | 0 | — | |
total | decimal | No | — | — | |
voucher_code | string | Yes | — | — | |
payment_method | string | No | cod | cod | online | |
address_id | bigint | Yes | — | Users team's addresses table | |
shipping_address | text | Yes | — | copy of the address at checkout | |
created_at | timestamp | No | — | — | |
updated_at | timestamp | No | — | — |
order_itemsCheckout & OrdersGroup 38 columns
database/migrations/2026_01_01_000200_create_orders_tables.php
| Column | Type | Key | Nullable | Default | Note |
|---|---|---|---|---|---|
id | bigint | PK | No | — | — |
order_id | bigint | FK | No | — | — |
product_id | bigint | FK | No | — | — |
product_name | string | No | — | copy, so old orders survive product edits | |
quantity | int | No | — | — | |
unit_price | decimal | No | — | — | |
created_at | timestamp | No | — | — | |
updated_at | timestamp | No | — | — |