Archived
1
0
Fork 0
This repository has been archived on 2026-04-03. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
httpcb/app/migrations/20180321133533_create_request_meta_table.php
2023-04-30 16:52:38 +02:00

43 lines
960 B
PHP

<?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();
}
}