pgsql/update_tables_0.5.x-0.6.pgsql
changeset 595 86b967c0f1a1
parent 550 867d950ce7b7
equal deleted inserted replaced
594:cdbe200c0ecc 595:86b967c0f1a1
   305               FROM users, service_set, domain_data
   305               FROM users, service_set, domain_data
   306              WHERE users.gid = (SELECT gid
   306              WHERE users.gid = (SELECT gid
   307                                   FROM domain_name
   307                                   FROM domain_name
   308                                  WHERE domainname = the_domain)
   308                                  WHERE domainname = the_domain)
   309                AND local_part = localpart
   309                AND local_part = localpart
   310                AND service_set.ssid = users.ssid
       
   311                AND users.gid = domain_data.gid
   310                AND users.gid = domain_data.gid
   312                AND CASE WHEN
   311                AND CASE WHEN
   313                   users.ssid IS NOT NULL
   312                   users.ssid IS NOT NULL
   314                   THEN
   313                   THEN
   315                     service_set.ssid = users.ssid
   314                     service_set.ssid = users.ssid