Add superadmin moderation queues
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?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::table('photos', function (Blueprint $table) {
|
||||
if (! Schema::hasColumn('photos', 'moderation_notes')) {
|
||||
$table->text('moderation_notes')->nullable()->after('status');
|
||||
}
|
||||
|
||||
if (! Schema::hasColumn('photos', 'moderated_at')) {
|
||||
$table->timestamp('moderated_at')->nullable()->after('moderation_notes');
|
||||
}
|
||||
|
||||
if (! Schema::hasColumn('photos', 'moderated_by')) {
|
||||
$table->foreignId('moderated_by')
|
||||
->nullable()
|
||||
->after('moderated_at')
|
||||
->constrained('users')
|
||||
->nullOnDelete();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('photos', function (Blueprint $table) {
|
||||
if (Schema::hasColumn('photos', 'moderated_by')) {
|
||||
$table->dropConstrainedForeignId('moderated_by');
|
||||
}
|
||||
|
||||
foreach (['moderated_at', 'moderation_notes'] as $column) {
|
||||
if (Schema::hasColumn('photos', $column)) {
|
||||
$table->dropColumn($column);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,56 @@
|
||||
<?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::table('tenant_feedback', function (Blueprint $table) {
|
||||
if (! Schema::hasColumn('tenant_feedback', 'status')) {
|
||||
$table->string('status', 32)->default('pending')->after('message');
|
||||
$table->index('status', 'tenant_feedback_status_index');
|
||||
}
|
||||
|
||||
if (! Schema::hasColumn('tenant_feedback', 'moderation_notes')) {
|
||||
$table->text('moderation_notes')->nullable()->after('status');
|
||||
}
|
||||
|
||||
if (! Schema::hasColumn('tenant_feedback', 'moderated_at')) {
|
||||
$table->timestamp('moderated_at')->nullable()->after('moderation_notes');
|
||||
}
|
||||
|
||||
if (! Schema::hasColumn('tenant_feedback', 'moderated_by')) {
|
||||
$table->foreignId('moderated_by')
|
||||
->nullable()
|
||||
->after('moderated_at')
|
||||
->constrained('users')
|
||||
->nullOnDelete();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('tenant_feedback', function (Blueprint $table) {
|
||||
if (Schema::hasColumn('tenant_feedback', 'moderated_by')) {
|
||||
$table->dropConstrainedForeignId('moderated_by');
|
||||
}
|
||||
|
||||
foreach (['moderated_at', 'moderation_notes', 'status'] as $column) {
|
||||
if (Schema::hasColumn('tenant_feedback', $column)) {
|
||||
$table->dropColumn($column);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user