Skip to content

Commit 21ed522

Browse files
Merge pull request #41 from goldlabelapps/staging
Add script to reset prospects hide flags
2 parents 3415f47 + b420a24 commit 21ed522

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Script to reset all 'hide' values to false in the prospects table
2+
from app.utils.db import get_db_connection
3+
4+
def reset_hide():
5+
conn_gen = get_db_connection()
6+
conn = next(conn_gen)
7+
cur = conn.cursor()
8+
try:
9+
cur.execute("UPDATE prospects SET hide = FALSE;")
10+
conn.commit()
11+
print("All 'hide' values reset to FALSE.")
12+
except Exception as e:
13+
print(f"Error: {e}")
14+
conn.rollback()
15+
finally:
16+
cur.close()
17+
conn.close()
18+
19+
if __name__ == "__main__":
20+
reset_hide()

0 commit comments

Comments
 (0)