Fix migration thing.

This commit is contained in:
James Cole 2015-06-22 21:37:02 +02:00
parent a465cb2191
commit 1d1eb5ffa8

View File

@ -15,10 +15,29 @@ class ChangesForV3451 extends Migration
*/
public function down()
{
Schema::create(
'reminders', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->integer('user_id')->unsigned();
$table->date('startdate');
$table->date('enddate')->nullable();
$table->boolean('active');
$table->boolean('notnow')->default(0);
$table->integer('remindersable_id')->unsigned()->nullable();
$table->string('remindersable_type')->nullable();
// connect reminders to users
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
}
);
Schema::table(
'piggy_banks', function (Blueprint $table) {
$table->smallInteger('reminder_skip')->unsigned();
$table->boolean('remind_me');
$table->enum('reminder', ['day', 'week', 'quarter', 'month', 'year'])->nullable();
}
);
@ -33,9 +52,11 @@ class ChangesForV3451 extends Migration
{
Schema::table(
'piggy_banks', function (Blueprint $table) {
//$table->dropColumn('reminder_skip');
$table->dropColumn('reminder_skip');
$table->dropColumn('remind_me');
$table->dropColumn('reminder');
}
);
Schema::drop('reminders');
}
}