CreateNewLogTable.php
5 years ago
DeleteOldLogTables.php
5 years ago
MigrateExistingLogs.php
5 years ago
DeleteOldLogTables.php
43 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 | * @return string |
| 15 | */ |
| 16 | public static function id() { |
| 17 | return 'delete_old_log_tables'; |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * @return string |
| 22 | */ |
| 23 | public static function title() { |
| 24 | return esc_html__( 'Delete give_logs and give_logmeta tables', 'give' ); |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * @return int |
| 29 | */ |
| 30 | public static function timestamp() { |
| 31 | return strtotime( '2021-01-28 14:00' ); |
| 32 | } |
| 33 | |
| 34 | public function run() { |
| 35 | global $wpdb; |
| 36 | |
| 37 | $logs_table = "{$wpdb->prefix}give_logs"; |
| 38 | $logmeta_table = "{$wpdb->prefix}give_logmeta"; |
| 39 | |
| 40 | DB::query( "DROP TABLE IF EXISTS {$logs_table}, {$logmeta_table};" ); |
| 41 | } |
| 42 | } |
| 43 |