| 
									
										
										
										
											2015-07-28 03:17:08 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | use Illuminate\Database\Migrations\Migration; | 
					
						
							| 
									
										
										
										
											2021-06-26 23:23:15 +08:00
										 |  |  | use Illuminate\Database\Schema\Blueprint; | 
					
						
							| 
									
										
										
										
											2024-03-17 23:29:09 +08:00
										 |  |  | use Illuminate\Support\Facades\Schema; | 
					
						
							| 
									
										
										
										
											2015-07-28 03:17:08 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-07 00:58:29 +08:00
										 |  |  | return new class extends Migration | 
					
						
							| 
									
										
										
										
											2015-07-28 03:17:08 +08:00
										 |  |  | { | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Run the migrations. | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2024-03-17 23:29:09 +08:00
										 |  |  |     public function up(): void | 
					
						
							| 
									
										
										
										
											2015-07-28 03:17:08 +08:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2018-09-23 07:30:48 +08:00
										 |  |  |         Schema::create('chapters', function (Blueprint $table) { | 
					
						
							| 
									
										
										
										
											2015-07-28 03:17:08 +08:00
										 |  |  |             $table->increments('id'); | 
					
						
							|  |  |  |             $table->integer('book_id'); | 
					
						
							|  |  |  |             $table->string('slug')->indexed(); | 
					
						
							|  |  |  |             $table->text('name'); | 
					
						
							|  |  |  |             $table->text('description'); | 
					
						
							|  |  |  |             $table->integer('priority'); | 
					
						
							| 
									
										
										
										
											2016-02-17 05:25:11 +08:00
										 |  |  |             $table->nullableTimestamps(); | 
					
						
							| 
									
										
										
										
											2015-07-28 03:17:08 +08:00
										 |  |  |         }); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Reverse the migrations. | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2024-03-17 23:29:09 +08:00
										 |  |  |     public function down(): void | 
					
						
							| 
									
										
										
										
											2015-07-28 03:17:08 +08:00
										 |  |  |     { | 
					
						
							|  |  |  |         Schema::drop('chapters'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2023-02-07 00:58:29 +08:00
										 |  |  | }; |