{"action":"created","issue":{"url":"https://api.github.com/repos/aodn/aatams/issues/218","labels_url":"https://api.github.com/repos/aodn/aatams/issues/218/labels{/name}","comments_url":"https://api.github.com/repos/aodn/aatams/issues/218/comments","events_url":"https://api.github.com/repos/aodn/aatams/issues/218/events","html_url":"https://github.com/aodn/aatams/pull/218","id":86855580,"number":218,"title":"Creation of test database moved to a script","user":{"login":"dnahodil","id":2774917,"avatar_url":"https://avatars.githubusercontent.com/u/2774917?v=3","gravatar_id":"","url":"https://api.github.com/users/dnahodil","html_url":"https://github.com/dnahodil","followers_url":"https://api.github.com/users/dnahodil/followers","following_url":"https://api.github.com/users/dnahodil/following{/other_user}","gists_url":"https://api.github.com/users/dnahodil/gists{/gist_id}","starred_url":"https://api.github.com/users/dnahodil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnahodil/subscriptions","organizations_url":"https://api.github.com/users/dnahodil/orgs","repos_url":"https://api.github.com/users/dnahodil/repos","events_url":"https://api.github.com/users/dnahodil/events{/privacy}","received_events_url":"https://api.github.com/users/dnahodil/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aodn/aatams/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-10T06:17:35Z","updated_at":"2015-06-10T06:21:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/aodn/aatams/pulls/218","html_url":"https://github.com/aodn/aatams/pull/218","diff_url":"https://github.com/aodn/aatams/pull/218.diff","patch_url":"https://github.com/aodn/aatams/pull/218.patch"},"body":"**I'm after feedback before merging**\r\n\r\nI just needed to recreate my AATAMS test database and it seemed that it might be easier for devs to reuse this test database setup code if it's in a shell script rather than the individual commands being in the travis config. Thoughts @jkburges?"},"comment":{"url":"https://api.github.com/repos/aodn/aatams/issues/comments/110609263","html_url":"https://github.com/aodn/aatams/pull/218#issuecomment-110609263","issue_url":"https://api.github.com/repos/aodn/aatams/issues/218","id":110609263,"user":{"login":"jkburges","id":1849176,"avatar_url":"https://avatars.githubusercontent.com/u/1849176?v=3","gravatar_id":"","url":"https://api.github.com/users/jkburges","html_url":"https://github.com/jkburges","followers_url":"https://api.github.com/users/jkburges/followers","following_url":"https://api.github.com/users/jkburges/following{/other_user}","gists_url":"https://api.github.com/users/jkburges/gists{/gist_id}","starred_url":"https://api.github.com/users/jkburges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkburges/subscriptions","organizations_url":"https://api.github.com/users/jkburges/orgs","repos_url":"https://api.github.com/users/jkburges/repos","events_url":"https://api.github.com/users/jkburges/events{/privacy}","received_events_url":"https://api.github.com/users/jkburges/received_events","type":"User","site_admin":false},"created_at":"2015-06-10T06:21:36Z","updated_at":"2015-06-10T06:21:36Z","body":"It's a good idea, in fact, here is a similar script I have been using to \"reset\" the DB:\r\n\r\n```bash\r\ncreateuser aatams_test\r\ndropdb aatams_test\r\ncreatedb -O aatams_test aatams_test\r\npsql -c \"create extension postgis schema public;\" aatams_test\r\npsql -c \"create schema aatams authorization aatams_test;\" aatams_test\r\npsql -c \"alter database aatams_test set search_path to 'aatams', 'public';\" aatams_test\r\n```\r\n\r\nIt became necessary for me to run this before *every* integration test run since https://github.com/aodn/aatams/pull/216 changes.\r\n\r\nI was a bit reluctant to check-in what I had without tidying it up a bit - most notably, the authorisation parameters vary depending on how you have install postgresql (e.g. you may or may not have to supply a username)\r\n"}}