Code Duplication    Length = 9-11 lines in 23 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/MagentoBundle/Migrations/Schema/OroCRMMagentoBundleInstaller.php 7 locations

@@ 348-356 (lines=9) @@
345
     *
346
     * @param Schema $schema
347
     */
348
    protected function createOrocrmMagentoOrderCallsTable(Schema $schema)
349
    {
350
        $table = $schema->createTable('orocrm_magento_order_calls');
351
        $table->addColumn('order_id', 'integer', []);
352
        $table->addColumn('call_id', 'integer', []);
353
        $table->addIndex(['order_id'], 'IDX_A885A348D9F6D38', []);
354
        $table->addIndex(['call_id'], 'IDX_A885A3450A89B2C', []);
355
        $table->setPrimaryKey(['order_id', 'call_id']);
356
    }
357
358
    /**
359
     * Create orocrm_magento_order_emails table
@@ 363-371 (lines=9) @@
360
     *
361
     * @param Schema $schema
362
     */
363
    protected function createOrocrmMagentoOrderEmailsTable(Schema $schema)
364
    {
365
        $table = $schema->createTable('orocrm_magento_order_emails');
366
        $table->addColumn('order_id', 'integer', []);
367
        $table->addColumn('email_id', 'integer', []);
368
        $table->addIndex(['order_id'], 'IDX_10E2A9508D9F6D38', []);
369
        $table->addIndex(['email_id'], 'IDX_10E2A950A832C1C9', []);
370
        $table->setPrimaryKey(['order_id', 'email_id']);
371
    }
372
373
    /**
374
     * Create orocrm_magento_customer_group table
@@ 546-554 (lines=9) @@
543
     *
544
     * @param Schema $schema
545
     */
546
    protected function createOrocrmMagentoCustAddrTypeTable(Schema $schema)
547
    {
548
        $table = $schema->createTable('orocrm_magento_cust_addr_type');
549
        $table->addColumn('customer_address_id', 'integer', []);
550
        $table->addColumn('type_name', 'string', ['length' => 16]);
551
        $table->addIndex(['customer_address_id'], 'IDX_308A31F187EABF7', []);
552
        $table->addIndex(['type_name'], 'IDX_308A31F1892CBB0E', []);
553
        $table->setPrimaryKey(['customer_address_id', 'type_name']);
554
    }
555
556
    /**
557
     * Create orocrm_magento_order_address table
@@ 590-598 (lines=9) @@
587
     *
588
     * @param Schema $schema
589
     */
590
    protected function createOrocrmMagentoOrderAddrTypeTable(Schema $schema)
591
    {
592
        $table = $schema->createTable('orocrm_magento_order_addr_type');
593
        $table->addColumn('order_address_id', 'integer', []);
594
        $table->addColumn('type_name', 'string', ['length' => 16]);
595
        $table->addIndex(['order_address_id'], 'IDX_E927A18F466D5220', []);
596
        $table->addIndex(['type_name'], 'IDX_E927A18F892CBB0E', []);
597
        $table->setPrimaryKey(['order_address_id', 'type_name']);
598
    }
599
600
    /**
601
     * Create orocrm_magento_product table
@@ 633-641 (lines=9) @@
630
     *
631
     * @param Schema $schema
632
     */
633
    protected function createOrocrmMagentoProdToWebsiteTable(Schema $schema)
634
    {
635
        $table = $schema->createTable('orocrm_magento_prod_to_website');
636
        $table->addColumn('product_id', 'integer', []);
637
        $table->addColumn('website_id', 'integer', []);
638
        $table->addIndex(['product_id'], 'IDX_9BB836554584665A', []);
639
        $table->addIndex(['website_id'], 'IDX_9BB8365518F45C82', []);
640
        $table->setPrimaryKey(['product_id', 'website_id']);
641
    }
642
643
    /**
644
     * Create orocrm_magento_website table
@@ 740-748 (lines=9) @@
737
     *
738
     * @param Schema $schema
739
     */
740
    protected function createOrocrmMagentoCartCallsTable(Schema $schema)
741
    {
742
        $table = $schema->createTable('orocrm_magento_cart_calls');
743
        $table->addColumn('cart_id', 'integer', []);
744
        $table->addColumn('call_id', 'integer', []);
745
        $table->addIndex(['cart_id'], 'IDX_83A847751AD5CDBF', []);
746
        $table->addIndex(['call_id'], 'IDX_83A8477550A89B2C', []);
747
        $table->setPrimaryKey(['cart_id', 'call_id']);
748
    }
749
750
    /**
751
     * Create orocrm_magento_cart_emails table
@@ 755-763 (lines=9) @@
752
     *
753
     * @param Schema $schema
754
     */
755
    protected function createOrocrmMagentoCartEmailsTable(Schema $schema)
756
    {
757
        $table = $schema->createTable('orocrm_magento_cart_emails');
758
        $table->addColumn('cart_id', 'integer', []);
759
        $table->addColumn('email_id', 'integer', []);
760
        $table->addIndex(['cart_id'], 'IDX_11B0F84B1AD5CDBF', []);
761
        $table->addIndex(['email_id'], 'IDX_11B0F84BA832C1C9', []);
762
        $table->setPrimaryKey(['cart_id', 'email_id']);
763
    }
764
765
    /**
766
     * Create orocrm_magento_store table

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.