Skip to content

Commit ccdb747

Browse files
Merge pull request #77 from goldlabelapps/staging
Add migrations to drop and rename prospect columns
2 parents 2853dad + 9128bec commit ccdb747

4 files changed

Lines changed: 32 additions & 0 deletions
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- Migration: Remove primary_email_verification_source column from prospects table
2+
ALTER TABLE prospects DROP COLUMN IF EXISTS primary_email_verification_source;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- Migration: Rename corporate_phone column to phone in prospects table
2+
ALTER TABLE prospects RENAME COLUMN corporate_phone TO phone;
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 DROP COLUMN IF EXISTS primary_email_verification_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_verification_source column dropped from 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 corporate_phone TO phone;"
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: corporate_phone column renamed to phone in prospects table.")

0 commit comments

Comments
 (0)