| 
									
										
										
										
											2020-09-28 06:24:33 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | use Illuminate\Database\Migrations\Migration; | 
					
						
							|  |  |  | use Illuminate\Database\Schema\Blueprint; | 
					
						
							|  |  |  | use Illuminate\Support\Facades\Schema; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-04 01:44:12 +08:00
										 |  |  | class CreateDeletionsTable extends Migration | 
					
						
							| 
									
										
										
										
											2020-09-28 06:24:33 +08:00
										 |  |  | { | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Run the migrations. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return void | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function up() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2020-10-04 01:44:12 +08:00
										 |  |  |         Schema::create('deletions', function (Blueprint $table) { | 
					
						
							| 
									
										
										
										
											2020-09-28 06:24:33 +08:00
										 |  |  |             $table->increments('id'); | 
					
						
							|  |  |  |             $table->integer('deleted_by'); | 
					
						
							|  |  |  |             $table->string('deletable_type', 100); | 
					
						
							|  |  |  |             $table->integer('deletable_id'); | 
					
						
							|  |  |  |             $table->timestamps(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             $table->index('deleted_by'); | 
					
						
							|  |  |  |             $table->index('deletable_type'); | 
					
						
							|  |  |  |             $table->index('deletable_id'); | 
					
						
							|  |  |  |         }); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Reverse the migrations. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return void | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function down() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2020-10-04 01:44:12 +08:00
										 |  |  |         Schema::dropIfExists('deletions'); | 
					
						
							| 
									
										
										
										
											2020-09-28 06:24:33 +08:00
										 |  |  |     } | 
					
						
							|  |  |  | } |