@@ 9-72 (lines=64) @@ | ||
6 | * Handles the creation of table `user_has_flow`. |
|
7 | */ |
|
8 | // @codingStandardsIgnoreLine |
|
9 | class m161031_093304_create_user_has_flow_table extends Migration |
|
10 | { |
|
11 | /** |
|
12 | * {@inheritdoc} |
|
13 | */ |
|
14 | public function up() |
|
15 | { |
|
16 | $tableOptions = null; |
|
17 | if ($this->db->driverName === 'mysql') { |
|
18 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; |
|
19 | } |
|
20 | ||
21 | $this->createTable('user_has_flow', [ |
|
22 | 'user_username' => $this->string(64)->notNull(), |
|
23 | 'flow_id' => $this->integer()->notNull(), |
|
24 | ], $tableOptions); |
|
25 | ||
26 | $this->addPrimaryKey( |
|
27 | 'pk_user_has_flow', |
|
28 | 'user_has_flow', |
|
29 | ['user_username', 'flow_id'] |
|
30 | ); |
|
31 | ||
32 | $this->createIndex( |
|
33 | 'fk_user_has_flow_flow1_idx', |
|
34 | 'user_has_flow', |
|
35 | 'flow_id' |
|
36 | ); |
|
37 | ||
38 | $this->createIndex( |
|
39 | 'fk_user_has_flow_user1_idx', |
|
40 | 'user_has_flow', |
|
41 | 'user_username' |
|
42 | ); |
|
43 | ||
44 | $this->addForeignKey( |
|
45 | 'fk_user_has_flow_user1', |
|
46 | 'user_has_flow', |
|
47 | 'user_username', |
|
48 | 'user', |
|
49 | 'username', |
|
50 | 'CASCADE', |
|
51 | 'CASCADE' |
|
52 | ); |
|
53 | ||
54 | $this->addForeignKey( |
|
55 | 'fk_user_has_flow_flow1', |
|
56 | 'user_has_flow', |
|
57 | 'flow_id', |
|
58 | 'flow', |
|
59 | 'id', |
|
60 | 'CASCADE', |
|
61 | 'CASCADE' |
|
62 | ); |
|
63 | } |
|
64 | ||
65 | /** |
|
66 | * {@inheritdoc} |
|
67 | */ |
|
68 | public function down() |
|
69 | { |
|
70 | $this->dropTable('user_has_flow'); |
|
71 | } |
|
72 | } |
|
73 |
@@ 9-72 (lines=64) @@ | ||
6 | * Handles the creation of table `field_has_content_type`. |
|
7 | */ |
|
8 | // @codingStandardsIgnoreLine |
|
9 | class m161031_104822_create_field_has_content_type_table extends Migration |
|
10 | { |
|
11 | /** |
|
12 | * {@inheritdoc} |
|
13 | */ |
|
14 | public function up() |
|
15 | { |
|
16 | $tableOptions = null; |
|
17 | if ($this->db->driverName === 'mysql') { |
|
18 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; |
|
19 | } |
|
20 | ||
21 | $this->createTable('field_has_content_type', [ |
|
22 | 'field_id' => $this->integer()->notNull(), |
|
23 | 'content_type_id' => $this->string(64)->notNull(), |
|
24 | ], $tableOptions); |
|
25 | ||
26 | $this->addPrimaryKey( |
|
27 | 'pk_field_has_content_type', |
|
28 | 'field_has_content_type', |
|
29 | ['field_id', 'content_type_id'] |
|
30 | ); |
|
31 | ||
32 | $this->createIndex( |
|
33 | 'fk_field_has_content_type_field1_idx', |
|
34 | 'field_has_content_type', |
|
35 | 'field_id' |
|
36 | ); |
|
37 | ||
38 | $this->createIndex( |
|
39 | 'fk_field_has_content_type_content_type1_idx', |
|
40 | 'field_has_content_type', |
|
41 | 'content_type_id' |
|
42 | ); |
|
43 | ||
44 | $this->addForeignKey( |
|
45 | 'fk_field_has_content_type_field1', |
|
46 | 'field_has_content_type', |
|
47 | 'field_id', |
|
48 | 'field', |
|
49 | 'id', |
|
50 | 'CASCADE', |
|
51 | 'CASCADE' |
|
52 | ); |
|
53 | ||
54 | $this->addForeignKey( |
|
55 | 'fk_field_has_content_type_content_type1', |
|
56 | 'field_has_content_type', |
|
57 | 'content_type_id', |
|
58 | 'content_type', |
|
59 | 'id', |
|
60 | 'CASCADE', |
|
61 | 'CASCADE' |
|
62 | ); |
|
63 | } |
|
64 | ||
65 | /** |
|
66 | * {@inheritdoc} |
|
67 | */ |
|
68 | public function down() |
|
69 | { |
|
70 | $this->dropTable('field_has_content_type'); |
|
71 | } |
|
72 | } |
|
73 |
@@ 9-72 (lines=64) @@ | ||
6 | * Handles the creation of table `device_has_screen`. |
|
7 | */ |
|
8 | // @codingStandardsIgnoreLine |
|
9 | class m161031_110401_create_device_has_screen_table extends Migration |
|
10 | { |
|
11 | /** |
|
12 | * {@inheritdoc} |
|
13 | */ |
|
14 | public function up() |
|
15 | { |
|
16 | $tableOptions = null; |
|
17 | if ($this->db->driverName === 'mysql') { |
|
18 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; |
|
19 | } |
|
20 | ||
21 | $this->createTable('device_has_screen', [ |
|
22 | 'device_id' => $this->integer()->notNull(), |
|
23 | 'screen_id' => $this->integer()->notNull(), |
|
24 | ], $tableOptions); |
|
25 | ||
26 | $this->addPrimaryKey( |
|
27 | 'pk_device_has_screen', |
|
28 | 'device_has_screen', |
|
29 | ['device_id', 'screen_id'] |
|
30 | ); |
|
31 | ||
32 | $this->createIndex( |
|
33 | 'fk_device_has_screen_screen1_idx', |
|
34 | 'device_has_screen', |
|
35 | 'screen_id' |
|
36 | ); |
|
37 | ||
38 | $this->createIndex( |
|
39 | 'fk_device_has_screen_device1_idx', |
|
40 | 'device_has_screen', |
|
41 | 'device_id' |
|
42 | ); |
|
43 | ||
44 | $this->addForeignKey( |
|
45 | 'fk_device_has_screen_screen1', |
|
46 | 'device_has_screen', |
|
47 | 'screen_id', |
|
48 | 'screen', |
|
49 | 'id', |
|
50 | 'CASCADE', |
|
51 | 'CASCADE' |
|
52 | ); |
|
53 | ||
54 | $this->addForeignKey( |
|
55 | 'fk_device_has_screen_device1', |
|
56 | 'device_has_screen', |
|
57 | 'device_id', |
|
58 | 'device', |
|
59 | 'id', |
|
60 | 'CASCADE', |
|
61 | 'CASCADE' |
|
62 | ); |
|
63 | } |
|
64 | ||
65 | /** |
|
66 | * {@inheritdoc} |
|
67 | */ |
|
68 | public function down() |
|
69 | { |
|
70 | $this->dropTable('device_has_screen'); |
|
71 | } |
|
72 | } |
|
73 |
@@ 9-72 (lines=64) @@ | ||
6 | * Handles the creation of table `screen_has_flow`. |
|
7 | */ |
|
8 | // @codingStandardsIgnoreLine |
|
9 | class m161031_110833_create_screen_has_flow_table extends Migration |
|
10 | { |
|
11 | /** |
|
12 | * {@inheritdoc} |
|
13 | */ |
|
14 | public function up() |
|
15 | { |
|
16 | $tableOptions = null; |
|
17 | if ($this->db->driverName === 'mysql') { |
|
18 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; |
|
19 | } |
|
20 | ||
21 | $this->createTable('screen_has_flow', [ |
|
22 | 'screen_id' => $this->integer()->notNull(), |
|
23 | 'flow_id' => $this->integer()->notNull(), |
|
24 | ], $tableOptions); |
|
25 | ||
26 | $this->addPrimaryKey( |
|
27 | 'pk_screen_has_flow', |
|
28 | 'screen_has_flow', |
|
29 | ['screen_id', 'flow_id'] |
|
30 | ); |
|
31 | ||
32 | $this->createIndex( |
|
33 | 'fk_screen_has_flow_screen1_idx', |
|
34 | 'screen_has_flow', |
|
35 | 'screen_id' |
|
36 | ); |
|
37 | ||
38 | $this->createIndex( |
|
39 | 'fk_screen_has_flow_flow1_idx', |
|
40 | 'screen_has_flow', |
|
41 | 'flow_id' |
|
42 | ); |
|
43 | ||
44 | $this->addForeignKey( |
|
45 | 'fk_screen_has_flow_screen1', |
|
46 | 'screen_has_flow', |
|
47 | 'screen_id', |
|
48 | 'screen', |
|
49 | 'id', |
|
50 | 'CASCADE', |
|
51 | 'CASCADE' |
|
52 | ); |
|
53 | ||
54 | $this->addForeignKey( |
|
55 | 'fk_screen_has_flow_flow1', |
|
56 | 'screen_has_flow', |
|
57 | 'flow_id', |
|
58 | 'flow', |
|
59 | 'id', |
|
60 | 'CASCADE', |
|
61 | 'CASCADE' |
|
62 | ); |
|
63 | } |
|
64 | ||
65 | /** |
|
66 | * {@inheritdoc} |
|
67 | */ |
|
68 | public function down() |
|
69 | { |
|
70 | $this->dropTable('screen_has_flow'); |
|
71 | } |
|
72 | } |
|
73 |