Code Duplication    Length = 20-22 lines in 3 locations

src/OroCRM/Bundle/ChannelBundle/Migrations/Schema/OroCRMChannelBundleInstaller.php 1 location

@@ 70-89 (lines=20) @@
67
     *
68
     * @param Schema $schema
69
     */
70
    protected function createOrocrmChannelTable(Schema $schema)
71
    {
72
        $table = $schema->createTable('orocrm_channel');
73
        $table->addColumn('id', 'integer', ['autoincrement' => true]);
74
        $table->addColumn('organization_owner_id', 'integer', ['notnull' => false]);
75
        $table->addColumn('data_source_id', 'integer', ['notnull' => false]);
76
        $table->addColumn('name', 'string', ['length' => 255]);
77
        $table->addColumn('status', 'boolean', []);
78
        $table->addColumn('channel_type', 'string', ['length' => 255]);
79
        $table->addColumn('data', Type::JSON_ARRAY, ['notnull' => false]);
80
        $table->addColumn('customer_identity', 'string', ['length' => 255]);
81
        $table->addColumn('createdAt', 'datetime', []);
82
        $table->addColumn('updatedAt', 'datetime', ['notnull' => false]);
83
        $table->setPrimaryKey(['id']);
84
        $table->addUniqueIndex(['data_source_id'], 'UNIQ_AEA90B921A935C57');
85
        $table->addIndex(['organization_owner_id'], 'IDX_AEA90B929124A35B', []);
86
        $table->addIndex(['name'], 'crm_channel_name_idx', []);
87
        $table->addIndex(['status'], 'crm_channel_status_idx', []);
88
        $table->addIndex(['channel_type'], 'crm_channel_channel_type_idx', []);
89
    }
90
91
    /**
92
     * Create orocrm_channel_cust_identity table

src/OroCRM/Bundle/SalesBundle/Migrations/Schema/v1_0/OroCRMSalesBundle.php 1 location

@@ 184-205 (lines=22) @@
181
     *
182
     * @param Schema $schema
183
     */
184
    public static function orocrmSalesFunnelTable(Schema $schema)
185
    {
186
        /** Generate table orocrm_sales_funnel **/
187
        $table = $schema->createTable('orocrm_sales_funnel');
188
        $table->addColumn('id', 'integer', ['autoincrement' => true]);
189
        $table->addColumn('workflow_step_id', 'integer', ['notnull' => false]);
190
        $table->addColumn('workflow_item_id', 'integer', ['notnull' => false]);
191
        $table->addColumn('lead_id', 'integer', ['notnull' => false]);
192
        $table->addColumn('opportunity_id', 'integer', ['notnull' => false]);
193
        $table->addColumn('user_owner_id', 'integer', ['notnull' => false]);
194
        $table->addColumn('name', 'string', ['length' => 255]);
195
        $table->addColumn('startDate', 'date', []);
196
        $table->addColumn('createdAt', 'datetime', []);
197
        $table->addColumn('updatedAt', 'datetime', ['notnull' => false]);
198
        $table->setPrimaryKey(['id']);
199
        $table->addUniqueIndex(['workflow_item_id'], 'UNIQ_E20C73441023C4EE');
200
        $table->addIndex(['user_owner_id'], 'IDX_E20C73449EB185F9', []);
201
        $table->addIndex(['lead_id'], 'IDX_E20C734455458D', []);
202
        $table->addIndex(['opportunity_id'], 'IDX_E20C73449A34590F', []);
203
        $table->addIndex(['workflow_step_id'], 'IDX_E20C734471FE882C', []);
204
        /** End of generate table orocrm_sales_funnel **/
205
    }
206
207
    /**
208
     * Generate foreign keys for table orocrm_sales_lead

src/OroCRM/Bundle/CaseBundle/Migrations/Schema/OroCRMCaseBundleInstaller.php 1 location

@@ 255-274 (lines=20) @@
252
     *
253
     * @param Schema $schema
254
     */
255
    public static function createOrocrmCaseCommentTranslationTable(Schema $schema)
256
    {
257
        $table = $schema->createTable('orocrm_case_comment');
258
        $table->addColumn('id', 'integer', ['autoincrement' => true]);
259
        $table->addColumn('case_id', 'integer', ['notnull' => false]);
260
        $table->addColumn('updated_by_id', 'integer', ['notnull' => false]);
261
        $table->addColumn('owner_id', 'integer', ['notnull' => false]);
262
        $table->addColumn('organization_id', 'integer', ['notnull' => false]);
263
        $table->addColumn('contact_id', 'integer', ['notnull' => false]);
264
        $table->addColumn('message', 'text', []);
265
        $table->addColumn('public', 'boolean', ['default' => '0']);
266
        $table->addColumn('createdAt', 'datetime', []);
267
        $table->addColumn('updatedAt', 'datetime', []);
268
        $table->setPrimaryKey(['id']);
269
        $table->addIndex(['case_id'], 'IDX_604C70FBCF10D4F5', []);
270
        $table->addIndex(['contact_id'], 'IDX_604C70FBE7A1254A', []);
271
        $table->addIndex(['updated_by_id'], 'FK_604C70FB896DBBDE', []);
272
        $table->addIndex(['owner_id'], 'IDX_604C70FB7E3C61F9', []);
273
        $table->addIndex(['organization_id'], 'IDX_604C70FB32C8A3DE', []);
274
    }
275
276
    /**
277
     * Add orocrm_case foreign keys.