You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PlexShare/fuel/app/migrations/011_create_user_permission.php

31 lines
1.5 KiB

<?php
namespace Fuel\Migrations;
class Create_user_permission
{
public function up()
{
\DBUtil::create_table('user_permission', array(
'id' => array('type' => 'varchar', 'null' => false, 'constraint' => 36),
'permission_id' => array('type' => 'varchar', 'null' => false, 'constraint' => 36),
'user_id' => array('type' => 'varchar', 'null' => false, 'constraint' => 36),
'library_id' => array('type' => 'varchar', 'null' => true, 'constraint' => 36),
'value' => array('type' => 'varchar', 'null' => false, 'constraint' => 36),
'disable' => array('default' => '0', 'type' => 'int', 'null' => false, 'constraint' => 1),
), array('id'));
\DB::query('CREATE INDEX constraintPermissionUserPermission ON ' . \DB::table_prefix('user_permission') . '(`permission_id`)')->execute();
\DB::query('CREATE INDEX constraintUserUserPermission ON ' . \DB::table_prefix('user_permission') . '(`user_id`)')->execute();
\DB::query('CREATE INDEX constraintLibraryUserPermission ON ' . \DB::table_prefix('user_permission') . '(`library_id`)')->execute();
}
public function down()
{
\DB::query('DROP INDEX constraintPermissionUserPermission ON ' . \DB::table_prefix('user_permission'))->execute();
\DB::query('DROP INDEX constraintUserUserPermission ON ' . \DB::table_prefix('user_permission'))->execute();
\DB::query('DROP INDEX constraintLibraryUserPermission ON ' . \DB::table_prefix('user_permission'))->execute();
\DBUtil::drop_table('user_permission');
}
}