Migration for #508

This commit is contained in:
James Cole 2016-12-29 19:35:27 +01:00
parent 0d4febff85
commit a442d3d952

View File

@ -22,6 +22,27 @@ class ChangesForV431 extends Migration
*/
public function down()
{
// reinstate "repeats" and "repeat_freq".
Schema::table(
'budget_limits', function (Blueprint $table) {
$table->string('repeat_freq', 30);
$table->boolean('repeats')->default(0);
}
);
// remove date field "end_date"
Schema::table(
'budget_limits', function (Blueprint $table) {
$table->dropColumn('end_date');
}
);
// change field "start_date" to "startdate"
Schema::table(
'budget_limits', function (Blueprint $table) {
$table->renameColumn('startdate', 'start_date');
}
);
}
/**
@ -38,5 +59,27 @@ class ChangesForV431 extends Migration
}
);
// change field "startdate" to "start_date"
Schema::table(
'budget_limits', function (Blueprint $table) {
$table->renameColumn('startdate', 'start_date');
}
);
// add date field "end_date" after "start_date"
Schema::table(
'budget_limits', function (Blueprint $table) {
$table->date('end_date')->nullable()->after('start_date');
}
);
// drop "repeats" and "repeat_freq".
Schema::table(
'budget_limits', function (Blueprint $table) {
$table->dropColumn('repeats');
$table->dropColumn('repeat_freq');
}
);
}
}