| import psycopg | |
| from psycopg.rows import dict_row | |
| def main(): | |
| conn_str = "postgresql://postgres:postgres@localhost:54322/postgres" | |
| with psycopg.connect(conn_str, row_factory=dict_row) as conn: | |
| with conn.cursor() as cur: | |
| # Find the org for the test user | |
| cur.execute(""" | |
| SELECT o.id, o.name | |
| FROM organizations o | |
| JOIN members m ON o.id = m.organization_id | |
| JOIN auth.users u ON m.user_id = u.id | |
| WHERE u.email = 'tester@tenderhub.co.ke' | |
| """) | |
| row = cur.fetchone() | |
| if not row: | |
| print("Org not found for tester@tenderhub.co.ke") | |
| return | |
| org_id = row['id'] | |
| print(f"Found Org: {row['name']} ({org_id})") | |
| # Update to WHITE_LABEL and add branding | |
| cur.execute(""" | |
| UPDATE organizations | |
| SET plan_type = 'WHITE_LABEL', | |
| white_label_branding = '{"logoText": "ContractorElite", "logoIcon": "🏗️"}' | |
| WHERE id = %s | |
| """, (org_id,)) | |
| conn.commit() | |
| print(f"Successfully elevated {org_id} to WHITE_LABEL with branding.") | |
| if __name__ == "__main__": | |
| main() | |