src/migrations/20171210103530_create_permission.php
public function change()
    {
        $permissionTable = $this->table('permission', ['signed' => false]);

        $permissionTable->addColumn('name', 'string', ['limit' => 100])
            ->addColumn('status', 'boolean', ['default' => 1])
            ->addColumn('created_at', 'datetime')
            ->addColumn('updated_at', 'datetime', ['null' => true])
            ->addIndex('name', ['name' => 'idx_role_name' ,'unique' => true])
            ->create();
    }
public function change()
    {
        $permissionTable = $this->table('permission', ['signed' => false]);

        $permissionTable->addColumn('name', 'string', ['limit' => 100])
            ->addColumn('status', 'boolean', ['default' => 1])
            ->addColumn('created_at', 'datetime')
            ->addColumn('updated_at', 'datetime', ['null' => true])
            ->addIndex('name', ['name' => 'idx_role_name' ,'unique' => true])
            ->create();
    }
public function change ( ) { $ permissionTable = $ this -> table ( 'permission' , [ 'signed' => false ] ) ; $ permissionTable -> addColumn ( 'name' , 'string' , [ 'limit' => 100 ] ) -> addColumn ( 'status' , 'boolean' , [ 'default' => 1 ] ) -> addColumn ( 'created_at' , 'datetime' ) -> addColumn ( 'updated_at' , 'datetime' , [ 'null' => true ] ) -> addIndex ( 'name' , [ 'name' => 'idx_role_name' , 'unique' => true ] ) -> create ( ) ; }
Create permission table in database.
Field 'name' is unique index.
Create permission table in database . Field name is unique index .