Skip to content

Commit

Permalink
feat: make invite code columns in db unique
Browse files Browse the repository at this point in the history
  • Loading branch information
Fenrikur committed Jan 30, 2024
1 parent e235fe4 commit 5148d40
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public function up(): void
$table->dropColumn('is_fursuit');
$table->dropColumn('is_commissions');
$table->dropColumn('is_misc');
$table->dropColumn('is_mature');
});
}

Expand All @@ -32,7 +31,6 @@ public function down(): void
$table->boolean('is_fursuit')->nullable();
$table->boolean('is_commissions')->nullable();
$table->boolean('is_misc')->nullable();
$table->boolean('is_mature')->nullable();
});
}
};
Original file line number Diff line number Diff line change
@@ -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
{
Schema::table('applications', function (Blueprint $table) {
$table->string('invite_code_shares')->nullable()->unique()->change();
$table->string('invite_code_assistants')->nullable()->unique()->change();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('applications', function (Blueprint $table) {
$table->string('invite_code_shares')->nullable()->change();
$table->string('invite_code_assistants')->nullable()->change();
});
}
};

0 comments on commit 5148d40

Please sign in to comment.