Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Migration: Rename company_name column to company in prospects table
ALTER TABLE prospects RENAME COLUMN company_name TO company;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Migration: Rename primary_email_last_verified_at column to sell_by_date in prospects table
ALTER TABLE prospects RENAME COLUMN primary_email_last_verified_at TO sell_by_date;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Migration: Rename primary_email_source column to source in prospects table
ALTER TABLE prospects RENAME COLUMN primary_email_source TO source;
14 changes: 14 additions & 0 deletions app/api/prospects/sql/run_alter_rename_company_name_to_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import os
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../..')))
from app.utils.db import get_db_connection_direct

if __name__ == "__main__":
sql = "ALTER TABLE prospects RENAME COLUMN company_name TO company;"
conn = get_db_connection_direct()
cur = conn.cursor()
cur.execute(sql)
conn.commit()
cur.close()
conn.close()
print("Migration complete: company_name column renamed to company in prospects table.")
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import os
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../..')))
from app.utils.db import get_db_connection_direct

if __name__ == "__main__":
sql = "ALTER TABLE prospects RENAME COLUMN primary_email_last_verified_at TO sell_by_date;"
conn = get_db_connection_direct()
cur = conn.cursor()
cur.execute(sql)
conn.commit()
cur.close()
conn.close()
print("Migration complete: primary_email_last_verified_at column renamed to sell_by_date in prospects table.")
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import os
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../..')))
from app.utils.db import get_db_connection_direct

if __name__ == "__main__":
sql = "ALTER TABLE prospects RENAME COLUMN primary_email_source TO source;"
conn = get_db_connection_direct()
cur = conn.cursor()
cur.execute(sql)
conn.commit()
cur.close()
conn.close()
print("Migration complete: primary_email_source column renamed to source in prospects table.")
Loading