diff --git a/db_scripts/diff/15770.down b/db_scripts/diff/15770.down new file mode 100644 index 00000000..8be0abc2 --- /dev/null +++ b/db_scripts/diff/15770.down @@ -0,0 +1,2 @@ +USE kamailio; +DELETE FROM usr_preferences where attribute = 'reseller_id'; \ No newline at end of file diff --git a/db_scripts/diff/15770.up b/db_scripts/diff/15770.up new file mode 100644 index 00000000..568f2bf0 --- /dev/null +++ b/db_scripts/diff/15770.up @@ -0,0 +1,11 @@ + +SET AUTOCOMMIT=0; +USE kamailio; + +INSERT INTO usr_preferences (uuid,username,domain,attribute,type,value,last_modified) +SELECT uuid,username,domain,'reseller_id',type,( + SELECT reseller_id FROM billing.contracts LEFT JOIN billing.contacts on billing.contacts.id=billing.contracts.contact_id + WHERE billing.contracts.id=value + ),now() FROM usr_preferences WHERE attribute='account_id'; + +COMMIT; \ No newline at end of file