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
<?php | |
/* | |
makes mysqldump every N seconds, shows colordiff of two latest dumps. | |
useful for debugging: you see all changes made in database tables in last N seconds. | |
removes metadata from table so that only contents are diff'ed | |
requires mysqldump, colordiff | |
usage: |
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
<?php | |
/** | |
* Yii2 console command that logs into remote server (presumably production), makes SQL dump, downloads it and import to local DB | |
*/ | |
namespace app\commands; | |
use yii\console\Controller; | |
use yii\helpers\Console; |
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
<?php | |
/* | |
Структура таблицы для сохранения дерева: | |
CREATE TABLE `tree` ( | |
`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
`title` varchar(512) NOT NULL, | |
`position` varchar(32) NOT NULL, | |
`value` int NOT NULL, | |
`currency` varchar(8) NOT NULL, |