mirror of https://github.com/movim/movim
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
725 B
31 lines
725 B
<?php
|
|
|
|
use Movim\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
class UpdateUniqueConstraintSessions extends Migration
|
|
{
|
|
public function up()
|
|
{
|
|
$this->disableForeignKeyCheck();
|
|
|
|
$this->schema->table('sessions', function (Blueprint $table) {
|
|
$table->dropUnique('host');
|
|
$table->unique('user_id');
|
|
});
|
|
|
|
$this->enableForeignKeyCheck();
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
$this->disableForeignKeyCheck();
|
|
|
|
$this->schema->table('sessions', function (Blueprint $table) {
|
|
$table->dropUnique('sessions_user_id_unique');
|
|
$table->unique('username', 'host');
|
|
});
|
|
|
|
$this->enableForeignKeyCheck();
|
|
}
|
|
}
|