Ecto Persistence Adapter for ECSx
EcsxPersistenceEcto can be installed by adding ecsx_persistence_ecto
to your list of dependencies in mix.exs
:
def deps do
[
{:ecsx_persistence_ecto, "~> 0.1"}
]
end
To configure ECSx in your app with Ecto as the persistence adapter, update :ecsx
in your config.exs
file:
config :ecsx,
...
persistence_adapter: ECSx.Persistence.Ecto
and specify your repo:
config :ecsx_persistence_ecto, repo: MyApp.Repo
Generate a migration script:
mix ecto.gen.migration ecto_persistence
and update the change function in the migration:
def change do
create table "ecsx_components" do
add :module, :string
add :data, :string
timestamps()
end
end
Finally, run the migration script:
mix ecto.migrate