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/20180321131740_create_callback_table.php
2023-04-30 16:52:38 +02:00

36 lines
919 B
PHP

<?php
use Phinx\Migration\AbstractMigration;
class CreateCallbackTable extends AbstractMigration
{
public function up()
{
$table = $this->table('callback');
$table->addColumn('public_id', 'string', [
'length' => 12,
'null' => false,
])->addIndex('public_id', ['name' => 'UNIQUE_public_id', 'unique' => true]);
$table->addColumn('userid', 'integer', [
'null' => true,
])->addForeignKey('userid', 'user', ['id'], ['constraint' => 'FK_user']);
$table->addColumn('name', 'string', [
'length' => 64,
'null' => false,
]);
$table->addColumn('created_at', 'timestamp', [
'default' => 'CURRENT_TIMESTAMP'
]);
$table->addColumn('last_request', 'timestamp', [
'default' => null,
'null' => true
]);
$table->save();
}
}