Skip to content

mithereal/ex_dbmigrate

Repository files navigation

ExDbmigrate

Hex Docs Hex.pm License Last Updated Build Status

Generate phoenix schemas, html, json and live from existing database

Installation

 mix archive.install hex phx_new
 mix phx.new app_name
 cd app_name

If available in Hex, the package can be installed by adding ex_dbmigrate to your list of dependencies in mix.exs:

def deps do
  [
    {:ex_dbmigrate, ">= 0.0.0"}
  ]
end

Configuration

config :ex_dbmigrate, ExDbmigrate.Repo,
  adapter: Ecto.Adapters.Postgres,
  username: "postgres",
  password: "postgres",
  database: "postgres",
  hostname: "localhost",
  pool_size: 10,
  primary_key_type: :uuid
#   port: 5543

Usage:

mix ExDbmigrate.Gen.Module
mix ExDbmigrate.Gen.Migration
mix ExDbmigrate.Gen.Relation
mix ExDbmigrate.Gen.Schema
mix ExDbmigrate.Gen.Html
mix ExDbmigrate.Gen.Json
mix ExDbmigrate.Gen.Live

Usage Inside iex: (/priv/json.txt will be created)

iex> ExDbmigrate.json("public", :write, "json.txt")

Caveats:

  • on some distributions the mix tasks fail with a tools error, however the iex version works.

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ex_dbmigrate.

About

a tool that migrates an existing db to phoenix/elixir

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published