<?php if ( ! defined( 'ABSPATH' ) ) exit;
class NF_Database_Migrations_FieldMeta extends NF_Abstracts_Migration
* Constructor method for the NF_Database_Migrations_FieldMeta class.
public function __construct()
'nf_migration_create_table_field_meta'
* Function to run our initial migration.
$query = "CREATE TABLE IF NOT EXISTS {$this->table_name()} (
`id` int NOT NULL AUTO_INCREMENT,
`parent_id` int NOT NULL,
) {$this->charset_collate( true )};";
* Function to run our stage three upgrades.
public function cache_collate_fields()
// If the meta_key column has not already been defined...
if ( ! $this->column_exists( 'meta_key' ) ) {
$query = "ALTER TABLE {$this->table_name()}
ADD `meta_key` longtext {$this->charset_collate()},
ADD `meta_value` longtext {$this->charset_collate()}";