feat(tenant): add master toggle for ticket refunds
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('tenants', function (Blueprint $table): void {
|
||||
$table->boolean('allow_ticket_refund')
|
||||
->default(false)
|
||||
->after('scanner_category_validation_enabled');
|
||||
});
|
||||
|
||||
DB::table('tenants')
|
||||
->where('allow_ticket_total_refund', true)
|
||||
->orWhere(function ($query): void {
|
||||
$query
|
||||
->where('allow_ticket_partial_refund', true)
|
||||
->where('ticket_partial_refund_percentage', '>', 0);
|
||||
})
|
||||
->update(['allow_ticket_refund' => true]);
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('tenants', function (Blueprint $table): void {
|
||||
$table->dropColumn('allow_ticket_refund');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user