private function upgrade_payment($previous_version)
 {
     global $wpdb;
     $charset_collate = GFFormsModel::get_db_charset();
     $sql = "CREATE TABLE {$wpdb->prefix}gf_addon_payment_transaction (\n                  id int(10) unsigned not null auto_increment,\n                  lead_id int(10) unsigned not null,\n                  transaction_type varchar(30) not null,\n                  transaction_id varchar(50),\n                  is_recurring tinyint(1) not null default 0,\n                  amount decimal(19,2),\n                  date_created datetime,\n                  PRIMARY KEY  (id),\n                  KEY lead_id (lead_id),\n                  KEY trasanction_type (transaction_type),\n                  KEY type_lead (lead_id,transaction_type)\n                ) {$charset_collate};";
     GFFormsModel::dbDelta($sql);
 }
 private function upgrade_payment($previous_versions)
 {
     global $wpdb;
     $charset_collate = GFFormsModel::get_db_charset();
     $sql = "CREATE TABLE {$wpdb->prefix}gf_addon_payment_transaction (\n                  id int(10) unsigned not null auto_increment,\n                  lead_id int(10) unsigned not null,\n                  transaction_type varchar(30) not null,\n                  transaction_id varchar(50),\n                  is_recurring tinyint(1) not null default 0,\n                  amount decimal(19,2),\n                  date_created datetime,\n                  PRIMARY KEY  (id),\n                  KEY lead_id (lead_id),\n                  KEY transaction_type (transaction_type),\n                  KEY type_lead (lead_id,transaction_type)\n                ) {$charset_collate};";
     GFFormsModel::dbDelta($sql);
     if ($this->_supports_callbacks) {
         $sql = "CREATE TABLE {$wpdb->prefix}gf_addon_payment_callback (\n                      id int(10) unsigned not null auto_increment,\n                      lead_id int(10) unsigned not null,\n                      addon_slug varchar(250) not null,\n                      callback_id varchar(250),\n                      date_created datetime,\n                      PRIMARY KEY  (id),\n                      KEY addon_slug_callback_id (addon_slug(50),callback_id(100))\n                    ) {$charset_collate};";
         GFFormsModel::dbDelta($sql);
         //droping legacy index
         GFForms::drop_index("{$wpdb->prefix}gf_addon_payment_callback", 'slug_callback_id');
     }
 }
示例#3
0
    private function upgrade_payment($previous_versions) {
        global $wpdb;

        $charset_collate = GFFormsModel::get_db_charset();

        $sql = "CREATE TABLE {$wpdb->prefix}gf_addon_payment_transaction (
                  id int(10) unsigned not null auto_increment,
                  lead_id int(10) unsigned not null,
                  transaction_type varchar(30) not null,
                  transaction_id varchar(50),
                  is_recurring tinyint(1) not null default 0,
                  amount decimal(19,2),
                  date_created datetime,
                  PRIMARY KEY  (id),
                  KEY lead_id (lead_id),
                  KEY trasanction_type (transaction_type),
                  KEY type_lead (lead_id,transaction_type)
                ) $charset_collate;";

        GFFormsModel::dbDelta($sql);


        if($this->_supports_callbacks){
            $sql = "CREATE TABLE {$wpdb->prefix}gf_addon_payment_callback (
                      id int(10) unsigned not null auto_increment,
                      lead_id int(10) unsigned not null,
                      addon_slug varchar(250) not null,
                      callback_id varchar(250),
                      date_created datetime,
                      PRIMARY KEY  (id),
                      KEY slug_callback_id (addon_slug,callback_id)
                    ) $charset_collate;";

            GFFormsModel::dbDelta($sql);
        }


    }