-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop support for soft deletes in order to reduce the code complexity …
…and data usage
- Loading branch information
1 parent
1710d46
commit cf19a90
Showing
16 changed files
with
198 additions
and
474 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
application/migrations/045_drop_delete_datetime_column_from_all_tables.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php defined('BASEPATH') or exit('No direct script access allowed'); | ||
|
||
/* ---------------------------------------------------------------------------- | ||
* Easy!Appointments - Open Source Web Scheduler | ||
* | ||
* @package EasyAppointments | ||
* @author A.Tselegidis <[email protected]> | ||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis | ||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3 | ||
* @link http://easyappointments.org | ||
* @since v1.4.0 | ||
* ---------------------------------------------------------------------------- */ | ||
|
||
class Migration_Drop_delete_datetime_column_from_all_tables extends EA_Migration { | ||
/** | ||
* @var string[] | ||
*/ | ||
protected $tables = [ | ||
'appointments', | ||
'categories', | ||
'consents', | ||
'roles', | ||
'services', | ||
'settings', | ||
'users', | ||
'webhooks' | ||
]; | ||
|
||
/** | ||
* Upgrade method. | ||
*/ | ||
public function up() | ||
{ | ||
foreach ($this->tables as $table) | ||
{ | ||
if ($this->db->field_exists('delete_datetime', $table)) | ||
{ | ||
$this->dbforge->drop_column($table, 'delete_datetime'); | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Downgrade method. | ||
*/ | ||
public function down() | ||
{ | ||
foreach ($this->tables as $table) | ||
{ | ||
if ( ! $this->db->field_exists('delete_datetime', $table)) | ||
{ | ||
$fields = [ | ||
'delete_datetime' => [ | ||
'type' => 'DATETIME', | ||
'null' => TRUE, | ||
'after' => 'update_datetime', | ||
] | ||
]; | ||
|
||
$this->dbforge->add_column($table, $fields); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.