Duplicate "column" names in model crashes app #169

kotedo opened this Issue Nov 19, 2012 · 3 comments


None yet

2 participants

kotedo commented Nov 19, 2012

If you add duplicate column names the application will crash upon startup with error
messages that are less than helpful in finding the bug.

I found it by removing all models from the model directory and reintroduced them one by one until it crashed again. Then I inspected it very carefully and noticed that I had two column names that were identical by accident.

So, duplicate column names should be identified as such and reported upon.

I used MongoDB for the database. Thus "column" names.

zkessin commented Jan 13, 2014

In theory you should not be able to have duplicate column names at all,
I am assuming that you have a module something like this, we should reject this with an error message

-module(dup, [Id   :: integer(),
              Test :: binary(),
              Test :: binary()]).
kotedo commented Jan 13, 2014

Your assumption is correct. The compiler runs through it right now and fails later.
Maybe this can be caught during compilation?

zkessin commented Jan 16, 2014

It will now refuse to compile the module and give a useful error

@zkessin zkessin closed this Jan 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment