id(); $table->foreignIdFor(User::class)->constrained()->cascadeOnUpdate()->cascadeOnDelete(); $table->date('from')->nullable(); $table->date('to')->nullable(); $table->string('frequency')->nullable(); $table->string('name'); $table->unsignedFloat('goal'); $table->timestamps(); $table->index('user_id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('goals'); } }