Fix broken migration rollbacks
This commit is contained in:
		
							parent
							
								
									36837df0a6
								
							
						
					
					
						commit
						89db9390df
					
				| @ -36,8 +36,8 @@ class UpgradeTaskSystem extends Migration | |||||||
|     public function down() |     public function down() | ||||||
|     { |     { | ||||||
|         Schema::table('tasks', function (Blueprint $table) { |         Schema::table('tasks', function (Blueprint $table) { | ||||||
|             $table->dropForeign(['server_id']); | //            $table->dropForeign(['server_id']);
 | ||||||
|             $table->dropForeign(['user_id']); | //            $table->dropForeign(['user_id']);
 | ||||||
| 
 | 
 | ||||||
|             $table->renameColumn('server_id', 'server'); |             $table->renameColumn('server_id', 'server'); | ||||||
|             $table->dropColumn('user_id'); |             $table->dropColumn('user_id'); | ||||||
|  | |||||||
| @ -23,10 +23,6 @@ class DeleteTaskWhenParentServerIsDeleted extends Migration | |||||||
|      */ |      */ | ||||||
|     public function down() |     public function down() | ||||||
|     { |     { | ||||||
|         Schema::table('tasks', function (Blueprint $table) { |         //
 | ||||||
|             $table->dropForeign(['server_id']); |  | ||||||
| 
 |  | ||||||
|             $table->foreign('server_id')->references('id')->on('servers'); |  | ||||||
|         }); |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -41,7 +41,7 @@ class AddApiKeyPermissionColumns extends Migration | |||||||
|             $table->unsignedInteger('key_id'); |             $table->unsignedInteger('key_id'); | ||||||
|             $table->string('permission'); |             $table->string('permission'); | ||||||
| 
 | 
 | ||||||
|             $table->foreign('key_id')->references('id')->on('keys')->onDelete('cascade'); |             $table->foreign('key_id')->references('id')->on('api_keys')->onDelete('cascade'); | ||||||
|         }); |         }); | ||||||
| 
 | 
 | ||||||
|         Schema::table('api_keys', function (Blueprint $table) { |         Schema::table('api_keys', function (Blueprint $table) { | ||||||
|  | |||||||
| @ -26,7 +26,10 @@ class EnsureUniqueAllocationIdOnServersTable extends Migration | |||||||
|     public function down() |     public function down() | ||||||
|     { |     { | ||||||
|         Schema::table('servers', function (Blueprint $table) { |         Schema::table('servers', function (Blueprint $table) { | ||||||
|  |             $table->dropForeign(['allocation_id']); | ||||||
|             $table->dropUnique(['allocation_id']); |             $table->dropUnique(['allocation_id']); | ||||||
|  | 
 | ||||||
|  |             $table->foreign('allocation_id')->references('id')->on('allocations'); | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Dane Everitt
						Dane Everitt