blob: b9e5e8b6bdb40777461ff568540a570e6f481e1e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<?php
class CreateUserPermissionTable extends \Psecio\Gatekeeper\PhinxMigration
{
protected $tableName = 'user_permission';
/**
* Migrate Up.
*/
public function up()
{
$permissions = $this->table($this->getTableName());
$permissions->addColumn('permission_id', 'integer')
->addColumn('user_id', 'integer')
->addColumn('created', 'datetime')
->addColumn('updated', 'datetime', array('default' => null))
->addIndex(array('permission_id', 'user_id'), array('unique' => true))
->save();
}
/**
* Migrate Down.
*/
public function down()
{
$this->dropTable($this->getTableName());
}
}
|