Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 17 |
ContactsTable | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 17 |
up | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 11 |
|||
down | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 6 |
<?php namespace App\Migrations; | |
use Framework\Database\Definition\Table\TableDefinition; | |
use Framework\Database\Extra\Migration; | |
class ContactsTable extends Migration | |
{ | |
protected $table = 'Contacts'; | |
public function up() | |
{ | |
$this->database->createTable() | |
->table($this->table) | |
->definition(static function (TableDefinition $definition) { | |
$definition->column('id')->int(11)->primaryKey()->autoIncrement(); | |
$definition->column('email')->varchar(255); | |
$definition->column('name')->varchar(32); | |
$definition->column('message')->varchar(1024); | |
$definition->column('createdAt')->datetime(); | |
$definition->column('updatedAt')->datetime(); | |
})->run(); | |
} | |
public function down() | |
{ | |
$this->database->dropTable() | |
->table($this->table) | |
->ifExists() | |
->run(); | |
} | |
} |