Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Dec 30, 2024
1 parent 3b00d3f commit da73b1b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
24 changes: 24 additions & 0 deletions src/migrations/m241230_092000__alter_table__cms_agent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* @author Semenov Alexander <[email protected]>
* @link http://skeeks.com/
* @copyright 2010 SkeekS (СкикС)
* @date 28.08.2015
*/

use yii\db\Migration;

class m241230_092000__alter_table__cms_agent extends Migration
{
public function safeUp()
{
$tableName = "cms_agent";
$this->alterColumn($tableName, "is_period", $this->integer(1)->notNull()->defaultValue(0));
}

public function safeDown()
{
echo "m200410_111000__alter_table__cms_content_element cannot be reverted.\n";
return false;
}
}
6 changes: 5 additions & 1 deletion src/models/CmsAgentModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ public function rules()
[['name'], 'required'],
[['description'], 'string'],
[['name'], 'string'],
[['is_active', 'is_period', 'is_running'], 'integer', 'max' => 1],

[['is_active', 'is_period', 'is_running'], 'integer'
// , 'max' => 1
],

[['is_system'], 'default', 'value' => 0],
[['is_active'], 'default', 'value' => 1],
[['is_period'], 'default', 'value' => 0],

[['is_running'], 'default', 'value' => 0],
[['agent_interval'], 'default', 'value' => 86400],
[['priority'], 'default', 'value' => 100],
Expand Down

0 comments on commit da73b1b

Please sign in to comment.