57.6 F
San Francisco
Monday, September 14, 2020

WHMCS Upgrade Error tblcreditcards

I’ve been dealing with the automatic upgrade of WHMCS from 7.7 to 7.8 and I kept getting an error message about tblcreditcards:


Oops!
Something went wrong and we couldn't process your request.
Please go back to the previous page and try again.

If the problem persists, please contact us.

For additional assistance, please reference the WHMCS TroubleShooting Guide »

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'tblcreditcards.deleted_at' in 'where clause' in /public_html/vendor/illuminate/database/Connection.php:333
Stack trace:
#0 /public_html/vendor/illuminate/database/Connection.php(333): PDO->prepare('select distinct...')
#1 /public_html/vendor/illuminate/database/Connection.php(706): Illuminate\Database\Connection->Illuminate\Database\{closure}(Object(Illuminate\Database\MySqlConnection), 'select distinct...', Array)
#2 /public_html/vendor/illuminate/database/Connection.php(669): Illuminate\Database\Connection->runQueryCallback('select distinct...', Array, Object(Closure))
#3 /vendor/illuminate/database/Connection.php(342): Illuminate\Database\Connection->run('select distinct...', Array, Object(Closure))
#4 /public_html/vendor/illuminate/database/Query/Builder.php(1583): Illuminate\Database\Connection->select('select distinct...', Array, true)
#5 /public_html/vendor/illuminate/database/Query/Builder.php(1569): Illuminate\Database\Query\Builder->runSelect()
#6 /public_html/vendor/illuminate/database/Query/Builder.php(1813): Illuminate\Database\Query\Builder->get(Array)
#7 /public_html/vendor/illuminate/database/Eloquent/Builder.php(442): Illuminate\Database\Query\Builder->pluck('card_type', NULL)
#8 /public_html/vendor/whmcs/whmcs-foundation/lib/User/Client.php(0): Illuminate\Database\Eloquent\Builder->pluck('card_type')
#9 /public_html/admin/clients.php(0): WHMCS\User\Client::getUsedCardTypes()
#10 {main}
Next Illuminate\Database\QueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'tblcreditcards.deleted_at' in 'where clause' (SQL: select distinct `card_type` from `tblcreditcards` where `card_type` != and `tblcreditcards`.`deleted_at` is null) in /public_html/vendor/illuminate/database/Connection.php:713
Stack trace:
#0 /public_html/vendor/illuminate/database/Connection.php(669): Illuminate\Database\Connection->runQueryCallback('select distinct...', Array, Object(Closure))
#1 /public_html/vendor/illuminate/database/Connection.php(342): Illuminate\Database\Connection->run('select distinct...', Array, Object(Closure))
#2 /public_html/vendor/illuminate/database/Query/Builder.php(1583): Illuminate\Database\Connection->select('select distinct...', Array, true)
#3 /public_html/vendor/illuminate/database/Query/Builder.php(1569): Illuminate\Database\Query\Builder->runSelect()
#4 /public_html/vendor/illuminate/database/Query/Builder.php(1813): Illuminate\Database\Query\Builder->get(Array)
#5 /public_html/vendor/illuminate/database/Eloquent/Builder.php(442): Illuminate\Database\Query\Builder->pluck('card_type', NULL)
#6 /public_html/vendor/whmcs/whmcs-foundation/lib/User/Client.php(0): Illuminate\Database\Eloquent\Builder->pluck('card_type')
#7 /public_html/admin/clients.php(0): WHMCS\User\Client::getUsedCardTypes()
#8 {main}

Instead of doing a database/file restore again, I decided to just create the table and the columns myself. The process was create the table, add the column, see if it worked, if not, add the next column until the error messages go away. It worked. But I still couldn’t sleep knowing that what I made wasn’t right. I was just throwing columns without proper datatypes to see what stuck. In the end, I contacted WHMCS support and they gave me this code for the tblcreditcards table.

CREATE TABLE IF NOT EXISTS `tblcreditcards` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pay_method_id` int(11) NOT NULL DEFAULT '0',
  `card_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `last_four` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `expiry_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `card_data` blob NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `deleted_at` timestamp NULL,
  PRIMARY KEY (`id`),
  KEY `tblcreditcards_pay_method_id` (`pay_method_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

WHMCS support is very responsive and amazing! So glad I went with them.

Edel Alonhttp://edelalon.com
Edel-Ryan Alon is a starving musician, failed artist, connoisseur of fine foods, aspiring entrepreneur, husband, father of two, geek by day, cook by night, and an all around great guy.

Related Articles

Lion Cake

Documenting a lion cake. Nothing too fancy, just a lion cake.

S2000 Glove Box Organizer

Just highlighting this glove box organizer for the S2000 made by Modify Products. They seem to have other items for sale that fit this...

Today’s Winner

Just finished a lobster feast at New England Lobster in Burlingame, California. Many of you read about the 15-pound lobster. It was not a...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Stay Connected

440FollowersFollow
9,970FollowersFollow
12SubscribersSubscribe
- Advertisement -

Latest Articles

S2000 Glove Box Organizer

Just highlighting this glove box organizer for the S2000 made by Modify Products. They seem to have other items for sale that fit this...

Today’s Winner

Just finished a lobster feast at New England Lobster in Burlingame, California. Many of you read about the 15-pound lobster. It was not a...

How to Check Your Air Quality in the San Francisco Bay Area

The Bay Area Air Quality Management District (BAAQMD) has hourly air quality reports. Check your specific area for air quality before going out. Soot,...

Truffle Shiso Poke

Just experimenting...but I love it when an experiment turns into something great. This poke had a bright citrus woody flavor. Ingredients 1 pound of tuna 1/4 onion 2...

Yeti Rambler Review

I was only able to survive this past heatwave with my new Yeti Rambler. The Yeti Rambler kept my liquids cold. The best feature? Every...