-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First migrate gets stuck on table-exists? #179
Comments
Looks like the table hasn't been created before |
I did not run |
Running the |
@yogthos Are you sure sure? Maybe I'm misreading the code, but it looks to me like I've done some more digging and what happens for me is that the SQL exception in If I |
Ah, you're right the table is created by the [init-schema!]((defn init-schema! [db table-name modify-sql-fn]) function, and that's called on connect here, and that in turn is clled in run that's used by I'm not able to reproduce the issue on my end, so not sure what's causing it in your case, but If doing a rollback before returning false addresses it then would make sense to add it in. If you'd like to do a PR with your version I can push out |
Something happened in |
I guess pgjdbc/pgjdbc#1729 is the relevant change. |
Ah, that would do it. So, just have to add (sql/with-db-transaction
[t-con db]
(try
(sql/db-set-rollback-only! t-con)
(sql/query t-con [(str "SELECT 1 FROM " table-name)])
true
(catch SQLException _
false))) |
Yes, this fixes it for me. |
Great, just pushed out |
👍 Thanks for the quick release |
I have a confusing issue. It looks like
SQLException
isn't being caught intable-exists?
.=>
Stacktrace:
And in the CLJ REPL:
But
I really have no idea what to make of this. The only thing I can think of is that this is my first time using Migratus with a deps.edn project.
The text was updated successfully, but these errors were encountered: