/
OroNoteBundle.php
39 lines (36 loc) · 1.36 KB
/
OroNoteBundle.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
namespace Oro\Bundle\NoteBundle\Migrations\Schema\v1_0;
use Doctrine\DBAL\Schema\Schema;
use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
class OroNoteBundle implements Migration
{
/**
* {@inheritDoc}
*/
public function up(Schema $schema, QueryBag $queries): void
{
$table = $schema->createTable('oro_note');
$table->addColumn('id', 'integer', ['autoincrement' => true]);
$table->addColumn('user_owner_id', 'integer', ['notnull' => false]);
$table->addColumn('updated_by_user_id', 'integer', ['notnull' => false]);
$table->addColumn('message', 'text');
$table->addColumn('created_at', 'datetime');
$table->addColumn('updated_at', 'datetime');
$table->setPrimaryKey(['id']);
$table->addIndex(['user_owner_id'], 'IDX_BA066CE19EB185F9');
$table->addIndex(['updated_by_user_id'], 'IDX_BA066CE12793CC5E');
$table->addForeignKeyConstraint(
$schema->getTable('oro_user'),
['user_owner_id'],
['id'],
['onDelete' => 'SET NULL', 'onUpdate' => null]
);
$table->addForeignKeyConstraint(
$schema->getTable('oro_user'),
['updated_by_user_id'],
['id'],
['onDelete' => 'SET NULL', 'onUpdate' => null]
);
}
}