Closed Bug 1277889 Opened 9 years ago Closed 9 years ago

Manually apply migrations from bug 1233164 on production

Categories

(Tree Management :: Treeherder: Infrastructure, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: jgraham)

References

Details

The next prod deploy is blocked on manually making the migration changes from bug 1233164, since otherwise it causes the deploy to time out. These are the changes not yet on prod: https://github.com/mozilla/treeherder/compare/production...master Migration-wise: treeherder/model/migrations/0026_failure_line_job_log_id.py (bug 1233164) treeherder/perf/migrations/0016_manually_created_alerts.py (bug 1260791) The perfherder one should be fine to do automatically, so we should: 1) Dump the sql for the failure line changes (see https://docs.djangoproject.com/en/1.8/ref/django-admin/#django-admin-sqlmigrate) 2) Run that sql against prod 3) Run a `./migrate.py model 0026_failure_line_job_log_id --fake` to mark just the model one as already complete (I'm happy to do this on the admin node, or else the Django migrations table can be manually updated) 4) Deploy master -> which will cause just the perf change to be applied
Relevant SQL is BEGIN; ALTER TABLE `failure_line` ADD COLUMN `job_log_id` integer NULL; ALTER TABLE `failure_line` ALTER COLUMN `job_log_id` DROP DEFAULT; ALTER TABLE `failure_line` ADD CONSTRAINT `failure_line_job_log_id_2bb6c3dc51971773_uniq` UNIQUE (`job_log_id`, `line`); CREATE INDEX `failure_line_48d13415` ON `failure_line` (`job_log_id`); ALTER TABLE `failure_line` ADD CONSTRAINT `failure_line_job_log_id_43890ddf81dc5128_fk_job_log_id` FOREIGN KEY (`job_log_id`) REFERENCES `job_log` (`id`); COMMIT; I can run this on prod
OK, I have set this running.
Done the migration and updated the table so it is marked as applied (I think). I haven't done an actual deploy though.
I've just done a prod deploy, which worked fine. Thank you for sorting this :-) [2016-06-06 11:05:49] [localhost] running: cd /data/treeherder/src/treeherder.mozilla.org/treeherder-service && source /data/treeherder/src/treeherder.mozilla.org/treeherder-env.sh && python2.7 manage.py migrate --noinput [2016-06-06 11:05:52] [localhost] finished: cd /data/treeherder/src/treeherder.mozilla.org/treeherder-service && source /data/treeherder/src/treeherder.mozilla.org/treeherder-env.sh && python2.7 manage.py migrate --noinput (2.652s) [localhost] out: Operations to perform: [localhost] out: Synchronize unmigrated apps: log_parser, django_browserid, corsheaders, autoclassify, staticfiles, messages, rest_framework_swagger, runserver_nostatic, webapp, rest_framework, embed, hawkrest, etl [localhost] out: Apply all migrations: perf, sessions, admin, sites, auth, contenttypes, credentials, model [localhost] out: Synchronizing apps without migrations: [localhost] out: Creating tables... [localhost] out: Running deferred SQL... [localhost] out: Installing custom SQL... [localhost] out: Running migrations: [localhost] out: Rendering model states... DONE [localhost] out: Applying perf.0016_manually_created_alerts... OK
Assignee: nobody → james
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.