Running migrations
- Fresh install
- Reset and re-run
- Roll back one batch
- Check status
Migration files
All migration files live indatabase/migrations/. They are listed below in the order Laravel applies them (filename prefix determines execution order).
0001_01_01_000000_create_users_table
Creates: users, password_reset_tokens, sessions
The foundational authentication tables generated by Laravel Breeze. One migration file creates three tables:
users— stores admin accounts (name, email, bcrypt password, email verification timestamp, remember token).password_reset_tokens— ephemeral tokens for the forgot-password flow, keyed by email.sessions— database-backed session storage (user_id, ip_address, user_agent, payload, last_activity).
0001_01_01_000001_create_cache_table
Creates: cache, cache_locks
Required when CACHE_STORE=database (the default). Stores cached values and distributed lock records.
| Column | Type | Notes |
|---|---|---|
key | varchar | Primary key |
value | mediumtext | Serialised cache payload |
expiration | int | Unix timestamp |
cache_locks has the same structure and is used by Laravel’s atomic lock primitives.
0001_01_01_000002_create_jobs_table
Creates: jobs, job_batches, failed_jobs
Required when QUEUE_CONNECTION=database (the default). Three tables handle the full job lifecycle:
jobs— pending jobs (queue name, payload, attempt count, reserved/available timestamps).job_batches— metadata forBus::batch()grouped dispatches (total, pending, failed job counts).failed_jobs— permanent record of failed jobs with their full exception trace for debugging.
2025_12_09_024943_create_personal_access_tokens_table
Creates: personal_access_tokens
Required by Laravel Sanctum for API token authentication. Uses a polymorphic tokenable morph pair so any Eloquent model can issue tokens.
| Column | Type | Notes |
|---|---|---|
id | bigint | Primary key |
tokenable_type | varchar | Morph type |
tokenable_id | bigint | Morph ID |
name | text | Token label |
token | varchar(64) | Hashed token value, unique |
abilities | text | Nullable. JSON-encoded permission list |
last_used_at | timestamp | Nullable |
expires_at | timestamp | Nullable, indexed |
2026_02_22_create_quote_block_categories_table
Creates: quote_block_categories
The first ElCoco domain migration. Establishes the category hierarchy for organising service blocks.
| Column | Type | Default | Notes |
|---|---|---|---|
id | bigint unsigned | — | Auto-increment PK |
name | varchar(255) | — | Category display name |
description | text | null | Optional description |
is_active | tinyint(1) | 1 | Visibility flag |
order | int | 0 | Sort position |
created_at | timestamp | — | — |
updated_at | timestamp | — | — |
2026_03_01_create_quote_blocks_table
Creates: quote_blocks
Individual service items that clients select in the builder. References quote_block_categories with a cascade-on-delete foreign key.
| Column | Type | Default | Notes |
|---|---|---|---|
id | bigint unsigned | — | Auto-increment PK |
name | varchar(255) | — | Block name |
description | text | null | Optional |
category_id | bigint unsigned | — | FK → quote_block_categories.id (cascade) |
base_price | decimal(10,2) | 0.00 | Unit price |
default_hours | int | 0 | Estimated hours |
config | json | null | Key-value extras array |
formula | text | null | Reserved (not yet used) |
validation_rules | json | null | Reserved (not yet used) |
is_active | tinyint(1) | 1 | Visibility flag |
order | int | 0 | Sort within category |
created_at | timestamp | — | — |
updated_at | timestamp | — | — |
category_id, is_active, order
2026_03_02_create_quotes_table
Creates: quotes
The central quote record. One row is created per client submission (or draft save).
| Column | Type | Default | Notes |
|---|---|---|---|
id | bigint unsigned | — | Auto-increment PK |
reference | varchar(255) | — | Unique. Set by model boot(), not migration |
client_name | varchar(255) | — | — |
client_email | varchar(255) | — | — |
client_company | varchar(255) | null | — |
client_phone | varchar(255) | null | — |
project_description | text | null | — |
additional_requirements | text | null | — |
data | json | — | Full builder payload |
subtotal | decimal(12,2) | — | — |
tax | decimal(12,2) | — | — |
total | decimal(12,2) | — | — |
total_hours | int | — | — |
status | enum | draft | draft, sent, accepted, rejected, expired |
sent_at | timestamp | null | — |
pdf_path | varchar(255) | null | Relative public-disk path |
created_at | timestamp | — | — |
updated_at | timestamp | — | — |
reference, client_email, status, created_at
The
reference column has a unique constraint in the migration but its value is generated at the model layer in Quote::boot(), not by a database default. See Database schema for details.2026_03_03_201935_create_quotes_item
Creates: quote_items
Line items belonging to a quote. One row per block added. Both foreign keys cascade on delete.
| Column | Type | Default | Notes |
|---|---|---|---|
id | bigint unsigned | — | Auto-increment PK |
quote_id | bigint unsigned | — | FK → quotes.id (cascade) |
quote_block_id | bigint unsigned | — | FK → quote_blocks.id (cascade) |
name | varchar(255) | — | Snapshot of block name |
description | text | null | Snapshot of block description |
type | varchar(255) | — | Block type (e.g. generic) |
quantity | int | 1 | — |
hours | int | 0 | — |
unit_price | decimal(10,2) | — | — |
total_price | decimal(10,2) | — | — |
data | json | null | Config snapshot |
created_at | timestamp | — | — |
updated_at | timestamp | — | — |
quote_id, quote_block_id
2026_03_03_201938_create_quote_replies_table
Creates: quote_replies
Stores admin replies (meeting confirmations) linked to a quote. Cascade-deletes when the parent quote is deleted.
| Column | Type | Notes |
|---|---|---|
id | bigint unsigned | Auto-increment PK |
quote_id | bigint unsigned | FK → quotes.id (cascade) |
message | text | Nullable. Meeting confirmation message |
sent_to_email | varchar(255) | Nullable. Recipient email |
sent_at | timestamp | Scheduled meeting datetime |
created_at | timestamp | — |
updated_at | timestamp | — |
Migration summary
| Order | File | Tables created |
|---|---|---|
| 1 | 0001_01_01_000000_create_users_table | users, password_reset_tokens, sessions |
| 2 | 0001_01_01_000001_create_cache_table | cache, cache_locks |
| 3 | 0001_01_01_000002_create_jobs_table | jobs, job_batches, failed_jobs |
| 4 | 2025_12_09_024943_create_personal_access_tokens_table | personal_access_tokens |
| 5 | 2026_02_22_create_quote_block_categories_table | quote_block_categories |
| 6 | 2026_03_01_create_quote_blocks_table | quote_blocks |
| 7 | 2026_03_02_create_quotes_table | quotes |
| 8 | 2026_03_03_201935_create_quotes_item | quote_items |
| 9 | 2026_03_03_201938_create_quote_replies_table | quote_replies |