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