Jump to content

Database schema changes from v5 to v6?


Serenade

Recommended Posts

I have a lot of scripts that rely on the WHMCS database in order to work. I'm finally at a point where I'm considering upgrading to v6 and I just want to make sure my setup doesn't crash and burn after preforming the upgrade. Here are few of the SQL queries:

 

$query_active = "SELECT DISTINCT CCF.value as ip from tblclients as C JOIN tblhosting as H ON (C.id=H.userid) JOIN tblcustomfieldsvalues as CCF ON (C.id=CCF.relid) WHERE H.domainstatus='Active' AND CCF.fieldid=1;";

 

function clientIPModification ($userid) {
   $fieldid = get_query_val('tblcustomfields', 'id', array('type' => 'client', 'fieldname' => 'Registered IP'));
   if (!$fieldid) {
       $fieldid = insert_query('tblcustomfields', array('type' => 'client', 'fieldname' => 'Registered IP', 'fieldtype' => "text"));
   }
   $ip = get_query_val('tblclients', 'ip', array('id' => $userid));
   $fieldvalueid = get_query_val('tblcustomfieldsvalues', 'value', array('relid' => $userid, 'fieldid' => $fieldid));
   //file_put_contents("/tmp/hook.log", ".".$userid.".\t.".$fieldvalueid.".\n", FILE_APPEND);
   if ($fieldvalueid) {
       update_query('tblcustomfieldsvalues', array('value' => $ip), array('relid' => $userid, 'fieldid' => $fieldid));
   } else {
       insert_query('tblcustomfieldsvalues', array('value' => $ip, 'relid' => $userid, 'fieldid' => $fieldid));
   }
}

 

Just from quickly scanning, anyone see if these would present an issue post migration?

Link to comment
Share on other sites

WHMCS provide all information about Database changes made in V6, new tables, new fields, etc

 

I looked through it and it doesn't seem any of the changes affect the queries I pasted earlier. To be completely honest, I didn't write any of the code at play on my system. I had to hire a developer to do so. To me it doesn't look like there are any changes that would affect what I have now. I suppose I'm just looking for some sort of confirmation be it definitive or not.

 

I've have seen you reply to a lot of the customization questions around these forums, would you be willing to scan through 2 short scripts to make sure no changes are required for a reasonable fee?

Link to comment
Share on other sites

I looked through it and it doesn't seem any of the changes affect the queries I pasted earlier. To be completely honest, I didn't write any of the code at play on my system. I had to hire a developer to do so. To me it doesn't look like there are any changes that would affect what I have now. I suppose I'm just looking for some sort of confirmation be it definitive or not.

the following page may be of use...

 

http://docs.whmcs.com/Interacting_With_The_Database#Deprecated_functionality

 

Deprecated functionality

 

The current SQL Helper Functions are present in WHMCS 6.0 and above, but are now deprecated and may be removed in a later version of the product:

 

  • select_query()
  • update_query()
  • insert_query()
  • full_query()

The mysql extension driven database connection is now deprecated and may be discontinued in a later version of the product. WHMCS encourages all third party developers to use the Capsule DBAL and PDO connection for all new database interaction.

so short-term they may work, but long-term they will need to be updated.

 

I've have seen you reply to a lot of the customization questions around these forums, would you be willing to scan through 2 short scripts to make sure no changes are required for a reasonable fee?

probably better to contact him via PM as he can't really answer that offer in this forum! :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated