adding base db migrations.
This commit is contained in:
parent
3db175d542
commit
bf3d78da00
4 changed files with 134 additions and 0 deletions
39
app/migrations/20180321133533_create_request_meta_table.php
Normal file
39
app/migrations/20180321133533_create_request_meta_table.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
class CreateRequestMetaTable extends AbstractMigration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$table = $this->table('request_meta');
|
||||
|
||||
$table->addColumn('callbackid', 'integer');
|
||||
$table->addForeignKey('callbackid', 'callback', [ 'id' ],
|
||||
[ 'constraint' => 'FK_callback' ]);
|
||||
|
||||
$table->addColumn('source_ip', 'string', [
|
||||
'limit' => 50,
|
||||
'null' => true,
|
||||
]);
|
||||
|
||||
$table->addColumn('method', 'enum', [
|
||||
'null' => false,
|
||||
'default' => 'GET',
|
||||
'values' => [ 'GET', 'POST' ]
|
||||
]);
|
||||
|
||||
$table->addColumn('uri', 'string', [
|
||||
'limit' => 255,
|
||||
'null' => true,
|
||||
]);
|
||||
|
||||
$table->addColumn('timestamp', 'timestamp', [
|
||||
'default' => 'CURRENT_TIMESTAMP',
|
||||
'null' => false,
|
||||
]);
|
||||
|
||||
$table->save();
|
||||
}
|
||||
}
|
||||
Reference in a new issue