Skip to content

Commit 05e6e5b

Browse files
committed
Add script to reset prospects flag and hide
Introduce a standalone maintenance script at app/api/prospects/sql/reset_flag_hide.py that runs a SQL UPDATE to set prospects.flag and prospects.hide to FALSE for all rows. The script obtains a direct DB connection via get_db_connection_direct(), executes the update, commits, and prints a confirmation. Useful for resetting prospect visibility states during maintenance or migrations.
1 parent da2b964 commit 05e6e5b

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import os
2+
import sys
3+
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../..')))
4+
from app.utils.db import get_db_connection_direct
5+
6+
if __name__ == "__main__":
7+
sql = """
8+
UPDATE prospects
9+
SET flag = FALSE, hide = FALSE;
10+
"""
11+
conn = get_db_connection_direct()
12+
cur = conn.cursor()
13+
cur.execute(sql)
14+
conn.commit()
15+
cur.close()
16+
conn.close()
17+
print("All prospects' flag and hide columns have been reset to FALSE.")

0 commit comments

Comments
 (0)