--- /dev/null
+<?php
+
+use yii\db\Migration;
+
+/**
+ * Handles the creation of table `{{%matrix_bouquet_forecast}}`.
+ */
+class m250514_143555_create_matrix_bouquet_forecast_table extends Migration
+{
+ const TABLE_NAME = 'erp24.matrix_bouquet_forecast';
+ /**
+ * {@inheritdoc}
+ */
+ public function safeUp()
+ {
+ $tableSchema = $this->db->getTableSchema(self::TABLE_NAME);
+
+ if (!isset($tableSchema)) {
+ $this->createTable(self::TABLE_NAME, [
+ 'id' => $this->primaryKey(),
+ 'bouquet_id' => $this->integer()->comment('ИД букета'),
+ 'bouquet_name' => $this->string()->comment('Наименование букета'),
+ 'bouquet_group' => $this->string()->comment('Матрица букета'),
+ 'year' => $this->integer()->comment('Год'),
+ 'month' => $this->integer()->comment('Месяц'),
+ 's_store' => $this->integer()->comment('Прогноз для оффлайн магазинов типа s'),
+ 'm_store' => $this->integer()->comment('Прогноз для оффлайн магазинов типа m'),
+ 'l_store' => $this->integer()->comment('Прогноз для оффлайн магазинов типа l'),
+ 'xl_store' => $this->integer()->comment('Прогноз для оффлайн магазинов типа xl'),
+ 'marketplace' => $this->integer()->comment('Прогноз для маркетплейсов'),
+ 'internet' => $this->integer()->comment('Прогноз для интернет магазина'),
+ 'created_at' => $this->dateTime()->comment('Дата создания'),
+ 'updated_at' => $this->dateTime()->comment('Дата обновления'),
+
+ ]);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function safeDown()
+ {
+ $tableSchema = $this->db->getTableSchema(self::TABLE_NAME);
+ if (isset($tableSchema)) {
+ $this->dropTable(self::TABLE_NAME);
+ }
+ }
+}
--- /dev/null
+<?php
+
+namespace yii_app\records;
+
+use Yii;
+
+/**
+ * This is the model class for table "matrix_bouquet_forecast".
+ *
+ * @property int $id
+ * @property int|null $bouquet_id ИД букета
+ * @property string|null $bouquet_name Наименование букета
+ * @property string|null $bouquet_group Матрица букета
+ * @property int|null $year Год
+ * @property int|null $month Месяц
+ * @property int|null $s_store Прогноз для оффлайн магазинов типа s
+ * @property int|null $m_store Прогноз для оффлайн магазинов типа m
+ * @property int|null $l_store Прогноз для оффлайн магазинов типа l
+ * @property int|null $xl_store Прогноз для оффлайн магазинов типа xl
+ * @property int|null $marketplace Прогноз для маркетплейсов
+ * @property int|null $internet Прогноз для интернет магазина
+ * @property string|null $created_at Дата создания
+ * @property string|null $updated_at Дата обновления
+ */
+class MatrixBouquetForecast extends \yii\db\ActiveRecord
+{
+
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function tableName()
+ {
+ return 'matrix_bouquet_forecast';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function rules()
+ {
+ return [
+ [['bouquet_id', 'bouquet_name', 'bouquet_group', 'year', 'month', 's_store', 'm_store', 'l_store', 'xl_store', 'marketplace', 'internet', 'created_at', 'updated_at'], 'default', 'value' => null],
+ [['bouquet_id', 'year', 'month', 's_store', 'm_store', 'l_store', 'xl_store', 'marketplace', 'internet'], 'default', 'value' => null],
+ [['bouquet_id', 'year', 'month', 's_store', 'm_store', 'l_store', 'xl_store', 'marketplace', 'internet'], 'integer'],
+ [['created_at', 'updated_at'], 'safe'],
+ [['bouquet_name', 'bouquet_group'], 'string', 'max' => 255],
+ ];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => 'ID',
+ 'bouquet_id' => 'Bouquet ID',
+ 'bouquet_name' => 'Bouquet Name',
+ 'bouquet_group' => 'Bouquet Group',
+ 'year' => 'Year',
+ 'month' => 'Month',
+ 's_store' => 'S Store',
+ 'm_store' => 'M Store',
+ 'l_store' => 'L Store',
+ 'xl_store' => 'Xl Store',
+ 'marketplace' => 'Marketplace',
+ 'internet' => 'Internet',
+ 'created_at' => 'Created At',
+ 'updated_at' => 'Updated At',
+ ];
+ }
+
+}