Создал миграцию под таблицу пожеланий
This commit is contained in:
		
							parent
							
								
									6b7129f523
								
							
						
					
					
						commit
						915f84022a
					
				|  | @ -0,0 +1,32 @@ | |||
| <?php | ||||
| 
 | ||||
| use Illuminate\Database\Migrations\Migration; | ||||
| use Illuminate\Database\Schema\Blueprint; | ||||
| use Illuminate\Support\Facades\Schema; | ||||
| 
 | ||||
| return new class extends Migration | ||||
| { | ||||
|     /** | ||||
|      * Run the migrations. | ||||
|      */ | ||||
|     public function up(): void | ||||
|     { | ||||
|         Schema::create('wishes', function (Blueprint $table) { | ||||
|             $table->id(); | ||||
|             $table->unsignedBigInteger('user_id'); | ||||
|             $table->foreign('user_id')->references('id')->on('users'); | ||||
|             $table->string('name', length: 256); | ||||
|             $table->double('price'); | ||||
|             $table->string('url', length: 256); | ||||
|             $table->timestamps(); | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Reverse the migrations. | ||||
|      */ | ||||
|     public function down(): void | ||||
|     { | ||||
|         Schema::dropIfExists('wishes'); | ||||
|     } | ||||
| }; | ||||
		Loading…
	
		Reference in New Issue