前提・実現したいこと
アプリケーションをLaravelを使い作成したいのですが、
表題の通り、「DBの作成に苦戦しています。」
下記のURLをもとに、エラー対処しようとしましたが、わかりませんでした。恐れ入りますが、ご教授願います。
発生している問題・エラーメッセージ
t@MacBook-Pro DietAPP % cd '/Users/t/DietAPP/laravel_app' t@MacBook-Pro laravel_app % php artisan migrate Migrating: 2022_04_23_053732_create_diet_table BadMethodCallException : Method Illuminate\Database\Schema\Blueprint::int does not exist. at /Users/t/DietAPP/laravel_app/vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php:103 99| */ 100| public function __call($method, $parameters) 101| { 102| if (! static::hasMacro($method)) { > 103| throw new BadMethodCallException(sprintf( 104| 'Method %s::%s does not exist.', static::class, $method 105| )); 106| } 107| Exception trace: 1 Illuminate\Database\Schema\Blueprint::__call("int") /Users/t/DietAPP/laravel_app/database/migrations/2022_04_23_053732_create_diet_table.php:18 2 CreateDietTable::{closure}(Object(Illuminate\Database\Schema\Blueprint)) /Users/t/DietAPP/laravel_app/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php:166 Please use the argument -v to see more details.
該当のソースコード
DB内容
1<?php 2 3use Illuminate\Database\Migrations\Migration; 4use Illuminate\Database\Schema\Blueprint; 5use Illuminate\Support\Facades\Schema; 6 7class CreateDietTable extends Migration 8{ 9 /** 10 * Run the migrations. 11 * 12 * @return void 13 */ 14 public function up() 15 { 16 Schema::create('dietData', function (Blueprint $table) { 17 $table->bigIncrements('id'); 18 $table->int('day'); 19 $table->int('weight'); 20 $table->int('eveRate'); 21 $table->timestamps(); 22 }); 23 } 24 25 /** 26 * Reverse the migrations. 27 * 28 * @return void 29 */ 30 public function down() 31 { 32 Schema::dropIfExists('dietData'); 33 } 34} 35
試したこと
[Schemaの意味]https://www.postgresql.jp/docs/9.2/sql-createschema.html)
補足情報(FW/ツールのバージョンなど)
あなたの回答
tips
プレビュー