mirror of
https://github.com/Deathgarden-Rebirth/Deathgarden_Rebirth-Rewrite.git
synced 2026-09-07 10:45:52 -05:00
Fix issues with unique keys
Signed-off-by: Shaggy84675 <admin@RainbowShaggy.com>
This commit is contained in:
@@ -11,8 +11,19 @@
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if (Schema::hasIndex('game_files', ['name', 'hash', 'version'])) {
|
||||
Schema::table('game_files', function (Blueprint $table) {
|
||||
$table->dropUnique(['name', 'hash', 'version']);
|
||||
});
|
||||
}
|
||||
|
||||
//Schema doesn't support tinyint
|
||||
DB::statement("ALTER TABLE `game_files` CHANGE `version` `patchline` TINYINT UNSIGNED NOT NULL DEFAULT '1';");
|
||||
|
||||
|
||||
Schema::table('game_files', function (Blueprint $table) {
|
||||
$table->unique(['name', 'hash', 'patchline']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -20,11 +31,19 @@ public function up(): void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
if (Schema::hasIndex('game_files', ['name', 'hash', 'patchline'])) {
|
||||
Schema::table('game_files', function (Blueprint $table) {
|
||||
$table->dropUnique(['name', 'hash', 'patchline']);
|
||||
});
|
||||
}
|
||||
Schema::table('game_files', function (Blueprint $table) {
|
||||
$table->integer('patchline')->default(1)->change();
|
||||
});
|
||||
Schema::table('game_files', function (Blueprint $table) {
|
||||
$table->renameColumn('patchline', 'version');
|
||||
});
|
||||
Schema::table('game_files', function (Blueprint $table) {
|
||||
$table->unique(['name', 'hash', 'version']);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -14,11 +14,11 @@ public function up(): void
|
||||
//Schema doesn't support tinyint
|
||||
DB::statement("ALTER TABLE `game_files` ADD COLUMN `is_additional` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `action`;");
|
||||
|
||||
if (Schema::hasIndex('game_files', ['name', 'hash', 'version'])) {
|
||||
if (Schema::hasIndex('game_files', ['name', 'hash', 'patchline'])) {
|
||||
Schema::table('game_files', function (Blueprint $table) {
|
||||
$table->dropUnique(['name', 'hash', 'version']);
|
||||
$table->dropUnique(['name', 'hash', 'patchline']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Schema::table('game_files', function (Blueprint $table) {
|
||||
$table->renameColumn('name', 'filename');
|
||||
|
||||
Reference in New Issue
Block a user