Archived
1
0
Fork 0

DB Migration: 20180401083402_create_activity_log.php

This commit is contained in:
Henrik Hautakoski 2018-04-01 10:41:04 +02:00
parent 2b6da6453b
commit 05095a9c8e

View file

@ -0,0 +1,32 @@
<?php
use Phinx\Migration\AbstractMigration;
class CreateActivityLog extends AbstractMigration
{
public function up()
{
$table = $this->table('activity_log');
$table->addColumn('timestamp', 'datetime', [
'default' => 'CURRENT_TIMESTAMP',
'after' => 'email'
]);
$table->addColumn('user_id', 'integer')
->addForeignKey('user_id', 'user', ['id']);
$table->addColumn('ip', 'string', [
'null' => true,
'length' => 50,
]);
$table->addColumn('message', 'string', [
'null' => true,
'length' => 255,
]);
$table->save();
}
}