EctoGenerator
Generate Ecto schemas from existing database in Phoenix - Elixir
Installation
-
Generate new Phoenix application
[alexandrubagu@localhost devel]$ mix phoenix.new postgresapp
or
[alexandrubagu@localhost devel]$ mix phoenix.new mysqlapp --database mysql-
Add
ecto_generatorto your list of dependencies inmix.exs:
def deps do
[{:ecto_generator, "~> 2.0.0"}]
end-
Install mix dependencies by running the following command in bash
mix deps.get -
Now you will find
ecto.dump.schemain mix task:
[alexandrubagu@localhost devel/phoenix/] mix ecto
Ecto v2.0.5
A database wrapper and language integrated query for Elixir.
Available tasks:
mix ecto.create # Creates the repository storage
mix ecto.drop # Drops the repository storage
mix ecto.dump # Dumps the repository database structure
mix ecto.dump.schema # Dump models from repos
mix ecto.gen.migration # Generates a new migration for the repo
mix ecto.gen.repo # Generates a new repository
mix ecto.load # Loads previously dumped database structure
mix ecto.migrate # Runs the repository migrations
mix ecto.migrations # Displays the repository migration status
mix ecto.rollback # Rolls back the repository migrations