-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PPR account drafts mark as used. (#1950)
Signed-off-by: Doug Lovett <[email protected]>
- Loading branch information
1 parent
429fe35
commit bb3d0ed
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
-- 21975 begin PPR API build 1.2.5 | ||
|
||
-- 3635874 PROD 2024-06-24 | ||
select max(id) | ||
from drafts | ||
; | ||
|
||
-- 1886177 | ||
select max(id) | ||
from drafts | ||
where account_id = '0' | ||
; | ||
|
||
-- 1746001 | ||
select count(d.id) | ||
from drafts d, registrations r | ||
where d.account_id != '0' | ||
and d.account_id not like '%_USED' | ||
and d.id = r.draft_id | ||
and d.id between 1886177 and 2300000 -- 412787 | ||
-- and d.id between 2300001 and 2800000 -- 498879 | ||
-- and d.id between 2800001 and 3300000 -- 499138 | ||
-- and d.id > 3300000 -- 335219 | ||
; | ||
update drafts | ||
set account_id = account_id || '_USED' | ||
where id in (select d.id | ||
from drafts d, registrations r | ||
where d.account_id != '0' | ||
and d.account_id not like '%_USED' | ||
and d.id = r.draft_id | ||
and d.id between 1886177 and 2300000) | ||
; | ||
|
||
update drafts | ||
set account_id = account_id || '_USED' | ||
where id in (select d.id | ||
from drafts d, registrations r | ||
where d.account_id != '0' | ||
and d.account_id not like '%_USED' | ||
and d.id = r.draft_id | ||
and d.id between 2300001 and 2800000) | ||
; | ||
update drafts | ||
set account_id = account_id || '_USED' | ||
where id in (select d.id | ||
from drafts d, registrations r | ||
where d.account_id != '0' | ||
and d.account_id not like '%_USED' | ||
and d.id = r.draft_id | ||
and d.id between 2800001 and 3300000) | ||
; | ||
update drafts | ||
set account_id = account_id || '_USED' | ||
where id in (select d.id | ||
from drafts d, registrations r | ||
where d.account_id != '0' | ||
and d.account_id not like '%_USED' | ||
and d.id = r.draft_id | ||
and d.id > 3300000) | ||
; | ||
|
||
-- 21975 end PPR API build 1.2.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters