mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-21 22:11:26 +00:00
migrations
This commit is contained in:
parent
da6943daed
commit
37054e8393
2 changed files with 52 additions and 0 deletions
|
@ -23,6 +23,9 @@ class UpdateStoriesTableFixExpiresAtColumn extends Migration
|
||||||
$table->timestamp('expires_at')->default(null)->index()->nullable()->change();
|
$table->timestamp('expires_at')->default(null)->index()->nullable()->change();
|
||||||
$table->boolean('can_reply')->default(true);
|
$table->boolean('can_reply')->default(true);
|
||||||
$table->boolean('can_react')->default(true);
|
$table->boolean('can_react')->default(true);
|
||||||
|
$table->string('object_id')->nullable()->unique();
|
||||||
|
$table->string('object_uri')->nullable()->unique();
|
||||||
|
$table->string('bearcap_token')->nullable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,6 +46,9 @@ class UpdateStoriesTableFixExpiresAtColumn extends Migration
|
||||||
$table->timestamp('expires_at')->default(null)->index()->nullable()->change();
|
$table->timestamp('expires_at')->default(null)->index()->nullable()->change();
|
||||||
$table->dropColumn('can_reply');
|
$table->dropColumn('can_reply');
|
||||||
$table->dropColumn('can_react');
|
$table->dropColumn('can_react');
|
||||||
|
$table->dropColumn('object_id');
|
||||||
|
$table->dropColumn('object_uri');
|
||||||
|
$table->dropColumn('bearcap_token');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use App\Jobs\InstancePipeline\InstanceCrawlPipeline;
|
||||||
|
|
||||||
|
class AddSoftwareColumnToInstancesTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('instances', function (Blueprint $table) {
|
||||||
|
$table->string('software')->nullable()->index();
|
||||||
|
$table->unsignedInteger('user_count')->nullable();
|
||||||
|
$table->unsignedInteger('status_count')->nullable();
|
||||||
|
$table->timestamp('last_crawled_at')->nullable();
|
||||||
|
});
|
||||||
|
|
||||||
|
$this->runPostMigration();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('instances', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('software');
|
||||||
|
$table->dropColumn('user_count');
|
||||||
|
$table->dropColumn('status_count');
|
||||||
|
$table->dropColumn('last_crawled_at');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function runPostMigration()
|
||||||
|
{
|
||||||
|
InstanceCrawlPipeline::dispatch();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue