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

FunctionClauseError #3

Closed
pmarreck opened this issue Nov 24, 2021 · 2 comments
Closed

FunctionClauseError #3

pmarreck opened this issue Nov 24, 2021 · 2 comments
Assignees

Comments

@pmarreck
Copy link

** (FunctionClauseError) no function clause matching in ExcellentMigrations.MessageGenerator.build_message/1    
    
    The following arguments were given to ExcellentMigrations.MessageGenerator.build_message/1:
    
        # 1
        :column_reference_added
    
    Attempted function clauses (showing 10 out of 14):
    
        def build_message(%{type: type, path: path, line: line})
        def build_message(:raw_sql_executed)
        def build_message(:index_not_concurrently)
        def build_message(:many_columns_index)
        def build_message(:column_added_with_default)
        def build_message(:column_removed)
        def build_message(:table_dropped)
        def build_message(:table_renamed)
        def build_message(:column_renamed)
        def build_message(:not_null_added)
        ...
        (4 clauses not shown)
    
    (excellent_migrations 0.1.1) lib/message_generator.ex:4: ExcellentMigrations.MessageGenerator.build_message/1
    (excellent_migrations 0.1.1) lib/message_generator.ex:5: ExcellentMigrations.MessageGenerator.build_message/1
    (excellent_migrations 0.1.1) lib/mix/tasks/check_safety.ex:23: anonymous fn/1 in Mix.Tasks.ExcellentMigrations.CheckSafety.run/1
    (elixir 1.13.0-rc.0) lib/enum.ex:937: Enum."-each/2-lists^foreach/1-0-"/2
    (excellent_migrations 0.1.1) lib/mix/tasks/check_safety.ex:21: Mix.Tasks.ExcellentMigrations.CheckSafety.run/1
    (mix 1.13.0-rc.0) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.13.0-rc.0) lib/mix/cli.ex:84: Mix.CLI.run_task/2

I'm actually not sure which of my migrations triggered this, but the whole lot of them are at: https://github.com/pmarreck/mpnetwork/tree/yolo/priv/repo/migrations

@pmarreck
Copy link
Author

It was possibly 20190930174006_create_sessions.exs or any migration subsequent to that, based on the previous warnings

@Artur-Sulej
Copy link
Owner

I fixed it by creating more a generic version of generating message that is now able to handle any danger type. I tested it on all your migrations and it works fine.

The fix is available in version 0.1.2 that I've just released on Hex.
Thanks!

@Artur-Sulej Artur-Sulej self-assigned this Nov 25, 2021
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

2 participants