{"action":"opened","number":28,"pull_request":{"url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/pulls/28","id":229964438,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5OTY0NDM4","html_url":"https://github.com/yandex-money/yandex-money-kit-django/pull/28","diff_url":"https://github.com/yandex-money/yandex-money-kit-django/pull/28.diff","patch_url":"https://github.com/yandex-money/yandex-money-kit-django/pull/28.patch","issue_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/issues/28","number":28,"state":"open","locked":false,"title":"Idempotent migrations","user":{"login":"paramono","id":11635829,"node_id":"MDQ6VXNlcjExNjM1ODI5","avatar_url":"https://avatars0.githubusercontent.com/u/11635829?v=4","gravatar_id":"","url":"https://api.github.com/users/paramono","html_url":"https://github.com/paramono","followers_url":"https://api.github.com/users/paramono/followers","following_url":"https://api.github.com/users/paramono/following{/other_user}","gists_url":"https://api.github.com/users/paramono/gists{/gist_id}","starred_url":"https://api.github.com/users/paramono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paramono/subscriptions","organizations_url":"https://api.github.com/users/paramono/orgs","repos_url":"https://api.github.com/users/paramono/repos","events_url":"https://api.github.com/users/paramono/events{/privacy}","received_events_url":"https://api.github.com/users/paramono/received_events","type":"User","site_admin":false},"body":"Частичное решение вот этой проблемы:\r\nhttps://github.com/yandex-money/yandex-money-kit-django/issues/11\r\n\r\nМиграции в yandex_money зависят от настроек проекта, а настройки могут быть разные для разных environments (development, staging, production, etc.). Как следствие, если у пользователя различаются настройки кассы для тестового и боевого режима, то придётся держать различный комплект миграций для разных сред. Это не согласуется с рекомендациями Django:\r\n\r\nhttps://docs.djangoproject.com/en/dev/topics/migrations/\r\n>The migration files for each app live in a “migrations” directory inside of that app, and are designed to be committed to, and distributed as part of, its codebase. You should be making them once on your development machine and then running the same migrations on your colleagues’ machines, your staging machines, and eventually your production machines.\r\n\r\nМоё решение добавляет вторую миграцию, которая отменяет некоторые свойства первой. Но тогда, чтобы продолжить пользоваться пакетом, нужно написать инструкцию, которая объяснит пользователям, как безболезненно переехать на новую версию yandex_money (упрощённые примеры инструкций я описал в Issue). Я не являюсь мейнтейнером, и не могу принять такое решение самостоятельно.\r\n\r\nЧтобы пользователю не приходилось постоянно вбивать дефолты, я реализовал classmethod create() для модели Payment, тоже согласно документации: https://docs.djangoproject.com/en/dev/ref/models/instances/#creating-objects\r\n\r\nЯ считаю, это очень важная проблема, потому что на более серьёзных джанго-проектах ломается деплоймент, ведь команда makemigrations должна запускаться только в разработке, а в продакшене должен запускаться только migrate. Если yandex_money сидит в site_packages, эта схема целиком ломается.","created_at":"2018-11-11T17:04:18Z","updated_at":"2018-11-11T17:04:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/pulls/28/commits","review_comments_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/pulls/28/comments","review_comment_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/issues/28/comments","statuses_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/statuses/99a1cd0d0870a23feba3b9fae1ab501038b3ab19","head":{"label":"paramono:idempotent_migrations","ref":"idempotent_migrations","sha":"99a1cd0d0870a23feba3b9fae1ab501038b3ab19","user":{"login":"paramono","id":11635829,"node_id":"MDQ6VXNlcjExNjM1ODI5","avatar_url":"https://avatars0.githubusercontent.com/u/11635829?v=4","gravatar_id":"","url":"https://api.github.com/users/paramono","html_url":"https://github.com/paramono","followers_url":"https://api.github.com/users/paramono/followers","following_url":"https://api.github.com/users/paramono/following{/other_user}","gists_url":"https://api.github.com/users/paramono/gists{/gist_id}","starred_url":"https://api.github.com/users/paramono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paramono/subscriptions","organizations_url":"https://api.github.com/users/paramono/orgs","repos_url":"https://api.github.com/users/paramono/repos","events_url":"https://api.github.com/users/paramono/events{/privacy}","received_events_url":"https://api.github.com/users/paramono/received_events","type":"User","site_admin":false},"repo":{"id":157069562,"node_id":"MDEwOlJlcG9zaXRvcnkxNTcwNjk1NjI=","name":"yandex-money-kit-django","full_name":"paramono/yandex-money-kit-django","private":false,"owner":{"login":"paramono","id":11635829,"node_id":"MDQ6VXNlcjExNjM1ODI5","avatar_url":"https://avatars0.githubusercontent.com/u/11635829?v=4","gravatar_id":"","url":"https://api.github.com/users/paramono","html_url":"https://github.com/paramono","followers_url":"https://api.github.com/users/paramono/followers","following_url":"https://api.github.com/users/paramono/following{/other_user}","gists_url":"https://api.github.com/users/paramono/gists{/gist_id}","starred_url":"https://api.github.com/users/paramono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paramono/subscriptions","organizations_url":"https://api.github.com/users/paramono/orgs","repos_url":"https://api.github.com/users/paramono/repos","events_url":"https://api.github.com/users/paramono/events{/privacy}","received_events_url":"https://api.github.com/users/paramono/received_events","type":"User","site_admin":false},"html_url":"https://github.com/paramono/yandex-money-kit-django","description":null,"fork":true,"url":"https://api.github.com/repos/paramono/yandex-money-kit-django","forks_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/forks","keys_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/teams","hooks_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/hooks","issue_events_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/issues/events{/number}","events_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/events","assignees_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/assignees{/user}","branches_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/branches{/branch}","tags_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/tags","blobs_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/git/refs{/sha}","trees_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/statuses/{sha}","languages_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/languages","stargazers_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/stargazers","contributors_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/contributors","subscribers_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/subscribers","subscription_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/subscription","commits_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/commits{/sha}","git_commits_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/git/commits{/sha}","comments_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/comments{/number}","issue_comment_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/issues/comments{/number}","contents_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/contents/{+path}","compare_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/merges","archive_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/downloads","issues_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/issues{/number}","pulls_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/pulls{/number}","milestones_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/milestones{/number}","notifications_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/labels{/name}","releases_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/releases{/id}","deployments_url":"https://api.github.com/repos/paramono/yandex-money-kit-django/deployments","created_at":"2018-11-11T10:40:22Z","updated_at":"2018-11-11T16:04:12Z","pushed_at":"2018-11-11T16:28:45Z","git_url":"git://github.com/paramono/yandex-money-kit-django.git","ssh_url":"git@github.com:paramono/yandex-money-kit-django.git","clone_url":"https://github.com/paramono/yandex-money-kit-django.git","svn_url":"https://github.com/paramono/yandex-money-kit-django","homepage":null,"size":71,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"yandex-money:master","ref":"master","sha":"02f7e35e59447ec9bada13f3934453b1700ef02f","user":{"login":"yandex-money","id":6553002,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY1NTMwMDI=","avatar_url":"https://avatars0.githubusercontent.com/u/6553002?v=4","gravatar_id":"","url":"https://api.github.com/users/yandex-money","html_url":"https://github.com/yandex-money","followers_url":"https://api.github.com/users/yandex-money/followers","following_url":"https://api.github.com/users/yandex-money/following{/other_user}","gists_url":"https://api.github.com/users/yandex-money/gists{/gist_id}","starred_url":"https://api.github.com/users/yandex-money/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yandex-money/subscriptions","organizations_url":"https://api.github.com/users/yandex-money/orgs","repos_url":"https://api.github.com/users/yandex-money/repos","events_url":"https://api.github.com/users/yandex-money/events{/privacy}","received_events_url":"https://api.github.com/users/yandex-money/received_events","type":"Organization","site_admin":false},"repo":{"id":30417450,"node_id":"MDEwOlJlcG9zaXRvcnkzMDQxNzQ1MA==","name":"yandex-money-kit-django","full_name":"yandex-money/yandex-money-kit-django","private":false,"owner":{"login":"yandex-money","id":6553002,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY1NTMwMDI=","avatar_url":"https://avatars0.githubusercontent.com/u/6553002?v=4","gravatar_id":"","url":"https://api.github.com/users/yandex-money","html_url":"https://github.com/yandex-money","followers_url":"https://api.github.com/users/yandex-money/followers","following_url":"https://api.github.com/users/yandex-money/following{/other_user}","gists_url":"https://api.github.com/users/yandex-money/gists{/gist_id}","starred_url":"https://api.github.com/users/yandex-money/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yandex-money/subscriptions","organizations_url":"https://api.github.com/users/yandex-money/orgs","repos_url":"https://api.github.com/users/yandex-money/repos","events_url":"https://api.github.com/users/yandex-money/events{/privacy}","received_events_url":"https://api.github.com/users/yandex-money/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/yandex-money/yandex-money-kit-django","description":null,"fork":false,"url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django","forks_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/forks","keys_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/teams","hooks_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/hooks","issue_events_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/issues/events{/number}","events_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/events","assignees_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/assignees{/user}","branches_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/branches{/branch}","tags_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/tags","blobs_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/git/refs{/sha}","trees_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/statuses/{sha}","languages_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/languages","stargazers_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/stargazers","contributors_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/contributors","subscribers_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/subscribers","subscription_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/subscription","commits_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/commits{/sha}","git_commits_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/git/commits{/sha}","comments_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/comments{/number}","issue_comment_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/issues/comments{/number}","contents_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/contents/{+path}","compare_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/merges","archive_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/downloads","issues_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/issues{/number}","pulls_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/pulls{/number}","milestones_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/milestones{/number}","notifications_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/labels{/name}","releases_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/releases{/id}","deployments_url":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/deployments","created_at":"2015-02-06T15:01:54Z","updated_at":"2018-10-21T18:59:30Z","pushed_at":"2018-09-11T12:38:22Z","git_url":"git://github.com/yandex-money/yandex-money-kit-django.git","ssh_url":"git@github.com:yandex-money/yandex-money-kit-django.git","clone_url":"https://github.com/yandex-money/yandex-money-kit-django.git","svn_url":"https://github.com/yandex-money/yandex-money-kit-django","homepage":null,"size":65,"stargazers_count":49,"watchers_count":49,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":69,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":69,"open_issues":3,"watchers":49,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/pulls/28"},"html":{"href":"https://github.com/yandex-money/yandex-money-kit-django/pull/28"},"issue":{"href":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/issues/28"},"comments":{"href":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/yandex-money/yandex-money-kit-django/statuses/99a1cd0d0870a23feba3b9fae1ab501038b3ab19"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":4,"additions":65,"deletions":8,"changed_files":3}}
{"actor":{"display_login":"paramono"}}