Skip to content

Commit b655be6

Browse files
Merge pull request #78 from goldlabelapps/staging
Add migrations to rename prospects columns
2 parents ccdb747 + 9bc038c commit b655be6

6 files changed

Lines changed: 48 additions & 0 deletions
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- Migration: Rename company_name column to company in prospects table
2+
ALTER TABLE prospects RENAME COLUMN company_name TO company;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- Migration: Rename primary_email_last_verified_at column to sell_by_date in prospects table
2+
ALTER TABLE prospects RENAME COLUMN primary_email_last_verified_at TO sell_by_date;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- Migration: Rename primary_email_source column to source in prospects table
2+
ALTER TABLE prospects RENAME COLUMN primary_email_source TO source;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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 = "ALTER TABLE prospects RENAME COLUMN company_name TO company;"
8+
conn = get_db_connection_direct()
9+
cur = conn.cursor()
10+
cur.execute(sql)
11+
conn.commit()
12+
cur.close()
13+
conn.close()
14+
print("Migration complete: company_name column renamed to company in prospects table.")
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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 = "ALTER TABLE prospects RENAME COLUMN primary_email_last_verified_at TO sell_by_date;"
8+
conn = get_db_connection_direct()
9+
cur = conn.cursor()
10+
cur.execute(sql)
11+
conn.commit()
12+
cur.close()
13+
conn.close()
14+
print("Migration complete: primary_email_last_verified_at column renamed to sell_by_date in prospects table.")
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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 = "ALTER TABLE prospects RENAME COLUMN primary_email_source TO source;"
8+
conn = get_db_connection_direct()
9+
cur = conn.cursor()
10+
cur.execute(sql)
11+
conn.commit()
12+
cur.close()
13+
conn.close()
14+
print("Migration complete: primary_email_source column renamed to source in prospects table.")

0 commit comments

Comments
 (0)