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/20180401083402_create_activity_log.php

32 lines
691 B
PHP

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