Fix Event & EventType resource issues and apply formatting
- Fix EventType deletion error handling (constraint violations) - Fix Event update error (package_id column missing) - Fix Event Type dropdown options (JSON display issue) - Fix EventPackagesRelationManager query error - Add missing translations for deletion errors - Apply Pint formatting
This commit is contained in:
@@ -9,7 +9,7 @@ return new class extends Migration
|
||||
public function up(): void
|
||||
{
|
||||
// Create tenants table if not exists
|
||||
if (!Schema::hasTable('tenants')) {
|
||||
if (! Schema::hasTable('tenants')) {
|
||||
Schema::create('tenants', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
@@ -32,7 +32,7 @@ return new class extends Migration
|
||||
});
|
||||
} else {
|
||||
// Add missing columns to existing tenants table
|
||||
if (!Schema::hasColumn('tenants', 'email')) {
|
||||
if (! Schema::hasColumn('tenants', 'email')) {
|
||||
Schema::table('tenants', function (Blueprint $table) {
|
||||
$table->string('email')->nullable()->after('contact_phone');
|
||||
});
|
||||
@@ -42,17 +42,17 @@ return new class extends Migration
|
||||
$table->dropColumn(['event_credits_balance', 'free_event_granted_at']);
|
||||
});
|
||||
}
|
||||
if (!Schema::hasColumn('tenants', 'stripe_account_id')) {
|
||||
if (! Schema::hasColumn('tenants', 'stripe_account_id')) {
|
||||
Schema::table('tenants', function (Blueprint $table) {
|
||||
$table->string('stripe_account_id')->nullable()->after('features');
|
||||
});
|
||||
}
|
||||
if (!Schema::hasColumn('tenants', 'custom_domain')) {
|
||||
if (! Schema::hasColumn('tenants', 'custom_domain')) {
|
||||
Schema::table('tenants', function (Blueprint $table) {
|
||||
$table->string('custom_domain')->nullable()->after('domain');
|
||||
});
|
||||
}
|
||||
if (!Schema::hasColumn('tenants', 'user_id')) {
|
||||
if (! Schema::hasColumn('tenants', 'user_id')) {
|
||||
Schema::table('tenants', function (Blueprint $table) {
|
||||
$table->foreignId('user_id')->nullable()->constrained('users')->onDelete('cascade')->after('id');
|
||||
});
|
||||
@@ -68,7 +68,7 @@ return new class extends Migration
|
||||
});
|
||||
}
|
||||
// Add subscription fields (from add_subscription_fields_to_tenants_table)
|
||||
if (!Schema::hasColumn('tenants', 'subscription_status')) {
|
||||
if (! Schema::hasColumn('tenants', 'subscription_status')) {
|
||||
Schema::table('tenants', function (Blueprint $table) {
|
||||
$table->string('subscription_status')->default('active')->after('event_credits_balance');
|
||||
$table->timestamp('subscription_ends_at')->nullable()->after('subscription_status');
|
||||
@@ -77,14 +77,14 @@ return new class extends Migration
|
||||
}
|
||||
|
||||
// Add tenant_id to users if not exists
|
||||
if (Schema::hasTable('users') && !Schema::hasColumn('users', 'tenant_id')) {
|
||||
if (Schema::hasTable('users') && ! Schema::hasColumn('users', 'tenant_id')) {
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->foreignId('tenant_id')->nullable()->after('id')->constrained('tenants')->nullOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
// Add tenant_id to events if not exists
|
||||
if (Schema::hasTable('events') && !Schema::hasColumn('events', 'tenant_id')) {
|
||||
if (Schema::hasTable('events') && ! Schema::hasColumn('events', 'tenant_id')) {
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
$table->foreignId('tenant_id')->nullable()->after('id')->constrained('tenants')->nullOnDelete();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user