AR Barbería’s database schema is built incrementally through 10 migration files. Each file is timestamped and run in order, so the schema evolves from the core Laravel skeleton tables through the barbershop-specific domain: appointments, workday schedules, services, and a portfolio image gallery. This page documents every migration and the final state of the key tables.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/OswalSnow/AR-Barber/llms.txt
Use this file to discover all available pages before exploring further.
Running migrations
Migration history
The table below lists every migration file, the table it affects, and the columns or changes it introduces.| Migration file | Table(s) affected | Key columns / changes |
|---|---|---|
0001_01_01_000000_create_users_table | users, password_reset_tokens, sessions | users: id, name, email, password, remember_token, timestamps. sessions: id, user_id, payload, last_activity. |
0001_01_01_000001_create_cache_table | cache, cache_locks | cache: key, value, expiration. |
0001_01_01_000002_create_jobs_table | jobs, job_batches, failed_jobs | jobs: id, queue, payload, attempts, reserved_at. failed_jobs: uuid, connection, queue, payload, exception, failed_at. |
2026_03_09_233705_create_appointments_table | appointments | id, customer_name, customer_phone, starts_at, user_id, status (enum: pending/completed/cancelled), timestamps. |
2026_03_09_233715_create_workdays_table | workdays | id, user_id, day, is_open, start_time, end_time, timestamps. |
2026_04_10_044043_add_ends_at_to_appointments_table | appointments | Adds servicio string column (default 'corte') and ends_at datetime column (nullable). |
2026_05_23_192320_add_soft_deletes_to_appointments_table | appointments | Adds deleted_at column (soft deletes). |
2026_05_23_194007_create_services_table | services | id, name, duration_minutes, timestamps. |
2026_05_23_194108_create_appointment_service_table | appointment_service | id, appointment_id (FK → appointments), service_id (FK → services). Cascade delete on both FKs. |
2026_05_24_002851_create_portfolio_images_table | portfolio_images | id, path, timestamps. |
Schema evolution of the appointments table
Theappointments table grew through three separate migrations as requirements expanded:
Initial creation (March 2026)
The first migration created the core booking record with
customer_name, customer_phone, starts_at, user_id (the assigned barber), and status (an enum of pending, completed, cancelled).At this point the appointment had a start time but no end time, no service field, and no mechanism for tracking cancellations without deleting the row.Service type and end time added (April 2026)
A second migration added both
servicio (a string column for the service type, defaulting to 'corte') and ends_at (a nullable datetime). This allowed the booking form to capture which service was requested and enabled the calendar to display appointment blocks with a real duration and prevent double-booking by querying the starts_at/ends_at range.The
servicio column (plain text) predates the services table. The appointment_service pivot table introduced in May 2026 is the foundation for migrating to a structured service catalog. Both columns may coexist during a transition period.The appointment_service pivot table
appointment_service is a many-to-many join table between appointments and services. It allows a single appointment to include multiple services (for example, a haircut and a beard trim), and allows the services table to track a standard catalog with per-service duration_minutes.
This pivot replaces the legacy free-text servicio column as the canonical source of service data.
Final schema: key tables
appointments
| Column | Type | Notes |
|---|---|---|
id | bigint, PK | Auto-increment. |
customer_name | string | Name provided during booking. |
customer_phone | string | Phone number for reminders. |
servicio | string | Legacy plain-text service label. |
starts_at | datetime | Appointment start time. |
ends_at | datetime | Appointment end time (added April 2026). |
user_id | bigint, FK | References users.id (the barber). |
status | enum | Booking status. Allowed values: pending, completed, cancelled. Default: pending. |
deleted_at | datetime, nullable | Soft delete timestamp (added May 2026). |
created_at / updated_at | timestamps | Standard Laravel timestamps. |
workdays
| Column | Type | Notes |
|---|---|---|
id | bigint, PK | Auto-increment. |
user_id | bigint, FK | References users.id (the barber). |
day | date | Calendar date this record applies to (YYYY-MM-DD). |
is_open | boolean | Whether the barber accepts bookings on this day. |
start_time | time | Opening time for the workday. |
end_time | time | Closing time for the workday. |
created_at / updated_at | timestamps | Standard Laravel timestamps. |
users
| Column | Type | Notes |
|---|---|---|
id | bigint, PK | Auto-increment. |
name | string | Display name. |
email | string, unique | Login credential. |
password | string | Hashed password. |
remember_token | string, nullable | Persistent login token. |
created_at / updated_at | timestamps | Standard Laravel timestamps. |