StydeNet / enlighten

Enlighten your APIs with auto-generated documentation
MIT License
575 stars 32 forks source link

Add custom migration commands for the enlighten tables #26

Closed jeffochoa closed 4 years ago

jeffochoa commented 4 years ago

This allows us to run the package migrations separately from the app migrations.

It requires to publish the package migrations to the app folder.

php artisan vendor:publish --tag=enlighten-migrations

It also requires to set a new database connection in the config/database.php file:

[
    'enlighten' => [
            'driver' => 'mysql',
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => 'YOUR_ENLIGHTEN_DATABASE_NAME',
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'strict' => true,
            'engine' => null,
        ],
]

Now you'll be able to run the following commands using artisan:

php artisan enlighten:migrate
php artisan enlighten:migrate:fresh