{"action":"opened","issue":{"url":"https://api.github.com/repos/paragonie/airship/issues/95","repository_url":"https://api.github.com/repos/paragonie/airship","labels_url":"https://api.github.com/repos/paragonie/airship/issues/95/labels{/name}","comments_url":"https://api.github.com/repos/paragonie/airship/issues/95/comments","events_url":"https://api.github.com/repos/paragonie/airship/issues/95/events","html_url":"https://github.com/paragonie/airship/issues/95","id":163651508,"number":95,"title":"Repeated setup doesn't detect already existing database","user":{"login":"kelunik","id":2743004,"avatar_url":"https://avatars.githubusercontent.com/u/2743004?v=3","gravatar_id":"","url":"https://api.github.com/users/kelunik","html_url":"https://github.com/kelunik","followers_url":"https://api.github.com/users/kelunik/followers","following_url":"https://api.github.com/users/kelunik/following{/other_user}","gists_url":"https://api.github.com/users/kelunik/gists{/gist_id}","starred_url":"https://api.github.com/users/kelunik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kelunik/subscriptions","organizations_url":"https://api.github.com/users/kelunik/orgs","repos_url":"https://api.github.com/users/kelunik/repos","events_url":"https://api.github.com/users/kelunik/events{/privacy}","received_events_url":"https://api.github.com/users/kelunik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-04T10:49:41Z","updated_at":"2016-07-04T10:49:41Z","closed_at":null,"body":"When using `docker-compose up --force-recreate`, we start in the setup process again. However, the database still exists. Airship should check if the existing schema is fine and use it.\r\n\r\nI think we also need a way to completely reset the `pgsql` / `database` container, as recreate doesn't delete the existing data. This is due to volumes being persistent.\r\n\r\n`string(83) \"SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation \"airship_users\" already exists\" string(861) \"CREATE TABLE airship_users ( userid BIGSERIAL PRIMARY KEY, username TEXT, password TEXT, totp_secret TEXT, enable_2factor BOOLEAN DEFAULT FALSE, session_canary TEXT, display_name TEXT, email TEXT, uniqueid TEXT, real_name TEXT DEFAULT NULL, birthdate TIMESTAMP NULL, allow_reset BOOLEAN DEFAULT FALSE, gpg_public_key TEXT, custom_fields JSONB NULL, publicprofile BOOLEAN DEFAULT FALSE, superuser BOOLEAN DEFAULT FALSE, created TIMESTAMP DEFAULT NOW(), modified TIMESTAMP DEFAULT NOW() ); CREATE UNIQUE INDEX ON airship_users (username); CREATE UNIQUE INDEX ON airship_users (uniqueid); DROP TRIGGER IF EXISTS update_airship_users_modtime ON airship_users; CREATE TRIGGER update_airship_users_modtime BEFORE UPDATE ON airship_users FOR EACH ROW EXECUTE PROCEDURE update_modtime(); \"`"}}
{"actor":{"display_login":"kelunik"}}