RAG-api / scripts /mark_superseded.py
Minh Be
deploy FastAPI backend
3e1cbf3
Raw History Blame Contribute Delete
582 Bytes
"""Đánh dấu BLLĐ 2012 hết hiệu lực khi BLLĐ 2019 có hiệu lực (2021-01-01)."""
from sqlalchemy import text
from app.db.base import engine
with engine.begin() as c:
n = c.execute(
text(
"UPDATE legal_node SET effective_to='2021-01-01' "
"WHERE doc_id='blld2012' AND effective_to IS NULL"
)
).rowcount
c.execute(
text(
"UPDATE legal_document SET expired_date='2021-01-01', status='expired' "
"WHERE doc_id='blld2012'"
)
)
print("blld2012 nodes marked expired:", n)