mirror of
https://github.com/janickiy/yii2-nomer
synced 2025-03-09 15:39:59 +00:00
add files to project
This commit is contained in:
commit
5cac498444
3729 changed files with 836998 additions and 0 deletions
39
migrations/M161119140200Queue.php
Normal file
39
migrations/M161119140200Queue.php
Normal file
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
/**
|
||||
* @link https://github.com/zhuravljov/yii2-queue
|
||||
* @copyright Copyright (c) 2017 Roman Zhuravlev
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Example of migration for queue message storage
|
||||
*
|
||||
* @author Roman Zhuravlev <zhuravljov@gmail.com>
|
||||
*/
|
||||
class M161119140200Queue extends Migration
|
||||
{
|
||||
public $tableName = '{{%queue}}';
|
||||
public $tableOptions;
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->createTable($this->tableName, [
|
||||
'id' => $this->primaryKey(),
|
||||
'channel' => $this->string()->notNull(),
|
||||
'job' => $this->binary()->notNull(),
|
||||
'created_at' => $this->integer()->notNull(),
|
||||
'started_at' => $this->integer(),
|
||||
'finished_at' => $this->integer(),
|
||||
], $this->tableOptions);
|
||||
|
||||
$this->createIndex('channel', $this->tableName, 'channel');
|
||||
$this->createIndex('started_at', $this->tableName, 'started_at');
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable($this->tableName);
|
||||
}
|
||||
}
|
28
migrations/M170307170300Later.php
Normal file
28
migrations/M170307170300Later.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
/**
|
||||
* @link https://github.com/zhuravljov/yii2-queue
|
||||
* @copyright Copyright (c) 2017 Roman Zhuravlev
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Example of migration for queue message storage
|
||||
*
|
||||
* @author Roman Zhuravlev <zhuravljov@gmail.com>
|
||||
*/
|
||||
class M170307170300Later extends Migration
|
||||
{
|
||||
public $tableName = '{{%queue}}';
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn($this->tableName, 'timeout', $this->integer()->defaultValue(0)->notNull()->after('created_at'));
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn($this->tableName, 'timeout');
|
||||
}
|
||||
}
|
37
migrations/m170210_085747_create_users_table.php
Normal file
37
migrations/m170210_085747_create_users_table.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `users`.
|
||||
*/
|
||||
class m170210_085747_create_users_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('users', [
|
||||
'id' => $this->primaryKey(),
|
||||
'email' => $this->string(),
|
||||
'password' => $this->string(),
|
||||
'nick' => $this->string(),
|
||||
'phone' => $this->string(),
|
||||
'code' => $this->string(),
|
||||
'auth_key' => $this->string(),
|
||||
'balance' => $this->decimal(24, 4)->defaultValue(0),
|
||||
'tm_create' => $this->dateTime(),
|
||||
'tm_update' => $this->dateTime(),
|
||||
'tm_last_auth' => $this->dateTime()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('users');
|
||||
}
|
||||
}
|
33
migrations/m170210_085806_create_requests_table.php
Normal file
33
migrations/m170210_085806_create_requests_table.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `requests`.
|
||||
*/
|
||||
class m170210_085806_create_requests_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('requests', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->integer(),
|
||||
'phone' => $this->string(),
|
||||
'ip' => $this->string(),
|
||||
'ua' => $this->string(),
|
||||
'result' => $this->text(),
|
||||
'tm' => $this->timestamp()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('requests');
|
||||
}
|
||||
}
|
32
migrations/m170210_113137_create_facebook_table.php
Normal file
32
migrations/m170210_113137_create_facebook_table.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `facebook`.
|
||||
*/
|
||||
class m170210_113137_create_facebook_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('facebook', [
|
||||
'id' => $this->primaryKey(),
|
||||
'tm' => $this->dateTime(),
|
||||
'phone' => $this->string(),
|
||||
'fb_id' => $this->string(),
|
||||
'name' => $this->string(),
|
||||
'photo' => $this->text()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('facebook');
|
||||
}
|
||||
}
|
30
migrations/m170213_115912_create_auth_table.php
Normal file
30
migrations/m170213_115912_create_auth_table.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `auth`.
|
||||
*/
|
||||
class m170213_115912_create_auth_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('auth', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->integer(),
|
||||
'source' => $this->string(),
|
||||
'source_id' => $this->string()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('auth');
|
||||
}
|
||||
}
|
33
migrations/m170214_121454_create_payments_table.php
Normal file
33
migrations/m170214_121454_create_payments_table.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `payments`.
|
||||
*/
|
||||
class m170214_121454_create_payments_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('payments', [
|
||||
'id' => $this->primaryKey(),
|
||||
'sum' => $this->decimal(24, 4),
|
||||
'amount' => $this->decimal(24, 4),
|
||||
'user_id' => $this->integer(),
|
||||
'tm' => $this->timestamp(),
|
||||
'operation_id' => $this->string(),
|
||||
'operation_label' => $this->string()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('payments');
|
||||
}
|
||||
}
|
34
migrations/m170221_152736_create_cache_table.php
Normal file
34
migrations/m170221_152736_create_cache_table.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `cache`.
|
||||
*/
|
||||
class m170221_152736_create_cache_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('cache', [
|
||||
'id' => $this->primaryKey(),
|
||||
'phone' => $this->string(),
|
||||
'data' => $this->text(),
|
||||
'type_id' => $this->smallInteger(2)
|
||||
]);
|
||||
|
||||
$this->createIndex('idx_cache_phone', 'cache', 'phone');
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropIndex('idx_cache_phone', 'cache');
|
||||
|
||||
$this->dropTable('cache');
|
||||
}
|
||||
}
|
27
migrations/m170301_071147_add_tm_field_to_cache.php
Normal file
27
migrations/m170301_071147_add_tm_field_to_cache.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170301_071147_add_tm_field_to_cache extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn("cache", "tm", $this->timestamp()->defaultExpression('NOW()'));
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn("cache", "tm");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
27
migrations/m170301_110603_add_is_admin_field.php
Normal file
27
migrations/m170301_110603_add_is_admin_field.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170301_110603_add_is_admin_field extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn("users", "is_admin", $this->boolean()->defaultValue(false));
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn("users", "is_admin");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
33
migrations/m170301_110655_create_block_table.php
Normal file
33
migrations/m170301_110655_create_block_table.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `block`.
|
||||
*/
|
||||
class m170301_110655_create_block_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('block', [
|
||||
'id' => $this->primaryKey(),
|
||||
'phone' => $this->string(),
|
||||
'ip' => $this->string(),
|
||||
'ua' => $this->string(),
|
||||
'tm' => $this->timestamp(),
|
||||
'code' => $this->string(4),
|
||||
'status' => $this->smallInteger(1)->defaultValue(0)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('block');
|
||||
}
|
||||
}
|
29
migrations/m170307_084049_create_urls_table.php
Normal file
29
migrations/m170307_084049_create_urls_table.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `urls`.
|
||||
*/
|
||||
class m170307_084049_create_urls_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('urls', [
|
||||
'id' => $this->primaryKey(),
|
||||
'url' => $this->string(),
|
||||
'type' => $this->smallInteger(2)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('urls');
|
||||
}
|
||||
}
|
29
migrations/m170307_123524_create_settings_table.php
Normal file
29
migrations/m170307_123524_create_settings_table.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `settings`.
|
||||
*/
|
||||
class m170307_123524_create_settings_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('settings', [
|
||||
'id' => $this->primaryKey(),
|
||||
'param' => $this->string(),
|
||||
'value' => $this->string()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('settings');
|
||||
}
|
||||
}
|
32
migrations/m170309_080524_create_request_results_table.php
Normal file
32
migrations/m170309_080524_create_request_results_table.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `request_results`.
|
||||
*/
|
||||
class m170309_080524_create_request_results_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('request_results', [
|
||||
'id' => $this->bigPrimaryKey(),
|
||||
'request_id' => $this->bigInteger(),
|
||||
'type_id' => $this->smallInteger(2),
|
||||
'index' => $this->smallInteger(2),
|
||||
'data' => $this->text(),
|
||||
'cache_id' => $this->bigInteger()->defaultValue(null)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('request_results');
|
||||
}
|
||||
}
|
27
migrations/m170309_130045_add_refresh_to_requests.php
Normal file
27
migrations/m170309_130045_add_refresh_to_requests.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170309_130045_add_refresh_to_requests extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn(\app\models\SearchRequest::tableName(), "refresh", $this->boolean()->defaultValue(false));
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn(\app\models\SearchRequest::tableName(), "refresh");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
29
migrations/m170310_122737_add_is_vip_to_users.php
Normal file
29
migrations/m170310_122737_add_is_vip_to_users.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use app\models\User;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170310_122737_add_is_vip_to_users extends Migration
|
||||
{
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn(User::tableName(), "is_vip", $this->boolean()->defaultValue(false));
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn(User::tableName(), "is_vip");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
29
migrations/m170313_101638_create_files_table.php
Normal file
29
migrations/m170313_101638_create_files_table.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `files`.
|
||||
*/
|
||||
class m170313_101638_create_files_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('files', [
|
||||
'id' => $this->primaryKey(),
|
||||
'uuid' => $this->string(),
|
||||
'type' => $this->string(16)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('files');
|
||||
}
|
||||
}
|
31
migrations/m170323_114223_create_user_fingerprints_table.php
Normal file
31
migrations/m170323_114223_create_user_fingerprints_table.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `user_fingerprints`.
|
||||
*/
|
||||
class m170323_114223_create_user_fingerprints_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('user_fingerprints', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->bigInteger(),
|
||||
'ip' => $this->string(),
|
||||
'hash' => $this->string(),
|
||||
'tm' => $this->timestamp()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('user_fingerprints');
|
||||
}
|
||||
}
|
30
migrations/m170323_114243_create_user_ips_table.php
Normal file
30
migrations/m170323_114243_create_user_ips_table.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `user_ips`.
|
||||
*/
|
||||
class m170323_114243_create_user_ips_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('user_ips', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->bigInteger(),
|
||||
'ip' => $this->string(),
|
||||
'tm' => $this->timestamp()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('user_ips');
|
||||
}
|
||||
}
|
31
migrations/m170323_115442_create_user_evercookies_table.php
Normal file
31
migrations/m170323_115442_create_user_evercookies_table.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `user_evercookies`.
|
||||
*/
|
||||
class m170323_115442_create_user_evercookies_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('user_evercookies', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->bigInteger(),
|
||||
'ip' => $this->string(),
|
||||
'data' => $this->string(),
|
||||
'tm' => $this->timestamp()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('user_evercookies');
|
||||
}
|
||||
}
|
31
migrations/m170323_142901_add_user_fields.php
Normal file
31
migrations/m170323_142901_add_user_fields.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170323_142901_add_user_fields extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn("users", "is_test", $this->boolean()->defaultValue(false));
|
||||
$this->addColumn("users", "checks", $this->integer()->defaultValue(0));
|
||||
$this->addColumn("users", "plan", $this->smallInteger()->defaultValue(0));
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn("users", "plan");
|
||||
$this->dropColumn("users", "checks");
|
||||
$this->dropColumn("users", "is_test");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
28
migrations/m170324_084758_add_source_id_to_requests.php
Normal file
28
migrations/m170324_084758_add_source_id_to_requests.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
use app\models\SearchRequest;
|
||||
|
||||
class m170324_084758_add_source_id_to_requests extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn(SearchRequest::tableName(), 'source_id', $this->smallInteger());
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn(SearchRequest::tableName(), 'source_id');
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
49
migrations/m170327_094510_create_plans_table.php
Normal file
49
migrations/m170327_094510_create_plans_table.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `plans`.
|
||||
*/
|
||||
class m170327_094510_create_plans_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('plans', [
|
||||
'id' => $this->primaryKey(),
|
||||
'cost' => $this->integer(),
|
||||
'count' => $this->integer(),
|
||||
'title' => $this->string(),
|
||||
'status' => $this->boolean()->defaultValue(true)
|
||||
]);
|
||||
|
||||
$this->insert("plans", [
|
||||
"cost" => 40,
|
||||
"count" => 30,
|
||||
"title" => "Предоплаченный-30"
|
||||
]);
|
||||
|
||||
$this->insert("plans", [
|
||||
"cost" => 30,
|
||||
"count" => 50,
|
||||
"title" => "Предоплаченный-50"
|
||||
]);
|
||||
|
||||
$this->insert("plans", [
|
||||
"cost" => 25,
|
||||
"count" => 100,
|
||||
"title" => "Предоплаченный-100"
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('plans');
|
||||
}
|
||||
}
|
27
migrations/m170327_115426_add_status_to_user.php
Normal file
27
migrations/m170327_115426_add_status_to_user.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170327_115426_add_status_to_user extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn("users", "status", $this->smallInteger()->defaultValue(1));
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn("users", "status");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
36
migrations/m170328_142237_create_vk_table.php
Normal file
36
migrations/m170328_142237_create_vk_table.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `vk`.
|
||||
*/
|
||||
class m170328_142237_create_vk_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('vk', [
|
||||
'id' => $this->primaryKey(),
|
||||
'www' => $this->string(),
|
||||
'skype' => $this->string(),
|
||||
'instagram' => $this->string(),
|
||||
'twitter' => $this->string(),
|
||||
'facebook' => $this->string(),
|
||||
'phone1' => $this->string(),
|
||||
'phone2' => $this->string(),
|
||||
'phone3' => $this->string(),
|
||||
'phone4' => $this->string(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('vk');
|
||||
}
|
||||
}
|
29
migrations/m170329_083421_create_indexes.php
Normal file
29
migrations/m170329_083421_create_indexes.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170329_083421_create_indexes extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170329_083421_create_indexes cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
32
migrations/m170330_092131_add_indexes.php
Normal file
32
migrations/m170330_092131_add_indexes.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170330_092131_add_indexes extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->createIndex("idx_vk_phone1", "vk", "phone1");
|
||||
$this->createIndex("idx_vk_phone2", "vk", "phone2");
|
||||
|
||||
$this->createIndex("idx_requests", "requests", ["user_id", "phone"]);
|
||||
$this->createIndex("idx_request_results_id", "request_results", "request_id");
|
||||
$this->createIndex("idx_cache", "cache", ["phone", "type_id"]);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
//$this->dropIndex("idx_cache", "cache");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
34
migrations/m170330_104926_crate_user_contacts_table.php
Normal file
34
migrations/m170330_104926_crate_user_contacts_table.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170330_104926_crate_user_contacts_table extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('user_contacts', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->integer(),
|
||||
'name' => $this->string(),
|
||||
'phone' => $this->string(),
|
||||
'tm' => $this->timestamp(),
|
||||
'last_check' => $this->timestamp()->defaultValue(null)
|
||||
]);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('user_contacts');
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
29
migrations/m170403_071249_add_password_reset_token.php
Normal file
29
migrations/m170403_071249_add_password_reset_token.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170403_071249_add_password_reset_token extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn("users", "password_reset_token", $this->string());
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170403_071249_add_password_reset_token cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
27
migrations/m170404_123244_add_user_ip.php
Normal file
27
migrations/m170404_123244_add_user_ip.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170404_123244_add_user_ip extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn("users", "ip", $this->string());
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn("users", "ip");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
30
migrations/m170405_122703_create_tests_table.php
Normal file
30
migrations/m170405_122703_create_tests_table.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `tests`.
|
||||
*/
|
||||
class m170405_122703_create_tests_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('tests', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->integer(),
|
||||
'tm' => $this->dateTime(),
|
||||
'ip' => $this->string()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('tests');
|
||||
}
|
||||
}
|
27
migrations/m170405_142656_add_ban_column.php
Normal file
27
migrations/m170405_142656_add_ban_column.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170405_142656_add_ban_column extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn("users", "ban", $this->smallInteger()->defaultValue(0));
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn("users", "ban");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
33
migrations/m170412_083035_create_user_settings_table.php
Normal file
33
migrations/m170412_083035_create_user_settings_table.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `user_settings`.
|
||||
*/
|
||||
class m170412_083035_create_user_settings_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('user_settings', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->integer(),
|
||||
'param' => $this->string(),
|
||||
'value' => $this->string()
|
||||
]);
|
||||
|
||||
$this->createIndex("idx_user_settings_user_id", "user_settings", "user_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropIndex("idx_user_settings_user_id", "user_settings");
|
||||
$this->dropTable('user_settings');
|
||||
}
|
||||
}
|
27
migrations/m170413_142306_add_payed_field.php
Normal file
27
migrations/m170413_142306_add_payed_field.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170413_142306_add_payed_field extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn("requests", "is_payed", $this->smallInteger()->defaultValue(0));
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn("requests", "is_payed");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
29
migrations/m170414_122946_add_result_index.php
Normal file
29
migrations/m170414_122946_add_result_index.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170414_122946_add_result_index extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->createIndex("idx_request_result_request_id", "request_results", "request_id");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170414_122946_add_result_index cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
28
migrations/m170417_135938_create_vk_phones_table.php
Normal file
28
migrations/m170417_135938_create_vk_phones_table.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `vk_phones`.
|
||||
*/
|
||||
class m170417_135938_create_vk_phones_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('vk_phones', [
|
||||
'id' => $this->bigPrimaryKey(),
|
||||
'phone' => $this->string()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('vk_phones');
|
||||
}
|
||||
}
|
34
migrations/m170425_095137_create_gibdd_table.php
Normal file
34
migrations/m170425_095137_create_gibdd_table.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `gibdd`.
|
||||
*/
|
||||
class m170425_095137_create_gibdd_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('gibdd', [
|
||||
'tm' => $this->string(10),
|
||||
'number' => $this->string(10),
|
||||
'model' => $this->string(64),
|
||||
'year' => $this->string(4),
|
||||
'lastname' => $this->string(32),
|
||||
'firstname' => $this->string(32),
|
||||
'middlename' => $this->string(32),
|
||||
'phone' => $this->string(11),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('gibdd');
|
||||
}
|
||||
}
|
27
migrations/m170425_120322_create_idx_gibdd.php
Normal file
27
migrations/m170425_120322_create_idx_gibdd.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170425_120322_create_idx_gibdd extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->createIndex("idx_gibdd_phone", "gibdd", "phone");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropIndex("idx_gibdd_phone", "gibdd");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
29
migrations/m170425_135720_add_confirm_field.php
Normal file
29
migrations/m170425_135720_add_confirm_field.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170425_135720_add_confirm_field extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn("users", "is_confirm", $this->boolean()->defaultValue(false));
|
||||
$this->addColumn("users", "tm_confirm", $this->dateTime());
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn("users", "tm_confirm");
|
||||
$this->dropColumn("users", "is_confirm");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
27
migrations/m170512_120833_add_uuid_to_users.php
Normal file
27
migrations/m170512_120833_add_uuid_to_users.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170512_120833_add_uuid_to_users extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn('users', 'uuid', $this->string(64));
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn('users', 'uuid');
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
28
migrations/m170512_124345_create_vk_raw_table.php
Normal file
28
migrations/m170512_124345_create_vk_raw_table.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `vk_raw`.
|
||||
*/
|
||||
class m170512_124345_create_vk_raw_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('vk_raw', [
|
||||
'id' => $this->bigInteger(),
|
||||
'data' => $this->text()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('vk_raw');
|
||||
}
|
||||
}
|
27
migrations/m170515_073214_add_raw_index.php
Normal file
27
migrations/m170515_073214_add_raw_index.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170515_073214_add_raw_index extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->createIndex("idx_vk_raw", "vk_raw", "id");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropIndex("idx_vk_raw", "vk_raw");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
71
migrations/m170515_141117_create_sites_table.php
Normal file
71
migrations/m170515_141117_create_sites_table.php
Normal file
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `sites`.
|
||||
*/
|
||||
class m170515_141117_create_sites_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('sites', [
|
||||
'id' => $this->primaryKey(),
|
||||
'name' => $this->string(),
|
||||
'vk_id' => $this->string(),
|
||||
'vk_secret' => $this->string(),
|
||||
'fb_id' => $this->string(),
|
||||
'fb_secret' => $this->string(),
|
||||
'gg_id' => $this->string(),
|
||||
'gg_secret' => $this->string(),
|
||||
'metrika' => $this->text(),
|
||||
'analytics' => $this->text(),
|
||||
'is_demo' => $this->boolean()->defaultValue(false)
|
||||
]);
|
||||
|
||||
$this->insert("sites", [
|
||||
'name' => 'nomer.io',
|
||||
'vk_id' => '6003888',
|
||||
'vk_secret' => 'FJP4dBgt9nNoHobaoCuP',
|
||||
'fb_id' => '111376575615479',
|
||||
'fb_secret' => '872f80a004aded27370c629331e25d17',
|
||||
'gg_id' => '386713275441-pnfm2jjneeaveamci0sj7moe076n0td6.apps.googleusercontent.com',
|
||||
'gg_secret' => 'EaNe6T_tWn6dNErJ8NAPZ_Sh',
|
||||
'metrika' => '',
|
||||
'analytics' => '<script>(function(i,s,o,g,r,a,m){i[\'GoogleAnalyticsObject\']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,\'script\',\'https://www.google-analytics.com/analytics.js\',\'ga\');ga(\'create\', \'UA-96815159-1\', \'auto\');ga(\'send\', \'pageview\');</script>'
|
||||
]);
|
||||
|
||||
$this->insert("sites", [
|
||||
'name' => 'zagadok.net',
|
||||
'vk_id' => '6018017',
|
||||
'vk_secret' => 'Eci3odgYYyZTiZW5K0Vf',
|
||||
'fb_id' => '624551517738214',
|
||||
'fb_secret' => 'c6e28877f5cc2b93b2fec3fd67b39a7f',
|
||||
'gg_id' => '386713275441-pnfm2jjneeaveamci0sj7moe076n0td6.apps.googleusercontent.com',
|
||||
'gg_secret' => 'EaNe6T_tWn6dNErJ8NAPZ_Sh',
|
||||
'metrika' => '',
|
||||
'analytics' => '<script>(function(i,s,o,g,r,a,m){i[\'GoogleAnalyticsObject\']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,\'script\',\'https://www.google-analytics.com/analytics.js\',\'ga\');ga(\'create\', \'UA-98601031-1\', \'auto\');ga(\'send\', \'pageview\');</script>'
|
||||
]);
|
||||
|
||||
$this->insert("sites", [
|
||||
'name' => 'zapalil.com',
|
||||
'fb_id' => '1772125642814426',
|
||||
'fb_secret' => '2c25ca09b5477f5ce7d51f33c002cd53',
|
||||
'gg_id' => '386713275441-pnfm2jjneeaveamci0sj7moe076n0td6.apps.googleusercontent.com',
|
||||
'gg_secret' => 'EaNe6T_tWn6dNErJ8NAPZ_Sh',
|
||||
]);
|
||||
|
||||
$this->addColumn(\app\models\SearchRequest::tableName(), 'site_id', $this->smallInteger());
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('sites');
|
||||
}
|
||||
}
|
29
migrations/m170518_072322_add_payment_type.php
Normal file
29
migrations/m170518_072322_add_payment_type.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170518_072322_add_payment_type extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn(\app\models\Payment::tableName(), "type_id", $this->smallInteger());
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170518_072322_add_payment_type cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
31
migrations/m170522_113829_create_webmoney_orders_table.php
Normal file
31
migrations/m170522_113829_create_webmoney_orders_table.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `webmoney_orders`.
|
||||
*/
|
||||
class m170522_113829_create_webmoney_orders_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('webmoney_orders', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->integer(),
|
||||
'tm_create' => $this->timestamp()->defaultExpression('NOW()'),
|
||||
'sum' => $this->string(),
|
||||
'status' => $this->smallInteger()->defaultValue(0)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('webmoney_orders');
|
||||
}
|
||||
}
|
31
migrations/m170523_101628_create_checks_log_table.php
Normal file
31
migrations/m170523_101628_create_checks_log_table.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `checks_log`.
|
||||
*/
|
||||
class m170523_101628_create_checks_log_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('checks_log', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->integer(),
|
||||
'cehcks' => $this->smallInteger(),
|
||||
'admin_id' => $this->integer(),
|
||||
'tm' => $this->timestamp()->defaultExpression('NOW()')
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('checks_log');
|
||||
}
|
||||
}
|
33
migrations/m170524_142757_add_fields_to_sites.php
Normal file
33
migrations/m170524_142757_add_fields_to_sites.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170524_142757_add_fields_to_sites extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->dropColumn('sites', 'analytics');
|
||||
$this->dropColumn('sites', 'metrika');
|
||||
$this->addColumn('sites', 'phone', $this->string());
|
||||
$this->addColumn('sites', 'yandex_money_account', $this->string());
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn('sites', 'yandex_money_account');
|
||||
$this->dropColumn('sites', 'phone');
|
||||
$this->addColumn('sites', 'metrika', $this->text());
|
||||
$this->addColumn('sites', 'analytics', $this->text());
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
30
migrations/m170525_104549_add_site_id_to_payments.php
Normal file
30
migrations/m170525_104549_add_site_id_to_payments.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170525_104549_add_site_id_to_payments extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn(\app\models\WebmoneyOrder::tableName(), "site_id", $this->smallInteger());
|
||||
$this->addColumn(\app\models\Payment::tableName(), "site_id", $this->smallInteger());
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170525_104549_add_site_id_to_payments cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
43
migrations/m170529_130558_create_geo_table.php
Normal file
43
migrations/m170529_130558_create_geo_table.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `geo`.
|
||||
*/
|
||||
class m170529_130558_create_geo_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('geo', [
|
||||
'geoname_id' => $this->integer(),
|
||||
'locale_code' => $this->string(),
|
||||
'continent_code' => $this->string(),
|
||||
'continent_name' => $this->string(),
|
||||
'country_iso_code' => $this->string(),
|
||||
'country_name' => $this->string(),
|
||||
'subdivision_1_iso_code' => $this->string(),
|
||||
'subdivision_1_name' => $this->string(),
|
||||
'subdivision_2_iso_code' => $this->string(),
|
||||
'subdivision_2_name' => $this->string(),
|
||||
'city_name' => $this->string(),
|
||||
'metro_code' => $this->string(),
|
||||
'time_zone' => $this->string(),
|
||||
]);
|
||||
|
||||
$this->createIndex("idx_geo_id", "geo", "geoname_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropIndex("idx_geo_id", "geo");
|
||||
|
||||
$this->dropTable('geo');
|
||||
}
|
||||
}
|
27
migrations/m170529_132850_add_geo_id_field_to_users.php
Normal file
27
migrations/m170529_132850_add_geo_id_field_to_users.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170529_132850_add_geo_id_field_to_users extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn('users', 'geo_id', $this->integer());
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn('users', 'geo_id');
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
27
migrations/m170529_160249_add_site_comment.php
Normal file
27
migrations/m170529_160249_add_site_comment.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170529_160249_add_site_comment extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn(\app\models\Site::tableName(), "comment", $this->string());
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn(\app\models\Site::tableName(), "comment");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
33
migrations/m170530_140903_create_wallets_table.php
Normal file
33
migrations/m170530_140903_create_wallets_table.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `wallets`.
|
||||
*/
|
||||
class m170530_140903_create_wallets_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('wallets', [
|
||||
'id' => $this->primaryKey(),
|
||||
'type_id' => $this->smallInteger(),
|
||||
'wallet_id' => $this->string(),
|
||||
'password' => $this->string(),
|
||||
'balance' => $this->double(2),
|
||||
'tm_last_balance' => $this->timestamp(),
|
||||
'tm_last_transaction' => $this->timestamp()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('wallets');
|
||||
}
|
||||
}
|
56
migrations/m170530_145610_create_tokens_table.php
Normal file
56
migrations/m170530_145610_create_tokens_table.php
Normal file
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `tokens`.
|
||||
*/
|
||||
class m170530_145610_create_tokens_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('tokens', [
|
||||
'id' => $this->primaryKey(),
|
||||
'type' => $this->smallInteger(),
|
||||
'token' => $this->string(),
|
||||
'status' => $this->smallInteger()->defaultValue(1),
|
||||
'tm_ban' => $this->timestamp()
|
||||
]);
|
||||
|
||||
$this->insert('tokens', [
|
||||
'type' => 1,
|
||||
'token' => 'ErqH2RfLL_X2UubBtc_jt8VKF3cXtsic'
|
||||
]);
|
||||
|
||||
$this->insert('tokens', [
|
||||
'type' => 1,
|
||||
'token' => 'bGJ6WkDMnFa28s8ndi4eOe57H3cXw09r'
|
||||
]);
|
||||
|
||||
$this->insert('tokens', [
|
||||
'type' => 1,
|
||||
'token' => 'HM~J_5AbOT1lQAt_XB9Ryol353cXxT15'
|
||||
]);
|
||||
|
||||
$this->insert('tokens', [
|
||||
'type' => 1,
|
||||
'token' => '-eMqbxzUV1P-SK_Grs9z5AJI43cYB6U2'
|
||||
]);
|
||||
|
||||
$this->insert('tokens', [
|
||||
'type' => 1,
|
||||
'token' => 'RRgxoy2HdIMC4Rg2S2SOWLruT3cYB~He'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('tokens');
|
||||
}
|
||||
}
|
35
migrations/m170531_084058_create_user_auth_log_table.php
Normal file
35
migrations/m170531_084058_create_user_auth_log_table.php
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `user_auth_log`.
|
||||
*/
|
||||
class m170531_084058_create_user_auth_log_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('user_auth_log', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->integer(),
|
||||
'site_id' => $this->smallInteger(),
|
||||
'ip' => $this->string(),
|
||||
'tm' => $this->timestamp()
|
||||
]);
|
||||
|
||||
$this->createIndex("idx_user_auth_log_user_id", "user_auth_log", "user_id");
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropIndex("idx_user_auth_log_user_id", "user_auth_log");
|
||||
|
||||
$this->dropTable('user_auth_log');
|
||||
}
|
||||
}
|
29
migrations/m170531_095653_create_proxies_table.php
Normal file
29
migrations/m170531_095653_create_proxies_table.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `proxies`.
|
||||
*/
|
||||
class m170531_095653_create_proxies_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('proxies', [
|
||||
'id' => $this->primaryKey(),
|
||||
'host' => $this->string(),
|
||||
'port' => $this->smallInteger(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('proxies');
|
||||
}
|
||||
}
|
91
migrations/m170531_121425_wallet_update.php
Normal file
91
migrations/m170531_121425_wallet_update.php
Normal file
|
@ -0,0 +1,91 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
use app\models\Wallet;
|
||||
|
||||
class m170531_121425_wallet_update extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn(Wallet::tableName(), "login", $this->string());
|
||||
$this->alterColumn(Wallet::tableName(), "balance", $this->decimal(24, 4));
|
||||
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_YANDEX,
|
||||
"wallet_id" => "410014057045840",
|
||||
"login" => "mezhevikina.masha@yandex.ru",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_YANDEX,
|
||||
"wallet_id" => "410014074158389",
|
||||
"login" => "tarasov.pavel.2018@yandex.ru",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_YANDEX,
|
||||
"wallet_id" => "410015251188084",
|
||||
"login" => "evgeniy.sokolov.2018@yandex.ru",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_YANDEX,
|
||||
"wallet_id" => "410015251417595",
|
||||
"login" => "bistrov.anton.2018@yandex.ru",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_YANDEX,
|
||||
"wallet_id" => "410015251454465",
|
||||
"login" => "kokorin.alexander.2018@yandex.ru",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_YANDEX,
|
||||
"wallet_id" => "410015274661660",
|
||||
"login" => "efimov.ilya.2018@yandex.ru",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_YANDEX,
|
||||
"wallet_id" => "410014080147590",
|
||||
"login" => "eliseenkova.elena.2018@yandex.ru",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_YANDEX,
|
||||
"wallet_id" => "410015267023628",
|
||||
"login" => "avakova.karina.1994@yandex.ru",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_YANDEX,
|
||||
"wallet_id" => "410015267675498",
|
||||
"login" => "petrusevitch.vladislav@yandex.ru",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_YANDEX,
|
||||
"wallet_id" => "410014090959566",
|
||||
"login" => "alexandr.kowal2018@yandex.ru",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn(Wallet::tableName(), "login");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
95
migrations/m170531_152701_add_qiwi_wallets.php
Normal file
95
migrations/m170531_152701_add_qiwi_wallets.php
Normal file
|
@ -0,0 +1,95 @@
|
|||
<?php
|
||||
|
||||
use app\models\Wallet;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170531_152701_add_qiwi_wallets extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_QIWI,
|
||||
"wallet_id" => "+79296436441",
|
||||
"login" => "79296436441",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_QIWI,
|
||||
"wallet_id" => "+79295595315",
|
||||
"login" => "79295595315",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_QIWI,
|
||||
"wallet_id" => "+79295595275",
|
||||
"login" => "79295595275",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_QIWI,
|
||||
"wallet_id" => "+79295595634",
|
||||
"login" => "79295595634",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_QIWI,
|
||||
"wallet_id" => "+79295595705",
|
||||
"login" => "79295595705",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_QIWI,
|
||||
"wallet_id" => "+79295595495",
|
||||
"login" => "79295595495",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_QIWI,
|
||||
"wallet_id" => "+79295595285",
|
||||
"login" => "79295595285",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_QIWI,
|
||||
"wallet_id" => "+79295595725",
|
||||
"login" => "79295595725",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_QIWI,
|
||||
"wallet_id" => "+79295595815",
|
||||
"login" => "79295595815",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_QIWI,
|
||||
"wallet_id" => "+79295595206",
|
||||
"login" => "79295595206",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
$this->insert(Wallet::tableName(), [
|
||||
"type_id" => Wallet::TYPE_QIWI,
|
||||
"wallet_id" => "+79269516206",
|
||||
"login" => "79269516206",
|
||||
"password" => "Ag6K2oxG"
|
||||
]);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170531_152701_add_qiwi_wallets cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
29
migrations/m170601_092548_add_fields_to_wallets.php
Normal file
29
migrations/m170601_092548_add_fields_to_wallets.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170601_092548_add_fields_to_wallets extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn(\app\models\Wallet::tableName(), "tm_last_transaction_out", $this->timestamp());
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170601_092548_add_fields_to_wallets cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
64
migrations/m170605_071802_add_request_fields.php
Normal file
64
migrations/m170605_071802_add_request_fields.php
Normal file
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
use \app\models\SearchRequest;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\helpers\Json;
|
||||
|
||||
class m170605_071802_add_request_fields extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn(SearchRequest::tableName(), "is_has_name", $this->boolean()->defaultValue(false));
|
||||
$this->addColumn(SearchRequest::tableName(), "is_has_photo", $this->boolean()->defaultValue(false));
|
||||
|
||||
$i = 0;
|
||||
foreach(SearchRequest::find()->with("results")->orderBy(["id" => SORT_ASC])->batch(100) as $requests) {
|
||||
$i += 100;
|
||||
foreach($requests as $r) {
|
||||
/* @var app\models\SearchRequest $r */
|
||||
$names = $photos = [];
|
||||
$results = \app\models\RequestResult::find()->where(["request_id" => $r->id])->all();
|
||||
foreach($results as $result) {
|
||||
try {
|
||||
$data = Json::decode($result->data);
|
||||
if($data && is_array($data)) {
|
||||
$names = ArrayHelper::merge($names, ArrayHelper::getColumn($data, "name"));
|
||||
$photos = ArrayHelper::merge($photos, ArrayHelper::getColumn($data, "photo"));
|
||||
}
|
||||
} catch(Exception $e) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$names = array_filter($names);
|
||||
$photos = array_filter($photos);
|
||||
if($names) {
|
||||
$r->is_has_name = true;
|
||||
}
|
||||
if($photos) {
|
||||
$r->is_has_photo = true;
|
||||
}
|
||||
$r->save();
|
||||
}
|
||||
\yii\helpers\Console::output("proccessed: ".$i);
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn(SearchRequest::tableName(), "is_has_name");
|
||||
$this->dropColumn(SearchRequest::tableName(), "is_has_photo");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
49
migrations/m170605_102413_create_telegrams_table.php
Normal file
49
migrations/m170605_102413_create_telegrams_table.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `telegrams`.
|
||||
*/
|
||||
class m170605_102413_create_telegrams_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('telegrams', [
|
||||
'id' => $this->primaryKey(),
|
||||
'host' => $this->string(),
|
||||
'port' => $this->smallInteger(),
|
||||
'status' => $this->smallInteger()->defaultValue(1),
|
||||
'tm_last' => $this->timestamp()
|
||||
]);
|
||||
|
||||
$instances = [
|
||||
'127.0.0.1:1236',
|
||||
'5.104.111.8:1236',
|
||||
'46.4.69.117:1236',
|
||||
'46.4.202.77:1236',
|
||||
'46.4.202.75:1236',
|
||||
'46.4.202.78:1236',
|
||||
];
|
||||
|
||||
foreach ($instances as $instance) {
|
||||
list($host, $port) = explode(':', $instance);
|
||||
|
||||
$this->insert('telegrams', [
|
||||
'host' => $host,
|
||||
'port' => $port
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('telegrams');
|
||||
}
|
||||
}
|
30
migrations/m170605_144207_add_ref_columns.php
Normal file
30
migrations/m170605_144207_add_ref_columns.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
use \app\models\User;
|
||||
|
||||
class m170605_144207_add_ref_columns extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn(User::tableName(), "ref_id", $this->integer());
|
||||
$this->addColumn(User::tableName(), "ref_checks", $this->decimal(24, 4));
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn(User::tableName(), "ref_id");
|
||||
$this->dropColumn(User::tableName(), "ref_checks");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
34
migrations/m170606_153714_add_reposts_table.php
Normal file
34
migrations/m170606_153714_add_reposts_table.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170606_153714_add_reposts_table extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->createTable("reposts", [
|
||||
"id" => $this->primaryKey(),
|
||||
"user_id" => $this->integer(),
|
||||
"site_id" => $this->smallInteger(),
|
||||
"vk_id" => $this->bigInteger(),
|
||||
"tm" => $this->timestamp(),
|
||||
"status" => $this->smallInteger()->defaultValue(1)
|
||||
]);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable("reposts");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
32
migrations/m170616_124111_create_plati_codes_table.php
Normal file
32
migrations/m170616_124111_create_plati_codes_table.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `plati_codes`.
|
||||
*/
|
||||
class m170616_124111_create_plati_codes_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('plati_codes', [
|
||||
'id' => $this->primaryKey(),
|
||||
'code' => $this->string(),
|
||||
'checks' => $this->smallInteger(),
|
||||
'user_id' => $this->integer()->defaultValue(null),
|
||||
'tm_create' => $this->timestamp()->defaultExpression('NOW()'),
|
||||
'tm_used' => $this->timestamp(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('plati_codes');
|
||||
}
|
||||
}
|
29
migrations/m170619_131613_add_platiru_to_sites.php
Normal file
29
migrations/m170619_131613_add_platiru_to_sites.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170619_131613_add_platiru_to_sites extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn(\app\models\Site::tableName(), "platiru_id", $this->integer());
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170619_131613_add_platiru_to_sites cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
30
migrations/m170619_135243_create_links_table.php
Normal file
30
migrations/m170619_135243_create_links_table.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `links`.
|
||||
*/
|
||||
class m170619_135243_create_links_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('links', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->integer(),
|
||||
'code' => $this->string()->unique(),
|
||||
'tm' => $this->timestamp()->defaultExpression('NOW()')
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('links');
|
||||
}
|
||||
}
|
29
migrations/m170620_133102_add_sms_count_to_reposts.php
Normal file
29
migrations/m170620_133102_add_sms_count_to_reposts.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170620_133102_add_sms_count_to_reposts extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn(\app\models\Repost::tableName(), "sms_count", $this->smallInteger());
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170620_133102_add_sms_count_to_reposts cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
27
migrations/m170626_133943_add_comment_field_to_user.php
Normal file
27
migrations/m170626_133943_add_comment_field_to_user.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170626_133943_add_comment_field_to_user extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn('users', 'comment', $this->string(255));
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn('users', 'comment');
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
27
migrations/m170627_105937_add_server_id_to_tokens.php
Normal file
27
migrations/m170627_105937_add_server_id_to_tokens.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170627_105937_add_server_id_to_tokens extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn('tokens', 'server_id', $this->integer()->defaultValue(0));
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn('tokens', 'server_id');
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
29
migrations/m170629_145257_add_fields_to_wallet.php
Normal file
29
migrations/m170629_145257_add_fields_to_wallet.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170629_145257_add_fields_to_wallet extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn(\app\models\Wallet::tableName(), "phone", $this->string(11));
|
||||
$this->addColumn(\app\models\Wallet::tableName(), "comment", $this->text());
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn(\app\models\Wallet::tableName(), "phone");
|
||||
$this->dropColumn(\app\models\Wallet::tableName(), "comment");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
31
migrations/m170630_165222_add_site_id_field_to_wallets.php
Normal file
31
migrations/m170630_165222_add_site_id_field_to_wallets.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170630_165222_add_site_id_field_to_wallets extends Migration
|
||||
{
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn('wallets', 'site_id', $this->integer());
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropColumn('wallets', 'site_id');
|
||||
}
|
||||
|
||||
/*
|
||||
// Use up()/down() to run migration code without a transaction.
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170630_165222_add_site_id_field_to_wallets cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
27
migrations/m170703_121032_create_idx_requests.php
Normal file
27
migrations/m170703_121032_create_idx_requests.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170703_121032_create_idx_requests extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->createIndex("idx_requets_tm", \app\models\SearchRequest::tableName(), "tm");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
33
migrations/m170703_122115_create_orgs_table.php
Normal file
33
migrations/m170703_122115_create_orgs_table.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `orgs`.
|
||||
*/
|
||||
class m170703_122115_create_orgs_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('orgs', [
|
||||
'id' => $this->primaryKey(),
|
||||
'name' => $this->string(),
|
||||
'date' => $this->string(),
|
||||
'maximum_sum' => $this->decimal(20, 4),
|
||||
'inn' => $this->string(),
|
||||
'number' => $this->string(),
|
||||
'region' => $this->string()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('orgs');
|
||||
}
|
||||
}
|
30
migrations/m170703_122126_create_org_phones_table.php
Normal file
30
migrations/m170703_122126_create_org_phones_table.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `org_phones`.
|
||||
*/
|
||||
class m170703_122126_create_org_phones_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('org_phones', [
|
||||
'id' => $this->primaryKey(),
|
||||
'org_id' => $this->integer(),
|
||||
'name' => $this->string(),
|
||||
'phone' => $this->string()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('org_phones');
|
||||
}
|
||||
}
|
30
migrations/m170703_122148_create_org_emails_table.php
Normal file
30
migrations/m170703_122148_create_org_emails_table.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `org_emails`.
|
||||
*/
|
||||
class m170703_122148_create_org_emails_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('org_emails', [
|
||||
'id' => $this->primaryKey(),
|
||||
'org_id' => $this->integer(),
|
||||
'name' => $this->string(),
|
||||
'email' => $this->string()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('org_emails');
|
||||
}
|
||||
}
|
34
migrations/m170703_155449_create_vk_comments_table.php
Normal file
34
migrations/m170703_155449_create_vk_comments_table.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `vk_comments`.
|
||||
*/
|
||||
class m170703_155449_create_vk_comments_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('vk_comments', [
|
||||
'id' => $this->integer(),
|
||||
'pid' => $this->integer()->defaultValue(0),
|
||||
'site_id' => $this->smallInteger(),
|
||||
'tm' => $this->dateTime(),
|
||||
'name' => $this->string(),
|
||||
'comment' => $this->text(),
|
||||
'vk_id' => $this->string(),
|
||||
'photo' => $this->text()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('vk_comments');
|
||||
}
|
||||
}
|
33
migrations/m170704_151012_create_calls_table.php
Normal file
33
migrations/m170704_151012_create_calls_table.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `calls`.
|
||||
*/
|
||||
class m170704_151012_create_calls_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('calls', [
|
||||
'id' => $this->primaryKey(),
|
||||
'tm' => $this->timestamp(),
|
||||
'cuid' => $this->string(),
|
||||
'duration' => $this->integer(),
|
||||
'status' => $this->string(),
|
||||
'phone' => $this->bigInteger()
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('calls');
|
||||
}
|
||||
}
|
31
migrations/m170705_100414_add_phone2_to_org_phones.php
Normal file
31
migrations/m170705_100414_add_phone2_to_org_phones.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170705_100414_add_phone2_to_org_phones extends Migration
|
||||
{
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn('org_phones', 'phone2', $this->string());
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropColumn('org_phones', 'phone2');
|
||||
}
|
||||
|
||||
/*
|
||||
// Use up()/down() to run migration code without a transaction.
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170705_100414_add_phone2_to_org_phones cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
31
migrations/m170710_080032_add_site_id_to_block.php
Normal file
31
migrations/m170710_080032_add_site_id_to_block.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170710_080032_add_site_id_to_block extends Migration
|
||||
{
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn(\app\models\BlockPhone::tableName(), "site_id", $this->smallInteger()->defaultValue(0));
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropColumn(\app\models\BlockPhone::tableName(), "site_id");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use up()/down() to run migration code without a transaction.
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170710_080032_add_site_id_to_block cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
32
migrations/m170714_150526_create_free_table.php
Normal file
32
migrations/m170714_150526_create_free_table.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `free`.
|
||||
*/
|
||||
class m170714_150526_create_free_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('free', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->integer(),
|
||||
'checks' => $this->integer(),
|
||||
'uuid' => $this->string(),
|
||||
'type_id' => $this->smallInteger(),
|
||||
'tm' => $this->timestamp()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('free');
|
||||
}
|
||||
}
|
31
migrations/m170731_154223_add_ref_balance_to_user.php
Normal file
31
migrations/m170731_154223_add_ref_balance_to_user.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170731_154223_add_ref_balance_to_user extends Migration
|
||||
{
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn("users", "ref_balance", $this->decimal(24, 4)->defaultValue(0));
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropColumn("users", "ref_balance");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use up()/down() to run migration code without a transaction.
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170731_154223_add_ref_balance_to_user cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
33
migrations/m170803_141247_create_checkouts_table.php
Normal file
33
migrations/m170803_141247_create_checkouts_table.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `checkouts`.
|
||||
*/
|
||||
class m170803_141247_create_checkouts_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('checkouts', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->integer(),
|
||||
'wallet' => $this->string(),
|
||||
'sum' => $this->decimal(24, 4),
|
||||
'tm_create' => $this->timestamp(),
|
||||
'tm_done' => $this->timestamp(),
|
||||
'status' => $this->smallInteger(1)->defaultValue(0)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('checkouts');
|
||||
}
|
||||
}
|
31
migrations/m170807_140534_add_sites_test_field.php
Normal file
31
migrations/m170807_140534_add_sites_test_field.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170807_140534_add_sites_test_field extends Migration
|
||||
{
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn(\app\models\Site::tableName(), "type_id", $this->smallInteger()->defaultValue(1));
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropColumn(\app\models\Site::tableName(), "type_id");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use up()/down() to run migration code without a transaction.
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170807_140534_add_sites_test_field cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
34
migrations/m170816_151727_create_phone_request_table.php
Normal file
34
migrations/m170816_151727_create_phone_request_table.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `phone_request`.
|
||||
*/
|
||||
class m170816_151727_create_phone_request_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('phone_request', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->integer()->defaultValue(null),
|
||||
'tm' => $this->dateTime()->defaultExpression('NOW()'),
|
||||
'ip' => $this->string(),
|
||||
'data' => $this->text(),
|
||||
'wallet' => $this->string(),
|
||||
'contact' => $this->string(),
|
||||
'status' => $this->smallInteger()->defaultValue(0)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('phone_request');
|
||||
}
|
||||
}
|
37
migrations/m170822_144025_create_tickets_table.php
Normal file
37
migrations/m170822_144025_create_tickets_table.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `tickets`.
|
||||
*/
|
||||
class m170822_144025_create_tickets_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('tickets', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->integer(),
|
||||
'site_id' => $this->smallInteger(),
|
||||
'ip' => $this->string(15),
|
||||
'subject_id' => $this->smallInteger(2),
|
||||
'text' => $this->text(),
|
||||
'status' => $this->smallInteger(1),
|
||||
'tm_create' => $this->dateTime(),
|
||||
'tm_read' => $this->dateTime(),
|
||||
'tm_close' => $this->dateTime(),
|
||||
'tm_reopen' => $this->dateTime(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('tickets');
|
||||
}
|
||||
}
|
32
migrations/m170822_144033_create_ticket_comments_table.php
Normal file
32
migrations/m170822_144033_create_ticket_comments_table.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `ticket_comments`.
|
||||
*/
|
||||
class m170822_144033_create_ticket_comments_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('ticket_comments', [
|
||||
'id' => $this->primaryKey(),
|
||||
'ticket_id' => $this->integer(),
|
||||
'user_id' => $this->integer(),
|
||||
'text' => $this->text(),
|
||||
'tm_create' => $this->timestamp(),
|
||||
'tm_read' => $this->timestamp()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('ticket_comments');
|
||||
}
|
||||
}
|
32
migrations/m170823_125021_add_subject_to_tickets.php
Normal file
32
migrations/m170823_125021_add_subject_to_tickets.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
use \app\models\Ticket;
|
||||
|
||||
class m170823_125021_add_subject_to_tickets extends Migration
|
||||
{
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn(Ticket::tableName(), 'subject', $this->string());
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropColumn(Ticket::tableName(), 'subject');
|
||||
}
|
||||
|
||||
/*
|
||||
// Use up()/down() to run migration code without a transaction.
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170823_125021_add_subject_to_tickets cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
33
migrations/m170823_173144_add_comment_type_column.php
Normal file
33
migrations/m170823_173144_add_comment_type_column.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170823_173144_add_comment_type_column extends Migration
|
||||
{
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn(\app\models\TicketComment::tableName(), "type_id", $this->smallInteger(1)->defaultValue(0));
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
echo "m170823_173144_add_comment_type_column cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use up()/down() to run migration code without a transaction.
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170823_173144_add_comment_type_column cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
34
migrations/m170824_164534_add_is_deleted_to_tickets.php
Normal file
34
migrations/m170824_164534_add_is_deleted_to_tickets.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170824_164534_add_is_deleted_to_tickets extends Migration
|
||||
{
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn(\app\models\Ticket::tableName(), "is_deleted", $this->boolean()->defaultValue(false));
|
||||
$this->addColumn(\app\models\TicketComment::tableName(), "is_deleted", $this->boolean()->defaultValue(false));
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
echo "m170824_164534_add_is_deleted_to_tickets cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use up()/down() to run migration code without a transaction.
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170824_164534_add_is_deleted_to_tickets cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
29
migrations/m170825_090236_create_ticket_replies_table.php
Normal file
29
migrations/m170825_090236_create_ticket_replies_table.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `ticket_replies`.
|
||||
*/
|
||||
class m170825_090236_create_ticket_replies_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('ticket_replies', [
|
||||
'id' => $this->primaryKey(),
|
||||
'subject_id' => $this->smallInteger(),
|
||||
'text' => $this->text()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('ticket_replies');
|
||||
}
|
||||
}
|
33
migrations/m170825_143708_add_url_to_tickets.php
Normal file
33
migrations/m170825_143708_add_url_to_tickets.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170825_143708_add_url_to_tickets extends Migration
|
||||
{
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn(\app\models\Ticket::tableName(), "url", $this->string());
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
echo "m170825_143708_add_url_to_tickets cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use up()/down() to run migration code without a transaction.
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170825_143708_add_url_to_tickets cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
31
migrations/m170906_141917_add_status_to_wallets.php
Normal file
31
migrations/m170906_141917_add_status_to_wallets.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170906_141917_add_status_to_wallets extends Migration
|
||||
{
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn(\app\models\Wallet::tableName(), "status", $this->boolean()->defaultValue(true));
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropColumn(\app\models\Wallet::tableName(), "status");
|
||||
}
|
||||
|
||||
/*
|
||||
// Use up()/down() to run migration code without a transaction.
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170906_141917_add_status_to_wallets cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
32
migrations/m170915_134028_create_subs_table.php
Normal file
32
migrations/m170915_134028_create_subs_table.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `subs`.
|
||||
*/
|
||||
class m170915_134028_create_subs_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('subs', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->integer(),
|
||||
'transaction_id' => $this->bigInteger(),
|
||||
'original_transaction_id' => $this->bigInteger(),
|
||||
'tm_purchase' => $this->dateTime(),
|
||||
'tm_expires' => $this->dateTime()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('subs');
|
||||
}
|
||||
}
|
33
migrations/m171108_113652_add_token_to_user.php
Normal file
33
migrations/m171108_113652_add_token_to_user.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m171108_113652_add_token_to_user extends Migration
|
||||
{
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn(\app\models\User::tableName(), "token", $this->string());
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
echo "m171108_113652_add_token_to_user cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use up()/down() to run migration code without a transaction.
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m171108_113652_add_token_to_user cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
31
migrations/m171108_113709_create_notifications_table.php
Normal file
31
migrations/m171108_113709_create_notifications_table.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `notifications`.
|
||||
*/
|
||||
class m171108_113709_create_notifications_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('notifications', [
|
||||
'id' => $this->primaryKey(),
|
||||
'message' => $this->string(),
|
||||
'payload' => $this->text(),
|
||||
'tm_create' => $this->dateTime(),
|
||||
'tm_send' => $this->dateTime()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('notifications');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `notification_results`.
|
||||
*/
|
||||
class m171108_113716_create_notification_results_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('notification_results', [
|
||||
'id' => $this->primaryKey(),
|
||||
'notify_id' => $this->integer(),
|
||||
'user_id' => $this->integer(),
|
||||
'status' => $this->smallInteger()->defaultValue(0)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('notification_results');
|
||||
}
|
||||
}
|
33
migrations/m171109_162222_add_payment_source.php
Normal file
33
migrations/m171109_162222_add_payment_source.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m171109_162222_add_payment_source extends Migration
|
||||
{
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn(\app\models\Payment::tableName(), "source", $this->string());
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
echo "m171109_162222_add_payment_source cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use up()/down() to run migration code without a transaction.
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m171109_162222_add_payment_source cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
33
migrations/m180106_094343_add_status_to_subs.php
Normal file
33
migrations/m180106_094343_add_status_to_subs.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m180106_094343_add_status_to_subs extends Migration
|
||||
{
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn(\app\models\UserSub::tableName(), "status", $this->smallInteger()->defaultValue(1));
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
echo "m180106_094343_add_status_to_subs cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use up()/down() to run migration code without a transaction.
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m180106_094343_add_status_to_subs cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `apple_subscribe_events`.
|
||||
*/
|
||||
class m180115_155041_create_apple_subscribe_events_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('apple_subscribe_events', [
|
||||
'id' => $this->primaryKey(),
|
||||
'event_date' => $this->date(),
|
||||
'event' => $this->string(),
|
||||
'app_name' => $this->string(),
|
||||
'app_id' => $this->bigInteger(),
|
||||
'subscription_name' => $this->string(),
|
||||
'subscription_id' => $this->bigInteger(),
|
||||
'subscription_group_id' => $this->bigInteger(),
|
||||
'subscription_duration' => $this->string(),
|
||||
'introductory_price_type' => $this->string(),
|
||||
'introductory_price_duration' => $this->string(),
|
||||
'marketing_opt_in' => $this->string(),
|
||||
'marketing_opt_in_duration' => $this->string(),
|
||||
'preserved_pricing' => $this->string(),
|
||||
'proceeds_reason' => $this->string(),
|
||||
'consecutive_paid_periods' => $this->smallInteger(),
|
||||
'original_start_date' => $this->date(),
|
||||
'client' => $this->string(),
|
||||
'device' => $this->string(),
|
||||
'state' => $this->string(),
|
||||
'country' => $this->string(),
|
||||
'previous_subscription_name' => $this->string(),
|
||||
'previous_subscription_id' => $this->bigInteger(),
|
||||
'days_before_canceling' => $this->smallInteger(),
|
||||
'cancellation_reason' => $this->string(),
|
||||
'days_canceled' => $this->smallInteger(),
|
||||
'quantity' => $this->smallInteger(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('apple_subscribe_events');
|
||||
}
|
||||
}
|
31
migrations/m180212_111851_create_apple_table.php
Normal file
31
migrations/m180212_111851_create_apple_table.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `apple`.
|
||||
*/
|
||||
class m180212_111851_create_apple_table extends Migration
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$this->createTable('apple_payments', [
|
||||
'id' => $this->primaryKey(),
|
||||
'tm' => $this->date(),
|
||||
'sum' => $this->decimal(24, 4),
|
||||
'amount' => $this->decimal(24, 4),
|
||||
'refund' => $this->decimal(24, 4)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('apple');
|
||||
}
|
||||
}
|
31
migrations/m180214_070318_add_is_payed_to_tickets.php
Normal file
31
migrations/m180214_070318_add_is_payed_to_tickets.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m180214_070318_add_is_payed_to_tickets extends Migration
|
||||
{
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn(\app\models\Ticket::tableName(), "is_payed", $this->boolean()->defaultValue(false));
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
// Use up()/down() to run migration code without a transaction.
|
||||
public function up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m180214_070318_add_is_payed_to_tickets cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue