Code Duplication    Length = 9-11 lines in 21 locations

src/OroCRM/Bundle/ContactBundle/Migrations/Schema/OroCRMContactBundleInstaller.php 2 locations

@@ 196-204 (lines=9) @@
193
     *
194
     * @param Schema $schema
195
     */
196
    protected function createOrocrmContactAdrToAdrTypeTable(Schema $schema)
197
    {
198
        $table = $schema->createTable('orocrm_contact_adr_to_adr_type');
199
        $table->addColumn('contact_address_id', 'integer', []);
200
        $table->addColumn('type_name', 'string', ['length' => 16]);
201
        $table->setPrimaryKey(['contact_address_id', 'type_name']);
202
        $table->addIndex(['contact_address_id'], 'IDX_3FBCDDC6320EF6E2', []);
203
        $table->addIndex(['type_name'], 'IDX_3FBCDDC6892CBB0E', []);
204
    }
205
206
    /**
207
     * Create orocrm_contact_email table
@@ 290-298 (lines=9) @@
287
     *
288
     * @param Schema $schema
289
     */
290
    protected function createOrocrmContactToContactGrpTable(Schema $schema)
291
    {
292
        $table = $schema->createTable('orocrm_contact_to_contact_grp');
293
        $table->addColumn('contact_id', 'integer', []);
294
        $table->addColumn('contact_group_id', 'integer', []);
295
        $table->setPrimaryKey(['contact_id', 'contact_group_id']);
296
        $table->addIndex(['contact_id'], 'IDX_885CCB12E7A1254A', []);
297
        $table->addIndex(['contact_group_id'], 'IDX_885CCB12647145D0', []);
298
    }
299
300
    /**
301
     * Add orocrm_contact foreign keys.

src/OroCRM/Bundle/ContactBundle/Migrations/Schema/v1_0/OroCRMContactBundle.php 2 locations

@@ 123-133 (lines=11) @@
120
     * @param Schema $schema
121
     * @param string $tableName
122
     */
123
    public static function orocrmContactAddressToAddressTypeTable(Schema $schema, $tableName = null)
124
    {
125
        /** Generate table orocrm_contact_address_to_address_type **/
126
        $table = $schema->createTable($tableName ?: 'orocrm_contact_address_to_address_type');
127
        $table->addColumn('contact_address_id', 'integer', []);
128
        $table->addColumn('type_name', 'string', ['length' => 16]);
129
        $table->setPrimaryKey(['contact_address_id', 'type_name']);
130
        $table->addIndex(['contact_address_id'], 'IDX_3FBCDDC6320EF6E2', []);
131
        $table->addIndex(['type_name'], 'IDX_3FBCDDC6892CBB0E', []);
132
        /** End of generate table orocrm_contact_address_to_address_type **/
133
    }
134
135
    /**
136
     * Generate table orocrm_contact_email
@@ 229-239 (lines=11) @@
226
     * @param Schema $schema
227
     * @param string $tableName
228
     */
229
    public static function orocrmContactToContactGroupTable(Schema $schema, $tableName = null)
230
    {
231
        /** Generate table orocrm_contact_to_contact_group **/
232
        $table = $schema->createTable($tableName ?: 'orocrm_contact_to_contact_group');
233
        $table->addColumn('contact_id', 'integer', []);
234
        $table->addColumn('contact_group_id', 'smallint', []);
235
        $table->setPrimaryKey(['contact_id', 'contact_group_id']);
236
        $table->addIndex(['contact_id'], 'IDX_885CCB12E7A1254A', []);
237
        $table->addIndex(['contact_group_id'], 'IDX_885CCB12647145D0', []);
238
        /** End of generate table orocrm_contact_to_contact_group **/
239
    }
240
241
    /**
242
     * Generate foreign keys for table orocrm_contact

src/OroCRM/Bundle/ContactUsBundle/Migrations/Schema/OroCRMContactUsBundleInstaller.php 2 locations

@@ 78-86 (lines=9) @@
75
     *
76
     * @param Schema $schema
77
     */
78
    protected function createOrocrmContactusReqEmailsTable(Schema $schema)
79
    {
80
        $table = $schema->createTable('orocrm_contactus_req_emails');
81
        $table->addColumn('request_id', 'integer', []);
82
        $table->addColumn('email_id', 'integer', []);
83
        $table->setPrimaryKey(['request_id', 'email_id']);
84
        $table->addIndex(['request_id'], 'IDX_E494F7AE427EB8A5', []);
85
        $table->addIndex(['email_id'], 'IDX_E494F7AEA832C1C9', []);
86
    }
87
88
    /**
89
     * Create orocrm_contactus_request table
@@ 128-136 (lines=9) @@
125
     *
126
     * @param Schema $schema
127
     */
128
    protected function createOrocrmContactusRequestCallsTable(Schema $schema)
129
    {
130
        $table = $schema->createTable('orocrm_contactus_request_calls');
131
        $table->addColumn('request_id', 'integer', []);
132
        $table->addColumn('call_id', 'integer', []);
133
        $table->setPrimaryKey(['request_id', 'call_id']);
134
        $table->addIndex(['request_id'], 'IDX_6F7A50CE427EB8A5', []);
135
        $table->addIndex(['call_id'], 'IDX_6F7A50CE50A89B2C', []);
136
    }
137
138
    /**
139
     * Add orocrm_contactus_req_emails foreign keys.

src/OroCRM/Bundle/ContactUsBundle/Migrations/Schema/v1_0/OroCRMContactUsBundle.php 2 locations

@@ 83-93 (lines=11) @@
80
     *
81
     * @param Schema $schema
82
     */
83
    public static function orocrmContactusRequestCallsTable(Schema $schema)
84
    {
85
        /** Generate table orocrm_contactus_request_calls **/
86
        $table = $schema->createTable('orocrm_contactus_request_calls');
87
        $table->addColumn('request_id', 'integer', []);
88
        $table->addColumn('call_id', 'integer', []);
89
        $table->setPrimaryKey(['request_id', 'call_id']);
90
        $table->addIndex(['request_id'], 'IDX_6F7A50CE427EB8A5', []);
91
        $table->addIndex(['call_id'], 'IDX_6F7A50CE50A89B2C', []);
92
        /** End of generate table orocrm_contactus_request_calls **/
93
    }
94
95
    /**
96
     * Generate table orocrm_contactus_request_emails
@@ 101-111 (lines=11) @@
98
     * @param Schema $schema
99
     * @param string $tableName
100
     */
101
    public static function orocrmContactusRequestEmailsTable(Schema $schema, $tableName = null)
102
    {
103
        /** Generate table orocrm_contactus_request_emails **/
104
        $table = $schema->createTable($tableName ?: 'orocrm_contactus_request_emails');
105
        $table->addColumn('request_id', 'integer', []);
106
        $table->addColumn('email_id', 'integer', []);
107
        $table->setPrimaryKey(['request_id', 'email_id']);
108
        $table->addIndex(['request_id'], 'IDX_4DEF4058427EB8A5', []);
109
        $table->addIndex(['email_id'], 'IDX_4DEF4058A832C1C9', []);
110
        /** End of generate table orocrm_contactus_request_emails **/
111
    }
112
113
    /**
114
     * Generate foreign keys for table orocrm_contactus_request

src/OroCRM/Bundle/MagentoBundle/Migrations/Schema/v1_0/OroCRMMagentoBundle.php 7 locations

@@ 168-178 (lines=11) @@
165
     *
166
     * @param Schema $schema
167
     */
168
    public static function orocrmMagentoCartCallsTable(Schema $schema)
169
    {
170
        /** Generate table orocrm_magento_cart_calls **/
171
        $table = $schema->createTable('orocrm_magento_cart_calls');
172
        $table->addColumn('cart_id', 'integer', []);
173
        $table->addColumn('call_id', 'integer', []);
174
        $table->setPrimaryKey(['cart_id', 'call_id']);
175
        $table->addIndex(['cart_id'], 'IDX_83A847751AD5CDBF', []);
176
        $table->addIndex(['call_id'], 'IDX_83A8477550A89B2C', []);
177
        /** End of generate table orocrm_magento_cart_calls **/
178
    }
179
180
    /**
181
     * Generate table orocrm_magento_cart_emails
@@ 185-195 (lines=11) @@
182
     *
183
     * @param Schema $schema
184
     */
185
    public static function orocrmMagentoCartEmailsTable(Schema $schema)
186
    {
187
        /** Generate table orocrm_magento_cart_emails **/
188
        $table = $schema->createTable('orocrm_magento_cart_emails');
189
        $table->addColumn('cart_id', 'integer', []);
190
        $table->addColumn('email_id', 'integer', []);
191
        $table->setPrimaryKey(['cart_id', 'email_id']);
192
        $table->addIndex(['cart_id'], 'IDX_11B0F84B1AD5CDBF', []);
193
        $table->addIndex(['email_id'], 'IDX_11B0F84BA832C1C9', []);
194
        /** End of generate table orocrm_magento_cart_emails **/
195
    }
196
197
    /**
198
     * Generate table orocrm_magento_cart_item
@@ 336-346 (lines=11) @@
333
     * @param Schema $schema
334
     * @param string $tableName
335
     */
336
    public static function orocrmMagentoCustomerAddressToAddressTypeTable(Schema $schema, $tableName = null)
337
    {
338
        /** Generate table orocrm_magento_customer_address_to_address_type **/
339
        $table = $schema->createTable($tableName ?: 'orocrm_magento_customer_address_to_address_type');
340
        $table->addColumn('customer_address_id', 'integer', []);
341
        $table->addColumn('type_name', 'string', ['length' => 16]);
342
        $table->setPrimaryKey(['customer_address_id', 'type_name']);
343
        $table->addIndex(['customer_address_id'], 'IDX_65B2C97487EABF7', []);
344
        $table->addIndex(['type_name'], 'IDX_65B2C974892CBB0E', []);
345
        /** End of generate table orocrm_magento_customer_address_to_address_type **/
346
    }
347
348
    /**
349
     * Generate table orocrm_magento_customer_group
@@ 452-462 (lines=11) @@
449
     *
450
     * @param Schema $schema
451
     */
452
    public static function orocrmMagentoOrderAddrTypeTable(Schema $schema)
453
    {
454
        /** Generate table orocrm_magento_order_addr_type **/
455
        $table = $schema->createTable('orocrm_magento_order_addr_type');
456
        $table->addColumn('order_address_id', 'integer', []);
457
        $table->addColumn('type_name', 'string', ['length' => 16]);
458
        $table->setPrimaryKey(['order_address_id', 'type_name']);
459
        $table->addIndex(['order_address_id'], 'IDX_7B667960466D5220', []);
460
        $table->addIndex(['type_name'], 'IDX_7B667960892CBB0E', []);
461
        /** End of generate table orocrm_magento_order_addr_type **/
462
    }
463
464
    /**
465
     * Generate table orocrm_magento_order_calls
@@ 469-479 (lines=11) @@
466
     *
467
     * @param Schema $schema
468
     */
469
    public static function orocrmMagentoOrderCallsTable(Schema $schema)
470
    {
471
        /** Generate table orocrm_magento_order_calls **/
472
        $table = $schema->createTable('orocrm_magento_order_calls');
473
        $table->addColumn('order_id', 'integer', []);
474
        $table->addColumn('call_id', 'integer', []);
475
        $table->setPrimaryKey(['order_id', 'call_id']);
476
        $table->addIndex(['order_id'], 'IDX_A885A348D9F6D38', []);
477
        $table->addIndex(['call_id'], 'IDX_A885A3450A89B2C', []);
478
        /** End of generate table orocrm_magento_order_calls **/
479
    }
480
481
    /**
482
     * Generate table orocrm_magento_order_emails
@@ 486-496 (lines=11) @@
483
     *
484
     * @param Schema $schema
485
     */
486
    public static function orocrmMagentoOrderEmailsTable(Schema $schema)
487
    {
488
        /** Generate table orocrm_magento_order_emails **/
489
        $table = $schema->createTable('orocrm_magento_order_emails');
490
        $table->addColumn('order_id', 'integer', []);
491
        $table->addColumn('email_id', 'integer', []);
492
        $table->setPrimaryKey(['order_id', 'email_id']);
493
        $table->addIndex(['order_id'], 'IDX_10E2A9508D9F6D38', []);
494
        $table->addIndex(['email_id'], 'IDX_10E2A950A832C1C9', []);
495
        /** End of generate table orocrm_magento_order_emails **/
496
    }
497
498
    /**
499
     * Generate table orocrm_magento_order_items
@@ 561-571 (lines=11) @@
558
     * @param Schema $schema
559
     * @param string $tableName
560
     */
561
    public static function orocrmMagentoProductToWebsiteTable(Schema $schema, $tableName = null)
562
    {
563
        /** Generate table orocrm_magento_product_to_website **/
564
        $table = $schema->createTable($tableName ?: 'orocrm_magento_product_to_website');
565
        $table->addColumn('product_id', 'integer', []);
566
        $table->addColumn('website_id', 'integer', []);
567
        $table->setPrimaryKey(['product_id', 'website_id']);
568
        $table->addIndex(['product_id'], 'IDX_3A3EF4984584665A', []);
569
        $table->addIndex(['website_id'], 'IDX_3A3EF49818F45C82', []);
570
        /** End of generate table orocrm_magento_product_to_website **/
571
    }
572
573
    /**
574
     * Generate table orocrm_magento_region

src/OroCRM/Bundle/AccountBundle/Migrations/Schema/OroCRMAccountBundleInstaller.php 1 location

@@ 168-176 (lines=9) @@
165
     *
166
     * @param Schema $schema
167
     */
168
    protected function createOrocrmAccountToContactTable(Schema $schema)
169
    {
170
        $table = $schema->createTable('orocrm_account_to_contact');
171
        $table->addColumn('account_id', 'integer', []);
172
        $table->addColumn('contact_id', 'integer', []);
173
        $table->setPrimaryKey(['account_id', 'contact_id']);
174
        $table->addIndex(['account_id'], 'IDX_65B8FBEC9B6B5FBA', []);
175
        $table->addIndex(['contact_id'], 'IDX_65B8FBECE7A1254A', []);
176
    }
177
178
    /**
179
     * Add orocrm_account foreign keys.

src/OroCRM/Bundle/MagentoBundle/Migrations/Schema/OroCRMMagentoBundleInstaller.php 5 locations

@@ 349-357 (lines=9) @@
346
     *
347
     * @param Schema $schema
348
     */
349
    protected function createOrocrmMagentoOrderEmailsTable(Schema $schema)
350
    {
351
        $table = $schema->createTable('orocrm_magento_order_emails');
352
        $table->addColumn('order_id', 'integer', []);
353
        $table->addColumn('email_id', 'integer', []);
354
        $table->addIndex(['order_id'], 'IDX_10E2A9508D9F6D38', []);
355
        $table->addIndex(['email_id'], 'IDX_10E2A950A832C1C9', []);
356
        $table->setPrimaryKey(['order_id', 'email_id']);
357
    }
358
359
    /**
360
     * Create orocrm_magento_customer_group table
@@ 532-540 (lines=9) @@
529
     *
530
     * @param Schema $schema
531
     */
532
    protected function createOrocrmMagentoCustAddrTypeTable(Schema $schema)
533
    {
534
        $table = $schema->createTable('orocrm_magento_cust_addr_type');
535
        $table->addColumn('customer_address_id', 'integer', []);
536
        $table->addColumn('type_name', 'string', ['length' => 16]);
537
        $table->addIndex(['customer_address_id'], 'IDX_308A31F187EABF7', []);
538
        $table->addIndex(['type_name'], 'IDX_308A31F1892CBB0E', []);
539
        $table->setPrimaryKey(['customer_address_id', 'type_name']);
540
    }
541
542
    /**
543
     * Create orocrm_magento_order_address table
@@ 576-584 (lines=9) @@
573
     *
574
     * @param Schema $schema
575
     */
576
    protected function createOrocrmMagentoOrderAddrTypeTable(Schema $schema)
577
    {
578
        $table = $schema->createTable('orocrm_magento_order_addr_type');
579
        $table->addColumn('order_address_id', 'integer', []);
580
        $table->addColumn('type_name', 'string', ['length' => 16]);
581
        $table->addIndex(['order_address_id'], 'IDX_E927A18F466D5220', []);
582
        $table->addIndex(['type_name'], 'IDX_E927A18F892CBB0E', []);
583
        $table->setPrimaryKey(['order_address_id', 'type_name']);
584
    }
585
586
    /**
587
     * Create orocrm_magento_product table
@@ 618-626 (lines=9) @@
615
     *
616
     * @param Schema $schema
617
     */
618
    protected function createOrocrmMagentoProdToWebsiteTable(Schema $schema)
619
    {
620
        $table = $schema->createTable('orocrm_magento_prod_to_website');
621
        $table->addColumn('product_id', 'integer', []);
622
        $table->addColumn('website_id', 'integer', []);
623
        $table->addIndex(['product_id'], 'IDX_9BB836554584665A', []);
624
        $table->addIndex(['website_id'], 'IDX_9BB8365518F45C82', []);
625
        $table->setPrimaryKey(['product_id', 'website_id']);
626
    }
627
628
    /**
629
     * Create orocrm_magento_website table
@@ 725-733 (lines=9) @@
722
     *
723
     * @param Schema $schema
724
     */
725
    protected function createOrocrmMagentoCartEmailsTable(Schema $schema)
726
    {
727
        $table = $schema->createTable('orocrm_magento_cart_emails');
728
        $table->addColumn('cart_id', 'integer', []);
729
        $table->addColumn('email_id', 'integer', []);
730
        $table->addIndex(['cart_id'], 'IDX_11B0F84B1AD5CDBF', []);
731
        $table->addIndex(['email_id'], 'IDX_11B0F84BA832C1C9', []);
732
        $table->setPrimaryKey(['cart_id', 'email_id']);
733
    }
734
735
    /**
736
     * Create orocrm_magento_store table