bibendi / activerecord-postgres_enum

Integrate PostgreSQL's enum data type into ActiveRecord's schema and migrations.
MIT License
361 stars 24 forks source link

Update README with instructions for adding an enum column to an existing table #21

Closed kaka-ruto closed 4 years ago

kaka-ruto commented 4 years ago

Context

Updates the README to show how to add an enum column to an existing table

Related tickets

8

What's inside

Checklist:

bibendi commented 4 years ago

Interesting! Could you add a test? https://github.com/bibendi/activerecord-postgres_enum/blob/master/spec/active_record/migrations_spec.rb

kaka-ruto commented 4 years ago

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

bibendi commented 4 years ago

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:

kaka-ruto commented 4 years ago

I 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 :)

bibendi commented 4 years ago

Looks good so far! I'll go on vacation tomorrow. I hope I'll have a time next week to investigate the problem.

kaka-ruto commented 4 years ago

Thanks. Let me know how I can help once you're back. Enjoy your vacation :)

kaka-ruto commented 4 years ago

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.

kaka-ruto commented 4 years ago

Never mind, that was an issue with my own migrations that was making the file not be reached.

bibendi commented 4 years ago

@kaka-ruto Thank you!