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

Confusing error when using incorrect type in migration #689

Closed
matthewmcgarvey opened this issue Jun 25, 2021 · 0 comments · Fixed by #700
Closed

Confusing error when using incorrect type in migration #689

matthewmcgarvey opened this issue Jun 25, 2021 · 0 comments · Fixed by #700
Labels
improve error experience Make errors nicer to deal with

Comments

@matthewmcgarvey
Copy link
Member

When adding a column, I accidentally specified the type as Boolean instead of Bool and received an error like this:
Unhandled exception: Negative argument (ArgumentError)

I would expect a compilation error about the incorrect type.

Example:

class AddUsers::V20210625020710 < Avram::Migrator::Migration::V1
  def migrate
    create :users do
      primary_key id : Int64
      add_timestamps
      add admin : Boolean
    end
  end

  def rollback
    drop :users
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improve error experience Make errors nicer to deal with
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants