Migrations
Apiato migrations are just Laravel Migrations, and they function in the exact same way as Laravel migrations. However, they come with additional rules and conventions specific to Apiato.
To generate new migrations, you may use the apiato:make:migration
interactive command:
php artisan apiato:make:migration
Rules
- All container-specific Migrations MUST be placed in the
app/Containers/{Section}/{Container}/Data/Migrations
directory. - All general Migrations MUST be placed in the
app/Ship/Migrations
directory.
Folder Structure
app
├── Containers
│ └── Section
│ └── Container
│ └── Data
│ └── Migrations
│ ├── 0000_01_01_000001_create_things_table.php
│ └── ...
└── Ship
└── Migrations
├── 0000_02_02_000002_create_another_things_table.php
└── ...
Code Example
Migrations are defined exactly as you would define them in Laravel.
Configuration
Apiato is configured
to load all migration files in the app/Containers/{Section}/{Container}/Data/Migrations
and app/Ship/Migrations
directories.
If the default configuration does not suit your needs, you can customize it via the Apiato Configuration class.