2 - Add fedi_discover_instances migration
This commit is contained in:
parent
3706a81d3c
commit
00e28c4868
2 changed files with 34 additions and 0 deletions
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('fedi_discover_instances', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('type');
|
||||
// Instance origin, e.g. https://mastodon.social. Not a full endpoint path.
|
||||
$table->string('url');
|
||||
$table->boolean('enabled')->default(true);
|
||||
$table->unsignedInteger('interval_seconds')->default(300);
|
||||
$table->json('config')->default('{}');
|
||||
$table->timestampTz('last_polled_at')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['type', 'url']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('fedi_discover_instances');
|
||||
}
|
||||
};
|
||||
|
|
@ -15,6 +15,8 @@ public function register(): void
|
|||
|
||||
public function boot(): void
|
||||
{
|
||||
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
|
||||
|
||||
if ($this->app->runningInConsole()) {
|
||||
$this->publishes([
|
||||
__DIR__.'/../config/fedi-discover.php' => config_path('fedi-discover.php'),
|
||||
|
|
|
|||
Loading…
Reference in a new issue