1. Go to this page and download the library: Download easyswoole/db-migrate 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/ */
use EasySwoole\DDL\Blueprint\Create\Table as CreateTable;
use EasySwoole\DDL\Blueprint\Alter\Table as AlterTable;
use EasySwoole\DDL\Blueprint\Drop\Table as DropTable;
use EasySwoole\DDL\DDLBuilder;
use EasySwoole\DDL\Enum\Character;
use EasySwoole\DDL\Enum\Engine;
/**
* migrate create
* Class User
*/
class User
{
/**
* migrate run
* @return string
*/
public function up()
{
return DDLBuilder::create('User',function (CreateTable $table){
$table->setIfNotExists(true);
});
}
/**
* migrate rollback
* @return string
*/
public function down()
{
return DDLBuilder::dropIfExists('User');
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.