{"action":"created","issue":{"url":"https://api.github.com/repos/codalab/codalab-cli/issues/379","repository_url":"https://api.github.com/repos/codalab/codalab-cli","labels_url":"https://api.github.com/repos/codalab/codalab-cli/issues/379/labels{/name}","comments_url":"https://api.github.com/repos/codalab/codalab-cli/issues/379/comments","events_url":"https://api.github.com/repos/codalab/codalab-cli/issues/379/events","html_url":"https://github.com/codalab/codalab-cli/pull/379","id":139080362,"number":379,"title":"Create user migration script","user":{"login":"kashizui","id":614837,"avatar_url":"https://avatars.githubusercontent.com/u/614837?v=3","gravatar_id":"","url":"https://api.github.com/users/kashizui","html_url":"https://github.com/kashizui","followers_url":"https://api.github.com/users/kashizui/followers","following_url":"https://api.github.com/users/kashizui/following{/other_user}","gists_url":"https://api.github.com/users/kashizui/gists{/gist_id}","starred_url":"https://api.github.com/users/kashizui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kashizui/subscriptions","organizations_url":"https://api.github.com/users/kashizui/orgs","repos_url":"https://api.github.com/users/kashizui/repos","events_url":"https://api.github.com/users/kashizui/events{/privacy}","received_events_url":"https://api.github.com/users/kashizui/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-07T20:09:09Z","updated_at":"2016-03-11T02:39:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/codalab/codalab-cli/pulls/379","html_url":"https://github.com/codalab/codalab-cli/pull/379","diff_url":"https://github.com/codalab/codalab-cli/pull/379.diff","patch_url":"https://github.com/codalab/codalab-cli/pull/379.patch"},"body":"This script migrates users from the Django user models to the bundle service\r\ndatabase.\r\n\r\n1. Load user data from the Django database. Users with is_active=0 are not picked up.\r\n2. ~~Generate a new id for each user using the uuid scheme~~\r\n3. Update existing rows in the bundle service users table, using the Django\r\n   user models as a source of truth, leaving only the disk/time quota and usage\r\n   columns intact.\r\n4. Insert remaining users into the bundle service users table, filling in the\r\n   configured default quota information.\r\n5. Mark all users in the Django database as inactive, which means that they\r\n   will not be picked up in future runs of the migration script.\r\n\r\nBy default, this script runs in dry-run mode, i.e. it prints verbose output\r\nsuch as the generate SQL queries but does not make changes to the databases.\r\nWhen you're ready to perform the migration, run with the '-f' flag.\r\n\r\n@klopyrev @percyliang "},"comment":{"url":"https://api.github.com/repos/codalab/codalab-cli/issues/comments/195152828","html_url":"https://github.com/codalab/codalab-cli/pull/379#issuecomment-195152828","issue_url":"https://api.github.com/repos/codalab/codalab-cli/issues/379","id":195152828,"user":{"login":"klopyrev","id":5249090,"avatar_url":"https://avatars.githubusercontent.com/u/5249090?v=3","gravatar_id":"","url":"https://api.github.com/users/klopyrev","html_url":"https://github.com/klopyrev","followers_url":"https://api.github.com/users/klopyrev/followers","following_url":"https://api.github.com/users/klopyrev/following{/other_user}","gists_url":"https://api.github.com/users/klopyrev/gists{/gist_id}","starred_url":"https://api.github.com/users/klopyrev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klopyrev/subscriptions","organizations_url":"https://api.github.com/users/klopyrev/orgs","repos_url":"https://api.github.com/users/klopyrev/repos","events_url":"https://api.github.com/users/klopyrev/events{/privacy}","received_events_url":"https://api.github.com/users/klopyrev/received_events","type":"User","site_admin":false},"created_at":"2016-03-11T02:39:57Z","updated_at":"2016-03-11T02:39:57Z","body":"LGTM. Please address last comments before submitting."}}