summaryrefslogtreecommitdiffstats
path: root/migrations/20141212101534_create_permissions_table.php
blob: f6d55a6bdf5b59fa4493d4041e1410ef77bb89ef (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 CreatePermissionsTable extends \Psecio\Gatekeeper\PhinxMigration
{
    protected $tableName = 'permissions';

    /**
     * Migrate Up.
     */
    public function up()
    {
        $groups = $this->table($this->getTableName());
        $groups->addColumn('name', 'string', array('limit' => 100))
              ->addColumn('description', 'text')
              ->addColumn('created', 'datetime')
              ->addColumn('updated', 'datetime', array('default' => null))
              ->addIndex(array('name'), array('unique' => true))
              ->save();
    }

    /**
     * Migrate Down.
     */
    public function down()
    {
        $this->dropTable($this->getTableName());
    }
}