{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/32914","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/32914/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/32914/comments","events_url":"https://api.github.com/repos/rails/rails/issues/32914/events","html_url":"https://github.com/rails/rails/issues/32914","id":323930123,"node_id":"MDU6SXNzdWUzMjM5MzAxMjM=","number":32914,"title":"db:drop drops not created DB with postgresql and sqlite3 adapters (but not with mysql2)","user":{"login":"thisismydesign","id":3299948,"node_id":"MDQ6VXNlcjMyOTk5NDg=","avatar_url":"https://avatars3.githubusercontent.com/u/3299948?v=4","gravatar_id":"","url":"https://api.github.com/users/thisismydesign","html_url":"https://github.com/thisismydesign","followers_url":"https://api.github.com/users/thisismydesign/followers","following_url":"https://api.github.com/users/thisismydesign/following{/other_user}","gists_url":"https://api.github.com/users/thisismydesign/gists{/gist_id}","starred_url":"https://api.github.com/users/thisismydesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thisismydesign/subscriptions","organizations_url":"https://api.github.com/users/thisismydesign/orgs","repos_url":"https://api.github.com/users/thisismydesign/repos","events_url":"https://api.github.com/users/thisismydesign/events{/privacy}","received_events_url":"https://api.github.com/users/thisismydesign/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-17T08:55:30Z","updated_at":"2019-01-05T11:44:28Z","closed_at":null,"author_association":"NONE","body":"With postgresql and sqlite3 adapters running `db:drop` with a non-created DB acts as if the DB is there:\r\n`Dropped database '<env>'`. As opposed to in case of mysql2 adapter: `Database '<env>' does not exist`.\r\n\r\nAFACT this is because connecting to the DB with these adapters creates the DB. Example from sqlite3 adapter: https://github.com/rails/rails/blob/v5.1.6/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L30\r\n\r\n### Steps to reproduce\r\n\r\nStandalone Ruby gist to reproduce: https://gist.github.com/thisismydesign/c5c188b0094dfd0088115d6cbd81ae97\r\n\r\nSwitch the `database_configuration` param in `load_active_record_tasks` and execute via `rspec _rails#32914.rb` (or see *_output.txt).\r\n\r\n### Expected behavior\r\n\r\nOption 1: `db:drop` doesn't find DB unless it's explicitly created\r\nOption 2: behaviour is consistent across adapters (other adapters also create DB on connect)\r\n\r\n### Actual behavior\r\n\r\nFor postgresql and sqlite3 adapters (at least) not existing DB is said to be dropped.\r\n\r\n### System configuration\r\n**Rails version**: activerecord 5.1.6, pg 1.0.0, mysql2 0.5.1, sqlite3 1.3.13\r\n\r\n**Ruby version**: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin16]\r\n"},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/451648510","html_url":"https://github.com/rails/rails/issues/32914#issuecomment-451648510","issue_url":"https://api.github.com/repos/rails/rails/issues/32914","id":451648510,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTY0ODUxMA==","user":{"login":"rails-bot[bot]","id":28418009,"node_id":"MDM6Qm90Mjg0MTgwMDk=","avatar_url":"https://avatars0.githubusercontent.com/in/2272?v=4","gravatar_id":"","url":"https://api.github.com/users/rails-bot%5Bbot%5D","html_url":"https://github.com/apps/rails-bot","followers_url":"https://api.github.com/users/rails-bot%5Bbot%5D/followers","following_url":"https://api.github.com/users/rails-bot%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/rails-bot%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/rails-bot%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails-bot%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/rails-bot%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/rails-bot%5Bbot%5D/repos","events_url":"https://api.github.com/users/rails-bot%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/rails-bot%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2019-01-05T11:44:28Z","updated_at":"2019-01-05T11:44:28Z","author_association":"NONE","body":"This issue has been automatically marked as stale because it has not been commented on for at least three months.\nThe resources of the Rails team are limited, and so we are asking for your help.\nIf you can still reproduce this error on the `5-2-stable` branch or on `master`, please reply with all of the information you have about it in order to keep the issue open.\nThank you for all your contributions.\n"}}
{"actor":{"display_login":"rails-bot"}}