mega-commit: migrations, controllers, models, etc.
This commit is contained in:
		
							parent
							
								
									9732135e90
								
							
						
					
					
						commit
						2c6745e812
					
				
					 70 changed files with 2124 additions and 400 deletions
				
			
		|  | @ -0,0 +1,39 @@ | |||
| <?php | ||||
| 
 | ||||
| use Illuminate\Database\Migrations\Migration; | ||||
| use Illuminate\Database\Schema\Blueprint; | ||||
| use Illuminate\Support\Facades\Schema; | ||||
| 
 | ||||
| return new class extends Migration | ||||
| { | ||||
|     /** | ||||
|      * Run the migrations. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function up() | ||||
|     { | ||||
|         Schema::create('movies', function (Blueprint $table) { | ||||
|             $table->id('movie_id'); | ||||
|             $table->timestamps(); | ||||
|             $table->addColumn('string', 'movie_name', ['length' => 255]); | ||||
|             $table->addColumn('string', 'movie_description', ['length' => 1000]); | ||||
|             $table->addColumn('string', 'movie_image', ['length' => 255]); | ||||
|             $table->addColumn('integer', 'movie_length'); | ||||
|             $table->addColumn('integer', 'movie_year'); | ||||
|             $table->addColumn('integer', 'movie_age_limit'); | ||||
|             $table->foreignId('genre_id')->constrained('genres', 'genre_id'); | ||||
|             $table->unique(['movie_name']); | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Reverse the migrations. | ||||
|      * | ||||
|      * @return void | ||||
|      */ | ||||
|     public function down() | ||||
|     { | ||||
|         Schema::dropIfExists('movies'); | ||||
|     } | ||||
| }; | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue