前提・実現したいこと
アプリケーションを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内容
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateDietTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('dietData', function (Blueprint $table) { $table->bigIncrements('id'); $table->int('day'); $table->int('weight'); $table->int('eveRate'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('dietData'); } }
試したこと
[Schemaの意味]https://www.postgresql.jp/docs/9.2/sql-createschema.html)
補足情報(FW/ツールのバージョンなど)
まだ回答がついていません
会員登録して回答してみよう