This commit is contained in:
@@ -8,6 +8,10 @@ class AddEventPaidFlagToCharges extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
if (! $this->db->tableExists('event_charges')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$fields = [
|
||||
'event_paid' => [
|
||||
'type' => 'TINYINT',
|
||||
@@ -17,11 +21,15 @@ class AddEventPaidFlagToCharges extends Migration
|
||||
],
|
||||
];
|
||||
|
||||
$this->forge->addColumn('event_charges', $fields);
|
||||
if (! $this->db->fieldExists('event_paid', 'event_charges')) {
|
||||
$this->forge->addColumn('event_charges', $fields);
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropColumn('event_charges', 'event_paid');
|
||||
if ($this->db->tableExists('event_charges') && $this->db->fieldExists('event_paid', 'event_charges')) {
|
||||
$this->forge->dropColumn('event_charges', 'event_paid');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user