Actions.php 768 B

123456789101112131415161718192021222324252627282930
  1. <?php if ( ! defined( 'ABSPATH' ) ) exit;
  2. class NF_Database_Migrations_Actions extends NF_Abstracts_Migration
  3. {
  4. public function __construct()
  5. {
  6. parent::__construct(
  7. 'nf3_actions',
  8. 'nf_migration_create_table_actions'
  9. );
  10. }
  11. public function run()
  12. {
  13. $query = "CREATE TABLE IF NOT EXISTS {$this->table_name()} (
  14. `id` int NOT NULL AUTO_INCREMENT,
  15. `title` longtext,
  16. `key` longtext,
  17. `type` longtext,
  18. `active` boolean DEFAULT TRUE,
  19. `parent_id` int NOT NULL,
  20. `created_at` TIMESTAMP,
  21. `updated_at` DATETIME,
  22. UNIQUE KEY (`id`)
  23. ) {$this->charset_collate()};";
  24. dbDelta( $query );
  25. }
  26. }