for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Platine\Framework\Migration;
use Platine\Database\Schema\CreateTable;
use Platine\Framework\Migration\AbstractMigration;
class AddUsersTable20210705065248 extends AbstractMigration
{
public function up(): void
//Action when migrate up
$this->create('users', function (CreateTable $table) {
$table->integer('id')
->autoincrement()
->primary();
$table->string('username')
->description('The user username')
->unique()
->notNull();
$table->string('email')
->description('The user email')
$table->string('password')
->description('The user password')
$table->integer('status')
->size('tiny')
->description('The user status')
->defaultValue(0);
$table->integer('age')
->description('The user age');
$table->string('lastname')
->description('The user lastname');
$table->string('firstname')
->description('The user firstname');
$table->datetime('created_at')
->description('created date')
$table->datetime('updated_at')
->description('last updated date');
$table->engine('INNODB');
});
}
public function down(): void
//Action when migrate down
$this->drop('users');