Upgrades.php 600 B

12345678910111213141516171819202122232425
  1. <?php if ( ! defined( 'ABSPATH' ) ) exit;
  2. class NF_Database_Migrations_Upgrades extends NF_Abstracts_Migration
  3. {
  4. public function __construct()
  5. {
  6. parent::__construct(
  7. 'nf3_upgrades',
  8. 'nf_migration_create_table_upgrades'
  9. );
  10. }
  11. public function run()
  12. {
  13. $query = "CREATE TABLE IF NOT EXISTS {$this->table_name()} (
  14. `id` INT(11) NOT NULL,
  15. `cache` LONGTEXT,
  16. `stage` INT(11) NOT NULL DEFAULT 0,
  17. PRIMARY KEY ( id )
  18. ) {$this->charset_collate()};";
  19. dbDelta( $query );
  20. }
  21. }