Closed Bug 1418488 Opened 7 years ago Closed 7 years ago

drop EmailCampaign, EmailContact, and related models

Categories

(Socorro :: Database, task, P1)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: willkg, Assigned: willkg)

References

Details

Attachments

(1 file)

We use sqlalchemy as an ORM in the Socorro apps. The models are defined in socorro/external/postgresql/models.py. In that file, there are several models: 1. EmailCampign 2. EmailContact 3. EmailCampaignsContact EmailCampaign has bugs preventing sqlalchemy ORM from using the models. Further, these three models aren't used anywhere and have no tests. This bug covers creating a migration to remove the database tables and removing the model code.
I can't use the ORM until this gets resolved, so I'm making it a P1 and grabbing it to do asap. One thing I don't know offhand if there's data in these tables in production that we need to keep. I'll look into that.
Assignee: nobody → willkg
Blocks: 1407655
Status: NEW → ASSIGNED
Priority: -- → P1
After that PR lands, we need to run alembic migrations on the admin nodes.
Commits pushed to master at https://github.com/mozilla-services/socorro https://github.com/mozilla-services/socorro/commit/26a4c30e858db66d07af9c5b133ab2530e20a532 fixes bug 1418488 - drop EmailCampaign, EmailContact, and EmailCampaignsContact Socorro no longer uses these tables, so time to drop them. https://github.com/mozilla-services/socorro/commit/44510de6a91a4ffabbdb518e00a958c7b885416f Merge pull request #4214 from willkg/1418488-drop-email fixes bug 1418488 - drop EmailCampaign, EmailContact, and EmailCampaignsContact
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
I updated the -stage admin node and then checked the email* tables to see if they had any data. They didn't: breakpad=> select count(*) from email_campaigns; count ------- 0 (1 row) breakpad=> select count(*) from email_contacts; count ------- 0 (1 row) Then I ran the migrations: (socorro-virtualenv)[root@xxx application]# env sqlalchemy.url=postgresql://xxx:xxx@xxx/breakpad alembic -c /etc/socorro/alembic.ini upgrade heads INFO [alembic.runtime.migration] Context impl PostgresqlImpl. INFO [alembic.runtime.migration] Will assume transactional DDL. INFO [alembic.runtime.migration] Running upgrade 77856f165be7 -> f35c26426066, bug 1418488 drop emailcampaign (socorro-virtualenv)[root@xxx application]# env sqlalchemy.url=postgresql://xxx:xxx@xxx/breakpad alembic -c /etc/socorro/alembic.ini upgrade history INFO [alembic.runtime.migration] Context impl PostgresqlImpl. INFO [alembic.runtime.migration] Will assume transactional DDL. ERROR [alembic.util.messaging] Can't locate revision identified by 'history' FAILED: Can't locate revision identified by 'history' (socorro-virtualenv)[root@xxx application]# env sqlalchemy.url=postgresql://xxx:xxx@xxx/breakpad alembic -c /etc/socorro/alembic.ini current INFO [alembic.runtime.migration] Context impl PostgresqlImpl. INFO [alembic.runtime.migration] Will assume transactional DDL. f35c26426066 (head) I'll do -prod after we deploy to -prod.
I checked -prod and it also has no data, so we don't need to dump anything. After we deploy to -prod, I'll run the migrations.
Ran the migration in -prod: (socorro-virtualenv)[root@xxx application]# env sqlalchemy.url=postgresql://xxx:xxx@xxx/breakpad alembic -c /etc/socorro/alembic.ini upgrade heads INFO [alembic.runtime.migration] Context impl PostgresqlImpl. INFO [alembic.runtime.migration] Will assume transactional DDL. INFO [alembic.runtime.migration] Running upgrade 77856f165be7 -> f35c26426066, bug 1418488 drop emailcampaign (socorro-virtualenv)[root@xxx application]# All done!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: