BloomFeed Addons v0.22
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('notifiers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
|
||||
$table->string('type'); // 'discord' | 'webhook'
|
||||
$table->string('name');
|
||||
$table->string('url', 2048);
|
||||
$table->string('scope')->default('all'); // 'all' | 'feeds'
|
||||
$table->boolean('enabled')->default(true);
|
||||
$table->timestamp('last_triggered_at')->nullable();
|
||||
$table->string('last_error')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['user_id', 'enabled']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('notifiers');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
// Table name follows Laravel's belongsToMany convention: alphabetical
|
||||
// order of the two model names ("feed" < "notifier").
|
||||
Schema::create('feed_notifier', function (Blueprint $table) {
|
||||
$table->foreignId('notifier_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('feed_id')->constrained()->cascadeOnDelete();
|
||||
$table->primary(['notifier_id', 'feed_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('feed_notifier');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user