/
var
/
www
/
vhosts
/
nabawater
/
vendor
/
dektrium
/
yii2-user
/
migrations
/
/var/www/vhosts/nabawater/vendor/dektrium/yii2-user/migrations
mkdir
upload
Name
Size
Mode
Actions
m140209_132017_init.php
2805
0644
edit
dl
rm
m140403_174025_create_account_table.php
1106
0644
edit
dl
rm
m140504_113157_update_tables.php
2344
0644
edit
dl
rm
m140504_130429_create_token_table.php
1060
0644
edit
dl
rm
m140830_171933_fix_ip_field.php
635
0644
edit
dl
rm
m140830_172703_change_account_table_name.php
623
0644
edit
dl
rm
m141222_110026_update_ip_field.php
2092
0644
edit
dl
rm
m141222_135246_alter_username_length.php
1420
0644
edit
dl
rm
m150614_103145_update_social_account_table.php
1509
0644
edit
dl
rm
m150623_212711_fix_username_notnull.php
1464
0644
edit
dl
rm
m151218_234654_add_timezone_to_profile.php
569
0644
edit
dl
rm
m160929_103127_add_last_login_at_to_user_table.php
294
0644
edit
dl
rm
Migration.php
2316
0644
edit
dl
rm
Edit:
/var/www/vhosts/nabawater/vendor/dektrium/yii2-user/migrations/Migration.php
(2316B)
<?php /* * This file is part of the Dektrium project. * * (c) Dektrium project <http://github.com/dektrium/> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace dektrium\user\migrations; use Yii; /** * @author Dmitry Erofeev <dmeroff@gmail.com> */ class Migration extends \yii\db\Migration { /** * @var string */ protected $tableOptions; protected $restrict = 'RESTRICT'; protected $cascade = 'CASCADE'; protected $dbType; /** * @inheritdoc */ public function init() { parent::init(); switch ($this->db->driverName) { case 'mysql': $this->tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; $this->dbType = 'mysql'; break; case 'pgsql': $this->tableOptions = null; $this->dbType = 'pgsql'; break; case 'dblib': case 'mssql': case 'sqlsrv': $this->restrict = 'NO ACTION'; $this->tableOptions = null; $this->dbType = 'sqlsrv'; break; default: throw new \RuntimeException('Your database is not supported!'); } } public function dropColumnConstraints($table, $column) { $table = $this->db->schema->getRawTableName($table); $cmd = $this->db->createCommand('SELECT name FROM sys.default_constraints WHERE parent_object_id = object_id(:table) AND type = \'D\' AND parent_column_id = ( SELECT column_id FROM sys.columns WHERE object_id = object_id(:table) and name = :column )', [ ':table' => $table, ':column' => $column ]); $constraints = $cmd->queryAll(); foreach ($constraints as $c) { $this->execute('ALTER TABLE '.$this->db->quoteTableName($table).' DROP CONSTRAINT '.$this->db->quoteColumnName($c['name'])); } } }
Save
cmd:
run