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.
37 lines
753 B
37 lines
753 B
7 years ago
|
<?php namespace Magefly\Aauth\Database\Migrations;
|
||
|
|
||
|
use CodeIgniter\Database\Migration;
|
||
|
use Magefly\Aauth\Config\Aauth as AauthConfig;
|
||
|
|
||
|
class Migration_create_default_groups extends Migration
|
||
|
{
|
||
|
public function up()
|
||
|
{
|
||
|
$config = new AauthConfig();
|
||
|
|
||
|
$data = [
|
||
|
[
|
||
|
'name' => $config->adminGroup,
|
||
|
'definition' => 'Administators',
|
||
|
],
|
||
|
[
|
||
|
'name' => $config->defaultGroup,
|
||
|
'definition' => 'Users',
|
||
|
],
|
||
|
[
|
||
|
'name' => $config->publicGroup,
|
||
|
'definition' => 'Guests',
|
||
|
],
|
||
|
];
|
||
|
|
||
|
$this->db->table($config->dbTableGroups)->insertBatch($data);
|
||
|
}
|
||
|
|
||
|
//--------------------------------------------------------------------
|
||
|
|
||
|
public function down()
|
||
|
{
|
||
|
$this->db->table($config->dbTableGroups)->truncate();
|
||
|
}
|
||
|
}
|