| @@ 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. |
|
| @@ 744-757 (lines=14) @@ | ||
| 741 | * |
|
| 742 | * @param Schema $schema |
|
| 743 | */ |
|
| 744 | protected function createOrocrmMagentoStoreTable(Schema $schema) |
|
| 745 | { |
|
| 746 | $table = $schema->createTable('orocrm_magento_store'); |
|
| 747 | $table->addColumn('id', 'integer', ['precision' => 0, 'autoincrement' => true]); |
|
| 748 | $table->addColumn('website_id', 'integer', []); |
|
| 749 | $table->addColumn('channel_id', 'integer', ['notnull' => false]); |
|
| 750 | $table->addColumn('store_code', 'string', ['length' => 32, 'precision' => 0]); |
|
| 751 | $table->addColumn('store_name', 'string', ['length' => 255, 'precision' => 0]); |
|
| 752 | $table->addColumn('origin_id', 'integer', ['notnull' => false, 'precision' => 0, 'unsigned' => true]); |
|
| 753 | $table->addIndex(['website_id'], 'IDX_477738EA18F45C82', []); |
|
| 754 | $table->addIndex(['channel_id'], 'IDX_477738EA72F5A1AA', []); |
|
| 755 | $table->setPrimaryKey(['id']); |
|
| 756 | $table->addUniqueIndex(['store_code', 'channel_id'], 'unq_code_channel_id'); |
|
| 757 | } |
|
| 758 | ||
| 759 | /** |
|
| 760 | * Create orocrm_magento_cart_status table |
|