PHP code example of cubadevops / dbmigrator

1. Go to this page and download the library: Download cubadevops/dbmigrator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cubadevops / dbmigrator example snippets


use CubaDevOps\DbMigrator\domain\Migration;
use Illuminate\Database\Capsule\Manager;
use Illuminate\Database\Schema\Blueprint;

class MigrationTest extends Migration
{

    public function up(): void
    {
        Manager::schema()->create('migration_example_table',function (Blueprint $table){
            $table->increments('id');
            $table->string('content')->default('test');
            // others columns
        });
    }

    public function down(): void
    {
        Manager::schema()->dropIfExists('migration_example_table');
    }
}