diff --git a/migrations/000.046.sql b/migrations/000.046.sql new file mode 100644 index 0000000..35ba1a8 --- /dev/null +++ b/migrations/000.046.sql @@ -0,0 +1,30 @@ +-- P5-1679 + +UPDATE contract_customers AS t_upd +SET ( + "reseller-companyname", + "reseller-address", + "reseller-zipcode", + "reseller-city", + "reseller-email", + "reseller-phone" +) = ( + SELECT + companyname, + address, + zipcode, + city, + email, + phone + FROM contract_customers AS t_sel + WHERE t_sel.contractcustomerid = t_upd.contractcustomerid +) +WHERE + dealerstore + AND "reseller-companyname" IS NULL + AND "reseller-address" IS NULL + AND "reseller-zipcode" IS NULL + AND "reseller-city" IS NULL + AND "reseller-email" IS NULL + AND "reseller-phone" IS NULL +; \ No newline at end of file