Skip to content

Commit 9ad5472

Browse files
author
jerolomb
committed
add migration to fix issue with specific model and specific items in FO, in FO all the items are generic
1 parent 0e1f3ee commit 9ad5472

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
use Phinx\Migration\AbstractMigration;
4+
use Ramsey\Uuid\Uuid;
5+
use Monarc\Core\Model\Entity\Translation;
6+
7+
class FixIssueWithSpecificModel extends AbstractMigration
8+
{
9+
/**
10+
* Change Method.
11+
*
12+
* Write your reversible migrations using this method.
13+
*
14+
* More information on writing migrations is available here:
15+
* https://book.cakephp.org/phinx/0/en/migrations.html
16+
*
17+
* The following commands can be used in this method and Phinx will
18+
* automatically reverse them when rolling back:
19+
*
20+
* createTable
21+
* renameTable
22+
* addColumn
23+
* addCustomColumn
24+
* renameColumn
25+
* addIndex
26+
* addForeignKey
27+
*
28+
* Any other destructive changes will result in an error when trying to
29+
* rollback the migration.
30+
*
31+
* Remember to call "create()" or "update()" and NOT "save()" when working
32+
* with the Table class.
33+
*/
34+
public function change()
35+
{
36+
//force the mode to 0, to only have generic items in FO
37+
$this->execute('UPDATE assets a SET a.mode = 0');
38+
$this->execute('UPDATE threats t SET t.mode = 0');
39+
$this->execute('UPDATE vulnerabilities v SET v.mode = 0');
40+
$this->execute('UPDATE objects o SET o.mode = 0');
41+
}
42+
43+
44+
}

0 commit comments

Comments
 (0)