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.
|
|
|
<?php
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
use 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();
|
|
|
|
}
|
|
|
|
}
|