-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Добавляет "мягкое" удаление для сделок и других сущностей
- Loading branch information
1 parent
7dde2e2
commit e542928
Showing
7 changed files
with
141 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
use yii\db\Migration; | ||
|
||
/** | ||
* Class m200915_133435_softdelete | ||
*/ | ||
class m200915_133435_softdelete extends Migration | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function safeUp() | ||
{ | ||
$this->addColumn('user', 'deleted', $this->boolean()->defaultValue(0)); | ||
$this->addColumn('company', 'deleted', $this->boolean()->defaultValue(0)); | ||
$this->addColumn('deal', 'deleted', $this->boolean()->defaultValue(0)); | ||
$this->addColumn('note', 'deleted', $this->boolean()->defaultValue(0)); | ||
$this->addColumn('contact', 'deleted', $this->boolean()->defaultValue(0)); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function safeDown() | ||
{ | ||
echo "m200915_133435_softdelete cannot be reverted.\n"; | ||
|
||
return false; | ||
} | ||
|
||
/* | ||
// Use up()/down() to run migration code without a transaction. | ||
public function up() | ||
{ | ||
} | ||
public function down() | ||
{ | ||
echo "m200915_133435_softdelete cannot be reverted.\n"; | ||
return false; | ||
} | ||
*/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters