-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
216 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
database/migrations/2024_10_30_110257_add_minecraft_group_cols.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
use App\Models\DonationTier; | ||
use App\Models\Group; | ||
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('groups', function (Blueprint $table) { | ||
$table->dropColumn('discourse_name'); | ||
$table->integer('display_priority')->nullable()->after('minecraft_name'); | ||
$table->string('minecraft_hover_text')->after('minecraft_name'); | ||
$table->string('minecraft_display_name')->after('minecraft_name'); | ||
$table->string('group_type')->nullable(); | ||
}); | ||
|
||
Schema::table('donation_perks', function (Blueprint $table) { | ||
$table->dropColumn('last_currency_reward_at'); | ||
}); | ||
|
||
Schema::table('donation_tiers', function (Blueprint $table) { | ||
$table->dropColumn('currency_reward'); | ||
$table->unsignedInteger('group_id')->nullable(); | ||
|
||
$table->foreign('group_id')->references('group_id')->on('groups'); | ||
}); | ||
|
||
$group = Group::first(); | ||
if ($group === null) { | ||
$group = Group::factory()->create(); | ||
} | ||
DonationTier::get()->each(function ($tier) use($group) { | ||
$tier->group_id = $group->getKey(); | ||
$tier->save(); | ||
}); | ||
|
||
Schema::table('donation_tiers', function (Blueprint $table) { | ||
$table->unsignedInteger('group_id')->change(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
// | ||
} | ||
}; |
Oops, something went wrong.