various enhancements for new tabs and bug fixes
This commit is contained in:
@@ -201,6 +201,24 @@ def all_seeds(sync_conn):
|
||||
ON CONFLICT (id) DO NOTHING
|
||||
""", (d["focus"], d["task"]))
|
||||
|
||||
# Junction table seeds for contact tabs
|
||||
cur.execute("""
|
||||
INSERT INTO contact_tasks (contact_id, task_id, role)
|
||||
VALUES (%s, %s, 'assignee') ON CONFLICT DO NOTHING
|
||||
""", (d["contact"], d["task"]))
|
||||
cur.execute("""
|
||||
INSERT INTO contact_projects (contact_id, project_id, role)
|
||||
VALUES (%s, %s, 'stakeholder') ON CONFLICT DO NOTHING
|
||||
""", (d["contact"], d["project"]))
|
||||
cur.execute("""
|
||||
INSERT INTO contact_meetings (contact_id, meeting_id, role)
|
||||
VALUES (%s, %s, 'attendee') ON CONFLICT DO NOTHING
|
||||
""", (d["contact"], d["meeting"]))
|
||||
cur.execute("""
|
||||
INSERT INTO contact_lists (contact_id, list_id, role)
|
||||
VALUES (%s, %s, 'contributor') ON CONFLICT DO NOTHING
|
||||
""", (d["contact"], d["list"]))
|
||||
|
||||
# Process
|
||||
cur.execute("""
|
||||
INSERT INTO processes (id, name, process_type, status, category, is_deleted, created_at, updated_at)
|
||||
@@ -253,6 +271,11 @@ def all_seeds(sync_conn):
|
||||
|
||||
# Cleanup: delete all seed data (reverse dependency order)
|
||||
try:
|
||||
# Junction tables first
|
||||
cur.execute("DELETE FROM contact_tasks WHERE task_id = %s", (d["task"],))
|
||||
cur.execute("DELETE FROM contact_projects WHERE project_id = %s", (d["project"],))
|
||||
cur.execute("DELETE FROM contact_meetings WHERE meeting_id = %s", (d["meeting"],))
|
||||
cur.execute("DELETE FROM contact_lists WHERE list_id = %s", (d["list"],))
|
||||
cur.execute("DELETE FROM files WHERE id = %s", (d["file"],))
|
||||
if os.path.exists(dummy_file_path):
|
||||
os.remove(dummy_file_path)
|
||||
|
||||
Reference in New Issue
Block a user