Wenn ein Modell in MySQL-Datenbank mit Elixir + Phoenix ich einfügen:Phoenix Ecto ** (Mariaex.Error) (1054): Unknown column 'inserted_at' in 'Feldliste'
** (Mariaex.Error) (1054): Unknown column 'inserted_at' in 'field list'
stacktrace:
(ecto) lib/ecto/adapters/mysql.ex:181: Ecto.Adapters.MySQL.insert/5
(ecto) lib/ecto/repo/schema.ex:381: Ecto.Repo.Schema.apply/4
(ecto) lib/ecto/repo/schema.ex:185: anonymous fn/11 in Ecto.Repo.Schema.do_insert/4
(ecto) lib/ecto/repo/schema.ex:595: anonymous fn/3 in Ecto.Repo.Schema.wrap_in_transaction/6
(ecto) lib/ecto/adapters/sql.ex:472: anonymous fn/3 in Ecto.Adapters.SQL.do_transaction/3
(db_connection) lib/db_connection.ex:973: DBConnection.transaction_run/4
(db_connection) lib/db_connection.ex:897: DBConnection.run_begin/3
(db_connection) lib/db_connection.ex:671: DBConnection.transaction/3
Dies ist nicht passiert mit anderen Modellen, die in Ordnung sind. Modell Schema ist:
schema "accounts" do
field :key, :string, null: false
field :cypher_key, :string, null: false
field :another_key, :string, null: false
field :another_cypher_key, :string, null: false
belongs_to :user, MyApp.User
timestamps()
end
und beim Einfügen ich tue:
Repo.insert! %Account{key: "test",
cypher_key: "test",
another_key: "test",
another_cypher_key: "pk_test"
}
Wenn manuell über MySQL Einfügen cmd es ok funktioniert.
Ich habe es verpasst, danke für das Aufzeigen. – David