-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Migration table failure against Oracle #43
Comments
Yeah, looks like you would either need to detect the database type and use the correct type or allow passing custom types here. |
I guess in the meantime, a workaround would be to manually create the table before running migrations. |
I can confirm that this works. |
There's a secondary problem here even when manually creating the table, namely there no JDBC mappings to a Perhaps it would be better to keep ids as some kind of string type column (e.g. |
Using strings for ids should be fine, although that would break backwards compatibility. This looks like an existing issue as well. Perhaps it might be better to just explicitly cast to |
Yeah. Considering backwards compatibility, explicit coercion seems to be the easy fix. It still leaves the bug in Oracle where the migration table cannot be created automatically when it does not exist. However, since that can be alleviated by manually creating the table, it's less of an issue. |
Two options would be to either try to infer the database type from the driver and use the type supported by it, or find a numeric type that most databases support. If the latter is possible, I think that would be ideal. |
It looks like ANSI/ISO type should be double precision. The PlatformUtils class from the ApacheDdlUtils library could be used to infer the database type otherwise. |
Hi i am having trouble migrating oracle.. |
Did you try creating the migrations table by hand? (sql/create-table-ddl :schema_migrations
[[:id "NUMBER" "UNIQUE" "NOT NULL"]
[:applied "TIMESTAMP" "" ""]
[:description "VARCHAR(1024)" "" ""]]) |
This worked :) |
https://github.com/yogthos/migratus/blob/master/src/migratus/database.clj#L213 uses 'BIGINT' for the Migrations table. This is not a valid datatype in Oracle land.
The text was updated successfully, but these errors were encountered: