Skip to content
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

Schema dump doesn't include enums #123

Open
adamgotterer opened this issue Aug 17, 2016 · 0 comments
Open

Schema dump doesn't include enums #123

adamgotterer opened this issue Aug 17, 2016 · 0 comments

Comments

@adamgotterer
Copy link

adamgotterer commented Aug 17, 2016

When using the pg_enum plugin the enum create statements aren't included in the schema.rb file which causes errors when restoring the database from the schema file on a fresh database.

# Migration file
Sequel.extension :pg_enum
Sequel.migration do
  change do
    extension :pg_enum

    create_enum :some_enum, %w(foo bar)
    create_table :some_table do
      primary_key :some_table_id
      some_enum :some_enum
    end
end

# Schema dump
Sequel.migration do
  change do
    create_table(:some_table) do
      primary_key :some_table_id
      column :some_enum, "some_enum"
    end
end
Sequel.migration do
  change do
    self << "SET search_path TO \"$user\", public"
    self << "INSERT INTO \"schema_migrations\" (\"filename\") VALUES ('migration.rb')"
  end
end

edit: this might be a Sequel issue so I've posted on their mailing list. But I wanted to bring it up here as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant