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.
69 lines
1.5 KiB
69 lines
1.5 KiB
7 years ago
|
<?php
|
||
7 years ago
|
/**
|
||
|
* CodeIgniter-Aauth
|
||
|
*
|
||
|
* Aauth is a User Authorization Library for CodeIgniter 4.x, which aims to make
|
||
|
* easy some essential jobs such as login, permissions and access operations.
|
||
|
* Despite ease of use, it has also very advanced features like groupping,
|
||
|
* access management, public access etc..
|
||
|
*
|
||
|
* @package CodeIgniter-Aauth
|
||
|
* @author Magefly Team
|
||
|
* @copyright 2014-2017 Emre Akay
|
||
|
* @copyright 2018 Magefly
|
||
|
* @license https://opensource.org/licenses/MIT MIT License
|
||
|
* @link https://github.com/magefly/CodeIgniter-Aauth
|
||
|
*/
|
||
|
|
||
7 years ago
|
namespace App\Database\Migrations;
|
||
7 years ago
|
|
||
|
use CodeIgniter\Database\Migration;
|
||
7 years ago
|
use Config\Aauth as AauthConfig;
|
||
7 years ago
|
|
||
7 years ago
|
/**
|
||
|
* Create group to group table
|
||
|
*
|
||
|
* @package CodeIgniter-Aauth
|
||
|
*
|
||
|
* @codeCoverageIgnore
|
||
|
*/
|
||
7 years ago
|
class Migration_create_group_to_group extends Migration
|
||
|
{
|
||
7 years ago
|
/**
|
||
|
* Create Table
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
7 years ago
|
public function up()
|
||
|
{
|
||
|
$config = new AauthConfig();
|
||
|
$this->forge->addField([
|
||
7 years ago
|
'group_id' => [
|
||
|
'type' => 'INT',
|
||
7 years ago
|
'constraint' => 11,
|
||
7 years ago
|
'unsigned' => true,
|
||
7 years ago
|
],
|
||
|
'subgroup_id' => [
|
||
7 years ago
|
'type' => 'INT',
|
||
7 years ago
|
'constraint' => 11,
|
||
7 years ago
|
'unsigned' => true,
|
||
7 years ago
|
],
|
||
7 years ago
|
]);
|
||
7 years ago
|
$this->forge->addKey(['group_id', 'subgroup_id'], true);
|
||
|
$this->forge->createTable($config->dbTableGroupToGroup, true);
|
||
7 years ago
|
}
|
||
|
|
||
|
//--------------------------------------------------------------------
|
||
|
|
||
7 years ago
|
/**
|
||
|
* Drops Table
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
7 years ago
|
public function down()
|
||
|
{
|
||
|
$config = new AauthConfig();
|
||
|
$this->forge->dropTable($config->dbTableGroupToGroup, true);
|
||
|
}
|
||
|
}
|