Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

[Proposal] Warning when unknown opt used in migration

12 views
Skip to first unread message

Mateusz Osiński

unread,
Dec 13, 2024, 6:56:15 AM12/13/24
to elixir-ecto
Hey! First of all thank you for this fantastic LIQ, and sorry if I break any rules (would be grateful for pointing them out!). 
Steps; 
1. Create new migration
mix ecto.gen.migration test
2. Sample migration
defmodule Test.Repo.Migrations.Test do
 use Ecto.Migration

 def change do
  alter table(:tests) do 
    add :test, :string, required: true
  end
 end
end

3. Migrate
mix ecto.migrate

Here, the 'unknown' option (required: true) has been used, but Ecto didn't care about it. (in the following case, that should be `null: false`, someone just missed that with components :D). Maybe we could warn the developer about it? 

Thank you in advance! 
Kind regards
Mateusz Osinski

José Valim

unread,
Dec 13, 2024, 6:59:51 AM12/13/24
to elixi...@googlegroups.com
Yes, I think this would be positive. I would suggest to raise if we can.



--
You received this message because you are subscribed to the Google Groups "elixir-ecto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-ecto...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/elixir-ecto/cba80bbe-df8d-4e83-acac-584ed7cb8b58n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages