appnexus / schema-tool

framework-agnostic, schema management tool for everyone
Other
40 stars 21 forks source link

Running `init` when the revision schema doesn’t exist throws error #63

Closed benkogan closed 6 years ago

benkogan commented 9 years ago

Running schema init on a postgres schema where the database exists but the revision schema hasn't been manually created throws the following error:

~/app-schemas_apm-schemas> schema init
Creating revision database
Error: Psycopg2 execution error: schema_name
. Query: SELECT EXISTS(SELECT 1 FROM pg_namespace WHERE nspname = %s) - Data: [u'revision']
.

Here's the config.json:

{
    "username": "bkogan",
    "host": "localhost",
    "db_name": "REDACTED",
    "schema_name": "REDACTED",
    "revision_db_name": "REDACTED",
    "revision_schema_name": "REDACTED",
    "history_table_name": "REDACTED",
    "type": "postgres",
    "pre_commit_hook": "pre-commit-hook-static-dba-files.sh",
    "static_alter_dir": "DBA_FILES/"
}

Schema-tool version 0.3.0, postgres version 9.4.4.

JohnMurray commented 8 years ago

hrm... I see. We will need to think of another way to make sure the schema exists before attempting to create it. Since it seems that we're failing on the call to make that check.

JohnMurray commented 6 years ago

Cleaning up this project and currently cannot reproduce this issue on master. If the issue persits, please clone from the git-repo and try again.