2 changed files with 17 additions and 6 deletions
@ -27,7 +27,7 @@ use Config\Aauth as AauthConfig;
|
||||
* |
||||
* @codeCoverageIgnore |
||||
*/ |
||||
class Migration_create_default_admin extends Migration |
||||
class Migration_create_default_users extends Migration |
||||
{ |
||||
/** |
||||
* Create Table |
||||
@ -38,12 +38,19 @@ class Migration_create_default_admin extends Migration
|
||||
{ |
||||
$config = new AauthConfig(); |
||||
$data = [ |
||||
[ |
||||
'username' => 'admin', |
||||
'email' => '[email protected]', |
||||
'password' => password_hash('password123456', $config->passwordHashAlgo, $config->passwordHashOptions), |
||||
], |
||||
[ |
||||
'username' => 'user', |
||||
'email' => '[email protected]', |
||||
'password' => password_hash('password123456', $config->passwordHashAlgo, $config->passwordHashOptions), |
||||
], |
||||
]; |
||||
|
||||
$this->db->table($config->dbTableUsers)->insert($data); |
||||
$this->db->table($config->dbTableUsers)->insertBatch($data); |
||||
|
||||
$data = [ |
||||
[ |
||||
@ -54,6 +61,10 @@ class Migration_create_default_admin extends Migration
|
||||
'group_id' => 2, |
||||
'user_id' => 1, |
||||
], |
||||
[ |
||||
'group_id' => 2, |
||||
'user_id' => 2, |
||||
], |
||||
]; |
||||
|
||||
$this->db->table($config->dbTableGroupToUser)->insertBatch($data); |
Loading…
Reference in new issue