diff --git a/migrations/m240819_084542_parameters.php b/migrations/m240819_084542_parameters.php new file mode 100644 index 0000000..c3ea02c --- /dev/null +++ b/migrations/m240819_084542_parameters.php @@ -0,0 +1,45 @@ +createTable('parameters', [ + 'id' => Schema::TYPE_PK, + 'title' => Schema::TYPE_STRING . ' NOT NULL', + 'type' => 'TINYINT NOT NULL CHECK (type IN (1, 2))', + ]); + } + + /** + * {@inheritdoc} + */ + public function safeDown() + { + $this->dropTable('parameters'); + } + + /* + // Use up()/down() to run migration code without a transaction. + public function up() + { + + } + + public function down() + { + echo "m240819_084542_parameters cannot be reverted.\n"; + + return false; + } + */ +} diff --git a/models/Parameters.php b/models/Parameters.php new file mode 100644 index 0000000..2e7f211 --- /dev/null +++ b/models/Parameters.php @@ -0,0 +1,47 @@ + 255], + ]; + } + + /** + * {@inheritdoc} + */ + public function attributeLabels() + { + return [ + 'id' => 'ID', + 'title' => 'Title', + 'type' => 'Type', + ]; + } +}