ragtime icon indicating copy to clipboard operation
ragtime copied to clipboard

Migrations table with postgres schema

Open donbonifacio opened this issue 9 years ago • 4 comments

Hello,

I tried to change the migrations table to one using a postgres schema:

{:datastore  (jdbc/sql-database (System/getenv "CONN")
                   {:migrations-table "directory.ragtime_migrations"})
 :migrations (jdbc/load-directory "migrations")})

And I get:

Exception in thread "main" org.postgresql.util.PSQLException: ERROR: relation "directory.ragtime_migrations" does not exist

If I change, for example to directory_ragtime_migrations, everything works as expected.

donbonifacio avatar Aug 13 '15 08:08 donbonifacio

Has there been any solution found? I guess I've just stumbled upon the similar issue using Joplin. But the error message (for :migrations-table "myschema.migrations") looks like this:

PSQLException ERROR: relation "migrations" already exists  org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse (QueryExecutorImpl.java:2455)

metametadata avatar Jan 18 '17 10:01 metametadata

PRs to fix this are welcome. I haven't had the chance to investigate this myself.

weavejester avatar Jan 18 '17 14:01 weavejester

I'm also seeing the issue. Appears to happen (at least for me) when specifying a schema (other than defaulting to 'public').

campeterson avatar Feb 14 '17 21:02 campeterson

I had a similar issue that was caused b/c ragtime was trying to create the table in a schema that did not yet exist. I fixed it by first creating the schema I wanted the migrations table to be in, then ragtime was able to create the migrations table in my schema.

mrcnc avatar Mar 02 '17 19:03 mrcnc