SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE tiendanube( access_token varchar(40) ); INSERT INTO `tiendanube` (`access_token`) VALUES (1); ALTER TABLE `tiendanube` ADD `addon_conversions` JSON NULL DEFAULT NULL AFTER `access_token`; UPDATE `tiendanube` SET `addon_conversions` = '{"order_created":{"webhook_id":"0","endpoint":"0"},"order_paid":{"webhook_id":"0","endpoint":"0"},"product_created":{"webhook_id":"0","endpoint":"0"}}'; ALTER TABLE `tiendanube` ADD `addon_conversions_counter` JSON NULL DEFAULT NULL AFTER `addon_conversions`; UPDATE `tiendanube` SET `addon_conversions_counter` = '{"product_id":0,"endpoint":0}'; ALTER TABLE `tiendanube` ADD `product_created` JSON NOT NULL AFTER `access_token`; UPDATE `tiendanube` SET `product_created` = 1337; ALTER TABLE `tiendanube` ADD `order_created` JSON NOT NULL AFTER `access_token`; UPDATE `tiendanube` SET `order_created` = 6789; ALTER TABLE `tiendanube` ADD `order_paid` JSON NOT NULL AFTER `access_token`; UPDATE `tiendanube` SET `order_paid` = 12345; INSERT INTO `tiendanube` (`access_token`, `order_paid`, `order_created`, `product_created`, `addon_conversions`, `addon_conversions_counter`) VALUES ('3', '3', '5', '1', '2', '3'); UPDATE `tiendanube` SET `addon_conversions` = JSON_SET( addon_conversions, '$.order_created.webhook_id', ( tiendanube.order_created ), '$.order_paid.webhook_id', ( tiendanube.order_paid ), '$.product_created.webhook_id', ( tiendanube.product_created ) ) WHERE `access_token` = 1; select * from tiendanube ;
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear