I would like to remove a field from an existing Ecto model:
field :age, :integer
After reading the docs, I'm not sure if this is the best / easiest way to do this (delete (column))? Can you set an example? I tried:
def change do create table(:users) do remove :age end end
and it does not work.
Instead of the create table, you want to use the alter / 2 table .
def change do alter table(:users) do remove :age end end
create/2 will grow if the table already exists.
create/2
Source: https://habr.com/ru/post/1606856/More articles:Как Swift потребляет SOAP WebService из Dynamics NAVISION - web-servicesPIP PIP path in Windows 10 - pythonDisplay text or subtitles when mouse cursor is above button in WPF - c #Изменение содержимого кнопки при наведении указателя мыши - c#If else vs switches with stack logic - javaError group of PostgreSQL grouping by table that exists only there - ruby | fooobar.comAutocomplete with django-autocomplete-lights - jqueryElement index in OrderedMap - javascriptRuby on Rails - show only the current date - dateHow to do multi-page download of large files from S3 in python? - pythonAll Articles