This commit is contained in:
@@ -9,6 +9,10 @@ class AddNoSchoolToCalendarEvents extends Migration
|
||||
public function up()
|
||||
{
|
||||
$db = \Config\Database::connect();
|
||||
if (! $db->tableExists('calendar_events')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$cols = [];
|
||||
try {
|
||||
$cols = $db->getFieldNames('calendar_events');
|
||||
@@ -31,6 +35,10 @@ class AddNoSchoolToCalendarEvents extends Migration
|
||||
|
||||
public function down()
|
||||
{
|
||||
if (! $this->db->tableExists('calendar_events')) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
$this->forge->dropColumn('calendar_events', 'no_school');
|
||||
} catch (\Throwable $e) {
|
||||
@@ -38,4 +46,3 @@ class AddNoSchoolToCalendarEvents extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user