Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Duplicate "column" names in model crashes app #169

Closed
kotedo opened this Issue · 3 comments

2 participants

Kai Janson Zachary Kessin
Kai Janson

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.

Zachary Kessin
Owner

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()]).
-compile(export_all).
Kai Janson

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

Zachary Kessin
Owner

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

Zachary Kessin zkessin closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.