mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class RemoveTextHash extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::table('release_comments', function (Blueprint $table) {
|
|
$sm = Schema::getConnection()->getDoctrineSchemaManager();
|
|
$indexesFound = $sm->listTableIndexes('release_comments');
|
|
|
|
if (array_key_exists('ix_release_comments_hash_releases_id', $indexesFound)) {
|
|
$table->dropUnique('ix_release_comments_hash_releases_id');
|
|
}
|
|
|
|
$table->dropColumn('text_hash');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::table('release_comments', function (Blueprint $table) {
|
|
$table->string('text_hash', 32)->default('');
|
|
$table->unique(['text_hash', 'releases_id'], 'ix_release_comments_hash_releases_id');
|
|
});
|
|
}
|
|
}
|