CompleteRemovedLegacyLogMigration.php
3 years ago
CreateNewLogTable.php
4 years ago
DeleteOldLogTables.php
4 years ago
MigrateExistingLogs.php
4 years ago
RemoveSensitiveLogs.php
4 years ago
DeleteOldLogTables.php
48 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\Log\Migrations; |
| 4 | |
| 5 | use Give\Framework\Database\DB; |
| 6 | use Give\Framework\Migrations\Contracts\Migration; |
| 7 | |
| 8 | /** |
| 9 | * Class DeleteOldLogTables |
| 10 | * @package Give\Log\Migrations |
| 11 | */ |
| 12 | class DeleteOldLogTables extends Migration |
| 13 | { |
| 14 | /** |
| 15 | * @return string |
| 16 | */ |
| 17 | public static function id() |
| 18 | { |
| 19 | return 'delete_old_log_tables'; |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * @return string |
| 24 | */ |
| 25 | public static function title() |
| 26 | { |
| 27 | return esc_html__('Delete give_logs and give_logmeta tables', 'give'); |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * @return int |
| 32 | */ |
| 33 | public static function timestamp() |
| 34 | { |
| 35 | return strtotime('2021-01-28 14:00'); |
| 36 | } |
| 37 | |
| 38 | public function run() |
| 39 | { |
| 40 | global $wpdb; |
| 41 | |
| 42 | $logs_table = "{$wpdb->prefix}give_logs"; |
| 43 | $logmeta_table = "{$wpdb->prefix}give_logmeta"; |
| 44 | |
| 45 | DB::query("DROP TABLE IF EXISTS {$logs_table}, {$logmeta_table};"); |
| 46 | } |
| 47 | } |
| 48 |