attendance remove total_points

This commit is contained in:
xiaomlove
2021-06-13 22:21:42 +08:00
parent bf2825713d
commit 2733bf9761
7 changed files with 81 additions and 18 deletions

View File

@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddTotalDaysAndTotalPointsToAttendanceTable extends Migration
class AddTotalDaysToAttendanceTable extends Migration
{
/**
* Run the migrations.
@@ -13,12 +13,8 @@ class AddTotalDaysAndTotalPointsToAttendanceTable extends Migration
*/
public function up()
{
if (Schema::hasColumns('attendance',['total_days', 'total_points'])) {
return;
}
Schema::table('attendance', function (Blueprint $table) {
$table->integer('total_days')->default(0);
$table->integer('total_points')->default(0);
});
}
@@ -30,7 +26,7 @@ class AddTotalDaysAndTotalPointsToAttendanceTable extends Migration
public function down()
{
Schema::table('attendance', function (Blueprint $table) {
$table->dropColumn(['total_days', 'total_points']);
$table->dropColumn('total_days');
});
}
}