increments('id'); $table->timestamps(); $table->integer('account_id')->unsigned(); $table->string('name', 100); $table->decimal('targetamount', 10, 2); $table->date('startdate')->nullable(); $table->date('targetdate')->nullable(); $table->boolean('repeats'); $table->enum('rep_length', ['day', 'week', 'quarter', 'month', 'year'])->nullable(); $table->smallInteger('rep_every')->unsigned(); $table->smallInteger('rep_times')->unsigned()->nullable(); $table->enum('reminder', ['day', 'week', 'quarter', 'month', 'year'])->nullable(); $table->smallInteger('reminder_skip')->unsigned(); $table->boolean('remind_me'); $table->integer('order')->unsigned(); // connect account to piggy bank. $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); // for an account, the name must be unique. $table->unique(['account_id', 'name']); } ); } }