Ecto: Question/Issue - should ecto.migrate set default values?

Created on 4 Oct 2015  路  1Comment  路  Source: elixir-ecto/ecto

I'm trying to alter some table like this..

alter table(:team_members) do
      add :kicked_out,  :boolean, default: false
end

Shouldn't migrations be setting the default value for kicked_out ?
I'm seeing empty values on my database, and no default value..

Most helpful comment

The default value in migration is used to set the value for existing rows. The default value in the model is the one used when you are inserting new things.

>All comments

The default value in migration is used to set the value for existing rows. The default value in the model is the one used when you are inserting new things.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ZhengQingchen picture ZhengQingchen  路  4Comments

madshargreave picture madshargreave  路  3Comments

jbence picture jbence  路  3Comments

AndresOsinski picture AndresOsinski  路  5Comments

brandonparsons picture brandonparsons  路  3Comments