{"action":"created","issue":{"url":"https://api.github.com/repos/celery/django-celery-beat/issues/113","repository_url":"https://api.github.com/repos/celery/django-celery-beat","labels_url":"https://api.github.com/repos/celery/django-celery-beat/issues/113/labels{/name}","comments_url":"https://api.github.com/repos/celery/django-celery-beat/issues/113/comments","events_url":"https://api.github.com/repos/celery/django-celery-beat/issues/113/events","html_url":"https://github.com/celery/django-celery-beat/issues/113","id":286320645,"number":113,"title":"Migration Loop: A new migration is generated everytime I launch \"migrate\" command","user":{"login":"DEKHTIARJonathan","id":10923599,"avatar_url":"https://avatars2.githubusercontent.com/u/10923599?v=4","gravatar_id":"","url":"https://api.github.com/users/DEKHTIARJonathan","html_url":"https://github.com/DEKHTIARJonathan","followers_url":"https://api.github.com/users/DEKHTIARJonathan/followers","following_url":"https://api.github.com/users/DEKHTIARJonathan/following{/other_user}","gists_url":"https://api.github.com/users/DEKHTIARJonathan/gists{/gist_id}","starred_url":"https://api.github.com/users/DEKHTIARJonathan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DEKHTIARJonathan/subscriptions","organizations_url":"https://api.github.com/users/DEKHTIARJonathan/orgs","repos_url":"https://api.github.com/users/DEKHTIARJonathan/repos","events_url":"https://api.github.com/users/DEKHTIARJonathan/events{/privacy}","received_events_url":"https://api.github.com/users/DEKHTIARJonathan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-01-05T15:31:41Z","updated_at":"2018-02-07T09:32:26Z","closed_at":"2018-01-09T13:10:03Z","author_association":"NONE","body":"Hello dear friends,\r\n\r\nEverytimes I launch a migration of my application, django_celery_beat create an automatic migration: \r\n\r\n```\r\nMigrations for 'django_celery_beat':\r\n  ./venv/lib/site-packages/django_celery_beat/migrations/0008_auto_20180105_1622.py\r\n    - Alter field event on solarschedule\r\nRunning migrations:\r\n  Applying django_celery_beat.0008_auto_20180105_1622... OK\r\n```\r\n\r\nHere are a few examples:\r\n\r\n**0005_auto_20180105_1619.py**\r\n\r\n```python\r\noperations = [\r\n    migrations.AlterField(\r\n        model_name='solarschedule',\r\n        name='event',\r\n        field=models.CharField(choices=[('dawn_astronomical', 'dawn_astronomical'), ('dusk_civil', 'dusk_civil'), ('sunrise', 'sunrise'), ('dawn_civil', 'dawn_civil'), ('dusk_nautical', 'dusk_nautical'), ('solar_noon', 'solar_noon'), ('sunset', 'sunset'), ('dawn_nautical', 'dawn_nautical'), ('dusk_astronomical', 'dusk_astronomical')], max_length=24, verbose_name='event'),\r\n    ),\r\n]\r\n```\r\n\r\n**0006_auto_20180105_1622.py.py**\r\n\r\n```python\r\noperations = [\r\n    migrations.AlterField(\r\n        model_name='solarschedule',\r\n        name='event',\r\n        field=models.CharField(choices=[('dawn_civil', 'dawn_civil'), ('dusk_nautical', 'dusk_nautical'), ('solar_noon', 'solar_noon'), ('dawn_astronomical', 'dawn_astronomical'), ('sunset', 'sunset'), ('dusk_astronomical', 'dusk_astronomical'), ('dusk_civil', 'dusk_civil'), ('dawn_nautical', 'dawn_nautical'), ('sunrise', 'sunrise')], max_length=24, verbose_name='event'),\r\n    ),\r\n]\r\n\r\n```\r\n\r\n**0007_auto_20180105_1622.py**\r\n\r\n```python\r\noperations = [\r\n    migrations.AlterField(\r\n        model_name='solarschedule',\r\n        name='event',\r\n        field=models.CharField(choices=[('dusk_nautical', 'dusk_nautical'), ('solar_noon', 'solar_noon'), ('dusk_civil', 'dusk_civil'), ('dawn_astronomical', 'dawn_astronomical'), ('dawn_nautical', 'dawn_nautical'), ('dawn_civil', 'dawn_civil'), ('dusk_astronomical', 'dusk_astronomical'), ('sunset', 'sunset'), ('sunrise', 'sunrise')], max_length=24, verbose_name='event'),\r\n    ),\r\n]\r\n```\r\n\r\n**0008_auto_20180105_1622.py.py**\r\n\r\n```python\r\noperations = [\r\n    migrations.AlterField(\r\n        model_name='solarschedule',\r\n        name='event',\r\n        field=models.CharField(choices=[('dusk_astronomical', 'dusk_astronomical'), ('dusk_civil', 'dusk_civil'), ('dawn_nautical', 'dawn_nautical'), ('solar_noon', 'solar_noon'), ('dawn_astronomical', 'dawn_astronomical'), ('dusk_nautical', 'dusk_nautical'), ('sunrise', 'sunrise'), ('sunset', 'sunset'), ('dawn_civil', 'dawn_civil')], max_length=24, verbose_name='event'),\r\n    ),\r\n]\r\n```\r\n\r\nThe problem is quite easy to understand, the choices comes in a random order, which lead to a new migration each time (very likely).\r\n\r\nThanks for the help and the fix, I don't have time for a PR now.\r\n\r\nAll the best,\r\n\r\nJonathan D."},"comment":{"url":"https://api.github.com/repos/celery/django-celery-beat/issues/comments/363709781","html_url":"https://github.com/celery/django-celery-beat/issues/113#issuecomment-363709781","issue_url":"https://api.github.com/repos/celery/django-celery-beat/issues/113","id":363709781,"user":{"login":"DEKHTIARJonathan","id":10923599,"avatar_url":"https://avatars2.githubusercontent.com/u/10923599?v=4","gravatar_id":"","url":"https://api.github.com/users/DEKHTIARJonathan","html_url":"https://github.com/DEKHTIARJonathan","followers_url":"https://api.github.com/users/DEKHTIARJonathan/followers","following_url":"https://api.github.com/users/DEKHTIARJonathan/following{/other_user}","gists_url":"https://api.github.com/users/DEKHTIARJonathan/gists{/gist_id}","starred_url":"https://api.github.com/users/DEKHTIARJonathan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DEKHTIARJonathan/subscriptions","organizations_url":"https://api.github.com/users/DEKHTIARJonathan/orgs","repos_url":"https://api.github.com/users/DEKHTIARJonathan/repos","events_url":"https://api.github.com/users/DEKHTIARJonathan/events{/privacy}","received_events_url":"https://api.github.com/users/DEKHTIARJonathan/received_events","type":"User","site_admin":false},"created_at":"2018-02-07T09:32:26Z","updated_at":"2018-02-07T09:32:26Z","author_association":"NONE","body":"fixed however the fixed is not released yet"}}
{"actor":{"display_login":"DEKHTIARJonathan"}}