| 
									
										
										
										
											2022-08-17 21:39:53 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | use Illuminate\Database\Migrations\Migration; | 
					
						
							|  |  |  | use Illuminate\Database\Schema\Blueprint; | 
					
						
							|  |  |  | use Illuminate\Support\Facades\Schema; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-07 00:58:29 +08:00
										 |  |  | return new class extends Migration | 
					
						
							| 
									
										
										
										
											2022-08-17 21:39:53 +08:00
										 |  |  | { | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Run the migrations. | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2024-03-17 23:29:09 +08:00
										 |  |  |     public function up(): void | 
					
						
							| 
									
										
										
										
											2022-08-17 21:39:53 +08:00
										 |  |  |     { | 
					
						
							|  |  |  |         Schema::create('references', function (Blueprint $table) { | 
					
						
							|  |  |  |             $table->id(); | 
					
						
							|  |  |  |             $table->unsignedInteger('from_id')->index(); | 
					
						
							|  |  |  |             $table->string('from_type', 25)->index(); | 
					
						
							|  |  |  |             $table->unsignedInteger('to_id')->index(); | 
					
						
							|  |  |  |             $table->string('to_type', 25)->index(); | 
					
						
							|  |  |  |         }); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Reverse the migrations. | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2024-03-17 23:29:09 +08:00
										 |  |  |     public function down(): void | 
					
						
							| 
									
										
										
										
											2022-08-17 21:39:53 +08:00
										 |  |  |     { | 
					
						
							|  |  |  |         Schema::dropIfExists('references'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2023-02-07 00:58:29 +08:00
										 |  |  | }; |