Add `uuid-ossp` extension to postgres automatically
See original GitHub issueBug description
When fields of a model contain the attribute
@default(dbgenerated("public.uuid_generate_v4()"))
the migration will fail, unless the SQL
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
Has been run on this postgres database before.
How to reproduce
See above
Expected behavior
Migrations that add this attribute to fields should simply add the CREATE EXTENSION
SQL before the SQL that attempts to use that extension.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:13
- Comments:9 (3 by maintainers)
Top Results From Across the Web
How do I install/enable the uuid-ossp extension on Postgres ...
How do I install/enable the uuid-ossp extension? I first verified the contrib package was installed … root@prodbox:/home/rails/myproject# ...
Read more >Generating a UUID in Postgres for Insert statement?
To install that UUID-related extension, use the CREATE EXTENSION command as seen in this this SQL: CREATE EXTENSION IF NOT EXISTS "uuid-ossp";.
Read more >Adding UUID functionality to your psql server (uuid-ossp)
Steps · $ psql -U postgres · select * from pg_extension; · # CREATE EXTENSION "uuid-ossp"; · # select * from pg_extension; ·...
Read more >Documentation: 15: F.49. uuid-ossp - PostgreSQL
The uuid-ossp module provides functions to generate universally unique identifiers (UUIDs) using one of several standard algorithms.
Read more >The Basics Of PostgreSQL UUID Data Type
We will create a table whose primary key is UUID data type. In addition, the values of the primary key column will be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If it is just about this: You can use different credentials for running migrations and for running your application.
@janpio It wouldn’t be an exhaustive list initially, but this seems like a pretty popular one (uuid v4), and if other ones come up over time, they could be added too.