-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
Add explicit support for UUIDs #532
Comments
Postgres requires the "uuid-ossp" extension for this. For anyone who requires it, create a migration with the following: exports.up = (pgm) => { pgm.createExtension('uuid-ossp') };
exports.down = (pgm) => { pgm.dropExtension('uuid-ossp') }; and from there you can use uuid for id's with a default as follows: id: { type: 'uuid', primaryKey: true, default: pgm.func('uuid_generate_v4()') }, Hope this helps someone. |
This is a driver issue though. Feel free to add it to the pg driver. Quick lookup showed for me it is not one of the non supported features, so it can be definitely added to the mapping. |
Sadly, @ezy's solution did not work for me. Even with that "uuid-ossp" extension installed, just using 'uuid' as a type for one of my db columns (without using a function for the default value), I still get the warning:
|
What worked for me is |
I'm submitting a...
Current behavior
When I add a column with a type of
uuid
, I get the following warning:Expected behavior
I would expect no warning message as long as I have the
pgcrypto
extension installed.Minimal reproduction of the problem with instructions
Add a column with a type of
uuid
.What is the motivation / use case for changing the behavior?
Personally, I'm a fan of having no warnings in my project. I believe when warnings start piling up that aren't problems, developers begin to ignore them, which causes real issues to be missed. In this case, the
uuid
type is valid, butdb-migrate
doesn't recognize it.Environment
Others:
I believe this issue originally surfaced in #34. I do think allowing pass-through column info is a good idea, but I don't feel like UUIDs should produce warnings.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: