@@ 27-45 (lines=19) @@ | ||
24 | * |
|
25 | * @param Schema $schema |
|
26 | */ |
|
27 | protected function createOrocrmChannelLifetimeHistTable(Schema $schema) |
|
28 | { |
|
29 | $table = $schema->createTable('orocrm_channel_lifetime_hist'); |
|
30 | $table->addColumn('id', 'integer', ['autoincrement' => true]); |
|
31 | $table->addColumn('status', 'boolean', ['notnull' => true]); |
|
32 | $table->addColumn('account_id', 'integer', ['notnull' => false]); |
|
33 | $table->addColumn('data_channel_id', 'integer', ['notnull' => false]); |
|
34 | $table->addColumn( |
|
35 | 'amount', |
|
36 | 'money', |
|
37 | ['notnull' => true, 'precision' => 19, 'scale' => 4, 'comment' => '(DC2Type:money)'] |
|
38 | ); |
|
39 | $table->addColumn('created_at', 'datetime', []); |
|
40 | $table->setPrimaryKey(['id']); |
|
41 | $table->addIndex(['data_channel_id'], 'IDX_2B156554BDC09B73', []); |
|
42 | $table->addIndex(['account_id'], 'IDX_2B1565549B6B5FBA', []); |
|
43 | $table->addIndex(['account_id', 'data_channel_id', 'status'], 'orocrm_chl_ltv_hist_idx'); |
|
44 | $table->addIndex(['status'], 'orocrm_chl_ltv_hist_status_idx'); |
|
45 | } |
|
46 | ||
47 | /** |
|
48 | * Add orocrm_channel_lifetime_hist foreign keys. |
@@ 740-753 (lines=14) @@ | ||
737 | * |
|
738 | * @param Schema $schema |
|
739 | */ |
|
740 | protected function createOrocrmMagentoStoreTable(Schema $schema) |
|
741 | { |
|
742 | $table = $schema->createTable('orocrm_magento_store'); |
|
743 | $table->addColumn('id', 'integer', ['precision' => 0, 'autoincrement' => true]); |
|
744 | $table->addColumn('website_id', 'integer', []); |
|
745 | $table->addColumn('channel_id', 'integer', ['notnull' => false]); |
|
746 | $table->addColumn('store_code', 'string', ['length' => 32, 'precision' => 0]); |
|
747 | $table->addColumn('store_name', 'string', ['length' => 255, 'precision' => 0]); |
|
748 | $table->addColumn('origin_id', 'integer', ['notnull' => false, 'precision' => 0, 'unsigned' => true]); |
|
749 | $table->addIndex(['website_id'], 'IDX_477738EA18F45C82', []); |
|
750 | $table->addIndex(['channel_id'], 'IDX_477738EA72F5A1AA', []); |
|
751 | $table->setPrimaryKey(['id']); |
|
752 | $table->addUniqueIndex(['store_code', 'channel_id'], 'unq_code_channel_id'); |
|
753 | } |
|
754 | ||
755 | /** |
|
756 | * Create orocrm_magento_cart_status table |