Mega Creative ships eight migration files that build the complete database schema from scratch. Because theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/keving5726/megacreative/llms.txt
Use this file to discover all available pages before exploring further.
estudiantes table declares six foreign keys that point at earlier tables, the migration files must execute in a strict order — running them out of sequence will cause a foreign key constraint failure. Artisan handles this automatically by running migrations in filename-timestamp order.
Running Migrations
Configure your database connection
Open your
.env file and confirm the MySQL connection variables are set correctly:Run all pending migrations
From the project root, execute:Artisan reads the
migrations table (creating it on first run), identifies which files have not yet run, and executes them in ascending timestamp order. All eight tables are created in a single command.Migration Files
The eight files are listed below in the exact order Artisan executes them. Dependencies between tables are noted where they exist.| # | File | Creates | Depends on |
|---|---|---|---|
| 1 | 2019_08_19_000000_create_failed_jobs_table | failed_jobs — Laravel queue failure log | — |
| 2 | 2019_09_09_171010_create_statuses_table | statuses — enrollment / program status lookup | — |
| 3 | 2019_09_09_171011_create_sexos_table | sexos — sex options lookup | — |
| 4 | 2019_09_09_171012_create_carreras_table | carreras — academic programs | statuses |
| 5 | 2019_09_09_171013_create_paises_table | paises — countries lookup | — |
| 6 | 2019_09_09_171014_create_estados_table | estados — states / provinces lookup | — |
| 7 | 2019_09_09_171015_create_ciudades_table | ciudades — cities lookup | — |
| 8 | 2019_09_09_171016_create_estudiantes_table | estudiantes — student records | sexos, carreras, statuses, paises, estados, ciudades |
Rolling Back
Laravel provides several Artisan commands for rolling back or resetting the schema during development.migrate:rollback only reverses the last batch, which may be fewer than all eight migrations if you ran them in multiple batches. Use migrate:fresh during local development when you want a guaranteed clean slate. Avoid migrate:fresh on any database that holds real data — it drops every table unconditionally.The CreateEstudiantesTable Migration
The most complex migration is the one forestudiantes. It defines all six foreign key constraints and the unique index on email. The full up() method is reproduced below exactly as it appears in the source:
carrera_id is the only foreign key declared with ->onDelete('cascade'). All other foreign keys use MySQL’s default behaviour (RESTRICT), which prevents deletion of a referenced row while child rows exist.