diff --git a/include/constants.php b/include/constants.php index 320b5c03..62a441b0 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@ hasColumn('attendance', 'total_days')) { - $this->runMigrate('database/migrations/2021_06_13_215440_add_total_days_to_attendance_table.php'); - $this->migrateAttendance(); + if (WITH_LARAVEL) { + if (!NexusDB::schema()->hasTable('attendance')) { + //no table yet, no need to migrate + $this->runMigrate('database/migrations/2021_06_08_113437_create_attendance_table.php'); + } + if (!NexusDB::schema()->hasColumn('attendance', 'total_days')) { + $this->runMigrate('database/migrations/2021_06_13_215440_add_total_days_to_attendance_table.php'); + $this->migrateAttendance(); + } } /**