Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 30 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
Version000103Date20190907163755 | |
0.00% |
0 / 30 |
|
0.00% |
0 / 3 |
30 | |
0.00% |
0 / 1 |
preSchemaChange | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
changeSchema | |
0.00% |
0 / 28 |
|
0.00% |
0 / 1 |
12 | |||
postSchemaChange | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace OCA\Cospend\Migration; |
6 | |
7 | use Closure; |
8 | use OCP\DB\ISchemaWrapper; |
9 | use OCP\Migration\SimpleMigrationStep; |
10 | use OCP\Migration\IOutput; |
11 | |
12 | /** |
13 | * Auto-generated migration step: Please modify to your needs! |
14 | */ |
15 | class Version000103Date20190907163755 extends SimpleMigrationStep { |
16 | |
17 | /** |
18 | * @param IOutput $output |
19 | * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
20 | * @param array $options |
21 | */ |
22 | public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options) { |
23 | } |
24 | |
25 | /** |
26 | * @param IOutput $output |
27 | * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
28 | * @param array $options |
29 | * @return null|ISchemaWrapper |
30 | */ |
31 | public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
32 | /** @var ISchemaWrapper $schema */ |
33 | $schema = $schemaClosure(); |
34 | |
35 | if (!$schema->hasTable('cospend_categories')) { |
36 | $table = $schema->createTable('cospend_categories'); |
37 | $table->addColumn('id', 'integer', [ |
38 | 'autoincrement' => true, |
39 | 'notnull' => true, |
40 | 'length' => 4, |
41 | ]); |
42 | $table->addColumn('projectid', 'string', [ |
43 | 'notnull' => true, |
44 | 'length' => 64, |
45 | ]); |
46 | $table->addColumn('name', 'string', [ |
47 | 'notnull' => false, |
48 | 'length' => 300, |
49 | ]); |
50 | $table->setPrimaryKey(['id']); |
51 | } |
52 | |
53 | if ($schema->hasTable('cospend_bills')) { |
54 | $table = $schema->getTable('cospend_bills'); |
55 | $table->addColumn('categoryid', 'integer', [ |
56 | 'notnull' => false, |
57 | 'length' => 255 |
58 | ]); |
59 | $table->addColumn('paymentmode', 'string', [ |
60 | 'notnull' => false, |
61 | 'length' => 1 |
62 | ]); |
63 | } |
64 | |
65 | return $schema; |
66 | } |
67 | |
68 | /** |
69 | * @param IOutput $output |
70 | * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
71 | * @param array $options |
72 | */ |
73 | public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) { |
74 | } |
75 | } |