Skip to content

Commit 27b3ae7

Browse files
committed
- Fix migrations table DBGroup
1 parent f534a6f commit 27b3ae7

File tree

3 files changed

+45
-7
lines changed

3 files changed

+45
-7
lines changed

src/Database/Migrations/2021-10-21-103415_create_rest_server_tables.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,29 @@
33
namespace Daycry\RestServer\Database\Migrations;
44

55
use CodeIgniter\Database\Migration;
6+
use CodeIgniter\Database\Forge;
67

78
class CreateRestServerTables extends Migration
89
{
9-
//protected $DBGroup = 'default';
10+
protected $DBGroup = 'default';
11+
12+
/**
13+
* Constructor.
14+
*
15+
* @param Forge $forge
16+
*/
17+
public function __construct(?Forge $forge = null)
18+
{
19+
$config = $this->_getConfig();
20+
$this->DBGroup = $config->restDatabaseGroup;
21+
22+
parent::__construct($forge);
23+
}
1024

1125
public function up()
1226
{
1327
$config = $this->_getConfig();
1428

15-
$this->DBGroup = $config->restDatabaseGroup;
16-
1729
/*
1830
* Petitions
1931
*/

src/Database/Migrations/2022-04-12-000002_create_attempt_table.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,29 @@
33
namespace Daycry\RestServer\Database\Migrations;
44

55
use CodeIgniter\Database\Migration;
6+
use CodeIgniter\Database\Forge;
67

78
class CreateAttemptTable extends Migration
89
{
9-
//protected $DBGroup = 'default';
10+
protected $DBGroup = 'default';
1011

11-
public function up()
12+
/**
13+
* Constructor.
14+
*
15+
* @param Forge $forge
16+
*/
17+
public function __construct(?Forge $forge = null)
1218
{
1319
$config = $this->_getConfig();
14-
1520
$this->DBGroup = $config->restDatabaseGroup;
1621

22+
parent::__construct($forge);
23+
}
24+
25+
public function up()
26+
{
27+
$config = $this->_getConfig();
28+
1729
/*
1830
* Petitions
1931
*/

src/Database/Migrations/2022-08-18-000003_create_namespace_table.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,24 @@
33
namespace Daycry\RestServer\Database\Migrations;
44

55
use CodeIgniter\Database\Migration;
6+
use CodeIgniter\Database\Forge;
67

78
class CreateNamespaceTable extends Migration
89
{
9-
//protected $DBGroup = 'default';
10+
protected $DBGroup = 'default';
11+
12+
/**
13+
* Constructor.
14+
*
15+
* @param Forge $forge
16+
*/
17+
public function __construct(?Forge $forge = null)
18+
{
19+
$config = $this->_getConfig();
20+
$this->DBGroup = $config->restDatabaseGroup;
21+
22+
parent::__construct($forge);
23+
}
1024

1125
public function up()
1226
{

0 commit comments

Comments
 (0)