1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
use Phinx\Migration\AbstractMigration; |
|
|
|
|
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class CreateTokensTable |
9
|
|
|
*/ |
10
|
|
|
final class CreateTokensTable extends AbstractMigration |
11
|
|
|
{ |
12
|
|
|
/** |
13
|
|
|
* Change Method. |
14
|
|
|
* |
15
|
|
|
* Write your reversible migrations using this method. |
16
|
|
|
* |
17
|
|
|
* More information on writing migrations is available here: |
18
|
|
|
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method |
19
|
|
|
* |
20
|
|
|
* Remember to call "create()" or "update()" and NOT "save()" when working |
21
|
|
|
* with the Table class. |
22
|
|
|
*/ |
23
|
|
|
public function change(): void |
24
|
|
|
{ |
25
|
|
|
$table_name = \ByTIC\Payments\Utility\PaymentsModels::tokens()->getTable(); |
26
|
|
|
$exists = $this->hasTable($table_name); |
27
|
|
|
if ($exists) { |
28
|
|
|
return; |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
$table = $this->table($table_name) |
32
|
|
|
->addColumn('id_method', 'biginteger') |
33
|
|
|
->addColumn('gateway', 'string') |
34
|
|
|
->addColumn('customer_id', 'biginteger') |
35
|
|
|
->addColumn('customer_type', 'string') |
36
|
|
|
->addColumn('token_id', 'string') |
37
|
|
|
->addColumn('expiration', 'timestamp') |
38
|
|
|
->addColumn('modified', 'timestamp', [ |
39
|
|
|
'default' => 'CURRENT_TIMESTAMP', |
40
|
|
|
'update' => 'CURRENT_TIMESTAMP', |
41
|
|
|
]) |
42
|
|
|
->addColumn('created', 'timestamp', [ |
43
|
|
|
'default' => 'CURRENT_TIMESTAMP', |
44
|
|
|
]); |
45
|
|
|
|
46
|
|
|
$table->addIndex(['id_method']); |
47
|
|
|
$table->addIndex(['gateway']); |
48
|
|
|
$table->addIndex(['token_id']); |
49
|
|
|
$table->addIndex(['id_method', 'token_id'], ['unique' => true]); |
50
|
|
|
|
51
|
|
|
$table->save(); |
52
|
|
|
} |
53
|
|
|
} |
54
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths