| 1 | This is what the migration looks like: |
| 2 | {{{ |
| 3 | |
| 4 | class Migration(migrations.Migration): |
| 5 | |
| 6 | dependencies = [ |
| 7 | ('jobs', '0003_auto_20170222_1154'), |
| 8 | ] |
| 9 | |
| 10 | operations = [ |
| 11 | migrations.AlterField( |
| 12 | model_name='joblog', |
| 13 | name='job', |
| 14 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='logs', to='jobs.Job'), |
| 15 | ), |
| 16 | ] |
| 17 | |
| 18 | }}} |
| 19 | |
| 20 | Running ./mange.py migrate makes no difference. I recently moved the codebase to Python 3. |
| 21 | Below is the create table syntax for the relevant tables: |
| 22 | |
| 23 | {{{ |
| 24 | CREATE TABLE `jobs_jobparameter` ( |
| 25 | `id` int(11) NOT NULL AUTO_INCREMENT, |
| 26 | `name` varchar(100) NOT NULL, |
| 27 | `value` longtext NOT NULL, |
| 28 | `job_group_id` int(11) NOT NULL, |
| 29 | PRIMARY KEY (`id`), |
| 30 | UNIQUE KEY `jobs_jobparameter_job_group_id_bbb541f6_uniq` (`job_group_id`,`name`), |
| 31 | KEY `jobs_jobparameter_name_84b3d6ba_uniq` (`name`), |
| 32 | CONSTRAINT `jobs_jobparameter_job_group_id_7205c657_fk_jobs_jobgroup_id` FOREIGN KEY (`job_group_id`) REFERENCES `jobs_jobgroup` (`id`) |
| 33 | ) ENGINE=InnoDB AUTO_INCREMENT=45338 DEFAULT CHARSET=utf8 |
| 34 | |
| 35 | CREATE TABLE `jobs_joblog` ( |
| 36 | `id` int(11) NOT NULL AUTO_INCREMENT, |
| 37 | `command` longtext NOT NULL, |
| 38 | `command_output` longtext NOT NULL, |
| 39 | `result` tinyint(1) NOT NULL, |
| 40 | `job_id` int(11) NOT NULL, |
| 41 | PRIMARY KEY (`id`), |
| 42 | KEY `jobs_joblog_job_id_734186c1ec7977e9_fk_jobs_job_id` (`job_id`), |
| 43 | CONSTRAINT `jobs_joblog_job_id_ae8f8e96_fk_jobs_job_id` FOREIGN KEY (`job_id`) REFERENCES `jobs_job` (`id`) |
| 44 | ) ENGINE=InnoDB AUTO_INCREMENT=7749677 DEFAULT CHARSET=latin1 |
| 45 | |
| 46 | CREATE TABLE `jobs_jobgroup` ( |
| 47 | `id` int(11) NOT NULL AUTO_INCREMENT, |
| 48 | `job_type` varchar(100) NOT NULL, |
| 49 | `created_by_id` int(11) NOT NULL, |
| 50 | `created_date` datetime NOT NULL, |
| 51 | `queued_date` datetime DEFAULT NULL, |
| 52 | PRIMARY KEY (`id`), |
| 53 | KEY `jobs_jobgroup_created_by_id_769ccba8b90c80f8_fk_auth_user_id` (`created_by_id`), |
| 54 | KEY `jobs_jobgroup_job_type_c2db1010_uniq` (`job_type`), |
| 55 | KEY `jobs_jobgroup_created_date_852898d7_uniq` (`created_date`), |
| 56 | KEY `jobs_jobgroup_queued_date_c38be898_uniq` (`queued_date`), |
| 57 | CONSTRAINT `jobs_jobgroup_created_by_id_769ccba8b90c80f8_fk_auth_user_id` FOREIGN KEY (`created_by_id`) REFERENCES `auth_user` (`id`) |
| 58 | ) ENGINE=InnoDB AUTO_INCREMENT=15290 DEFAULT CHARSET=latin1 |
| 59 | |
| 60 | CREATE TABLE `jobs_job` ( |
| 61 | `id` int(11) NOT NULL AUTO_INCREMENT, |
| 62 | `state` varchar(1) NOT NULL, |
| 63 | `start_date` datetime DEFAULT NULL, |
| 64 | `end_date` datetime DEFAULT NULL, |
| 65 | `job_group_id` int(11) NOT NULL, |
| 66 | `store` varchar(40) NOT NULL, |
| 67 | `payload` longtext NOT NULL, |
| 68 | PRIMARY KEY (`id`), |
| 69 | KEY `jobs_job_be96d149` (`job_group_id`), |
| 70 | KEY `jobs_job_store_6681c0e7_uniq` (`store`), |
| 71 | KEY `jobs_job_start_date_b8aefdc3_uniq` (`start_date`), |
| 72 | KEY `jobs_job_state_6ec9b5f7_uniq` (`state`), |
| 73 | CONSTRAINT `jobs_job_job_group_id_93d2fccf_fk_jobs_jobgroup_id` FOREIGN KEY (`job_group_id`) REFERENCES `jobs_jobgroup` (`id`) |
| 74 | ) ENGINE=InnoDB AUTO_INCREMENT=3316872 DEFAULT CHARSET=latin1 |
| 75 | }}} |
| 76 | |
| 77 | The migrations are attached. |