v1.9.0: filter-recall (meervoud/vervoeging, ProRail/intercity/veerdienst/buurtbus) + vijf fixes (ETag na parse, WhatsApp-check, paywall JSON, start-guard, dedup op posted_at)
This commit is contained in:
parent
eab249ea57
commit
59f927b038
4 changed files with 107 additions and 54 deletions
|
|
@ -127,3 +127,20 @@ async def upgrade_v11(conn: Connection, scheme: Scheme) -> None:
|
|||
await conn.execute("ALTER TABLE entry ADD COLUMN posted BOOLEAN NOT NULL DEFAULT false")
|
||||
# Venster-query voor de titel-dedup: recent gepostede titels ophalen.
|
||||
await conn.execute("CREATE INDEX entry_date_idx ON entry (date)")
|
||||
|
||||
|
||||
@upgrade_table.register(description="Measure the title-dedup window on post time, not publication date")
|
||||
async def upgrade_v12(conn: Connection, scheme: Scheme) -> None:
|
||||
# posted_at = moment waarop de entry gebroadcast is. v11 meette het venster op
|
||||
# de publicatiedatum: een backdated item of een na een storing ingehaalde
|
||||
# batch viel daardoor buiten het venster en werd alsnog dubbel gepost.
|
||||
await conn.execute(
|
||||
"ALTER TABLE entry ADD COLUMN posted_at TIMESTAMP WITH TIME ZONE"
|
||||
if scheme == Scheme.POSTGRES
|
||||
else "ALTER TABLE entry ADD COLUMN posted_at TIMESTAMP"
|
||||
)
|
||||
# Bestaande gepostede entries: publicatiedatum is de beste benadering.
|
||||
await conn.execute("UPDATE entry SET posted_at = date WHERE posted AND posted_at IS NULL")
|
||||
# entry_date_idx diende alleen de oude dedup-query.
|
||||
await conn.execute("DROP INDEX IF EXISTS entry_date_idx")
|
||||
await conn.execute("CREATE INDEX entry_posted_at_idx ON entry (posted_at)")
|
||||
|
|
|
|||
Loading…
Reference in a new issue