<?php if ( ! defined( 'ABSPATH' ) ) exit;
class NF_Database_Migrations_Forms extends NF_Abstracts_Migration
* Constructor method for the NF_Database_Migrations_Actions class.
public function __construct()
'nf_migration_create_table_forms'
* Function to run our initial migration.
$query = "CREATE TABLE IF NOT EXISTS {$this->table_name()} (
`id` int NOT NULL AUTO_INCREMENT,
`default_label_pos` varchar(15),
) {$this->charset_collate( true )};";
* Function to be run as part of our CacheCollateForms required update.
public function cache_collate_forms()
// If the form_title column exists...
if ( $this->column_exists( 'form_title' ) ) {
// Update our existing columns.
$query = "ALTER TABLE {$this->table_name()}
MODIFY `form_title` longtext {$this->charset_collate()},
MODIFY `default_label_pos` varchar(15) {$this->charset_collate()};";
} // Otherwise... (The form_title column does not exist.)
// Create the new columns.
$query = "ALTER TABLE {$this->table_name()}
ADD `form_title` longtext {$this->charset_collate()},
ADD `default_label_pos` varchar(15) {$this->charset_collate()},
ADD `clear_complete` bit,