Closed kaka-ruto closed 4 years ago
Interesting! Could you add a test? https://github.com/bibendi/activerecord-postgres_enum/blob/master/spec/active_record/migrations_spec.rb
Hi @bibendi , I am getting a little trouble setting up. Could you please indicate how to setup the database, including management of env variables like DATABASE_URL? That will be really helpful. Also seeing some docker files, should we run it using docker? That info will help a lot.
I appreciate your help
I'm using Docker for all projects which I'm working with.
should we run it using docker?
You can, but this is not an obligation. You can run tests without using Docker as well.
So, to run tests in Docker you need:
dip provision
dip rspec
to check on the latest Railsdip appraisal rspec
to check on all supported RailsI managed to set up and add a few tests.
The tests that check an enum is created and added to an existing table pass, but the one that tests for absence of enums after a down migration fail.
I tried adding an implementation to remove the enum on a down migration but I quite didn't get it.
Your advise is awaited :)
Looks good so far! I'll go on vacation tomorrow. I hope I'll have a time next week to investigate the problem.
Thanks. Let me know how I can help once you're back. Enjoy your vacation :)
Hey, looks like this no longer works. Just created an enum in a similar manner and the enum is not created, with no errors reported.
Never mind, that was an issue with my own migrations that was making the file not be reached.
@kaka-ruto Thank you!
Context
Updates the README to show how to add an enum column to an existing table
Related tickets
8
What's inside
rename_enum_value
example docs to a paragraph before the Postgres NB note, for a good flowChecklist: