View Source ExDbmigrate (ex_dbmigrate v1.1.6)

Documentation for ExDbmigrate.

Link to this section Summary

Link to this section Functions

Link to this function

fetch_results(schema \\ "public")

View Source
Link to this function

fetch_table_data(r, schema \\ "public")

View Source
Link to this function

fetch_table_schemas(ignore \\ ["information_schema", "pg_catalog"])

View Source
Link to this function

generate_htmls_command(data, list)

View Source
Link to this function

generate_jsons_command(data, list)

View Source
Link to this function

generate_lives_command(data, list)

View Source
Link to this function

generate_migration_command(data, list)

View Source
Link to this function

generate_migration_relations_command(fk_data, list)

View Source
Link to this function

generate_schema_relations_command(fk_data, list)

View Source
Link to this function

generate_schemas_command(data, list)

View Source
Link to this function

html(schema \\ "public", mode \\ :read, filename \\ "db_migrate")

View Source

Generate schema from config.

examples

Examples

iex> ExDbmigrate.html()
["mix phx.gen.html CatalogMetas CatalogMeta catalog_metas key:string data:string product_id:uuid",
 "mix phx.gen.html CatalogVideosToProducts CatalogVideosToProduct catalog_videos_to_product product_id:uuid video_id:uuid",
 "mix phx.gen.html CatalogProducts CatalogProduct catalog_products name:string",
 "mix phx.gen.html CatalogVideos CatalogVideo catalog_videos path:string"
]
Link to this function

json(schema \\ "public", mode \\ :read, filename \\ "db_migrate")

View Source

Generate schema from config.

examples

Examples

iex> ExDbmigrate.json()
["mix phx.gen.json CatalogMetas CatalogMeta catalog_metas key:string data:string product_id:uuid",
"mix phx.gen.json CatalogVideosToProducts CatalogVideosToProduct catalog_videos_to_product product_id:uuid video_id:uuid",
"mix phx.gen.json CatalogProducts CatalogProduct catalog_products name:string",
"mix phx.gen.json CatalogVideos CatalogVideo catalog_videos path:string"]
Link to this function

list_foreign_keys(table)

View Source

List the foreign keys for specified table.

examples

Examples

iex> ExDbmigrate.list_foreign_keys("catalog_metas")
[%{column_name: "product_id", constraint_name: "catalog_metas_product_id_fkey", foreign_column_name: "id", foreign_table_name: "catalog_products", foreign_table_schema: "public", table_name: "catalog_metas", table_schema: "public"}
]
Link to this function

live(schema \\ "public", mode \\ :read, filename \\ "db_migrate")

View Source

Generate schema from config.

examples

Examples

iex> ExDbmigrate.live()
["mix phx.gen.live CatalogMetas CatalogMeta catalog_metas key:string data:string product_id:uuid",
"mix phx.gen.live CatalogVideosToProducts CatalogVideosToProduct catalog_videos_to_product product_id:uuid video_id:uuid",
"mix phx.gen.live CatalogProducts CatalogProduct catalog_products name:string",
"mix phx.gen.live CatalogVideos CatalogVideo catalog_videos path:string"]
Link to this function

migration(schema \\ "public", mode \\ :read, filename \\ "db_migrate")

View Source

Generate migration from config.

examples

Examples

iex> ExDbmigrate.migration("public")
["mix phx.gen.migration CatalogMetas CatalogMeta catalog_metas key:string data:string product_id:uuid",
"mix phx.gen.migration CatalogVideosToProducts CatalogVideosToProduct catalog_videos_to_product product_id:uuid video_id:uuid",
"mix phx.gen.migration CatalogProducts CatalogProduct catalog_products name:string",
"mix phx.gen.migration CatalogVideos CatalogVideo catalog_videos path:string"]
Link to this function

migration_relations(schema \\ "public", mode \\ :read, filename \\ "db_migrate")

View Source

Generate migration from config.

examples

Examples

iex> ExDbmigrate.migration_relations()
["mix phx.gen.schema CatalogMetas.CatalogMeta catalog_metas product_id:references:catalog_products",
"mix phx.gen.schema CatalogVideosToProducts.CatalogVideosToProduct catalog_videos_to_product product_id:references:catalog_products video_id:references:catalog_videos",
"mix phx.gen.schema CatalogProducts.CatalogProduct catalog_products ",
"mix phx.gen.schema CatalogVideos.CatalogVideo catalog_videos "]
Link to this function

schema(schema \\ "public", mode \\ :read, filename \\ "db_migrate")

View Source

Generate schema from config.

examples

Examples

iex> ExDbmigrate.schema()
["mix phx.gen.schema CatalogMetas.CatalogMeta catalog_metas key:string data:string product_id:uuid --no-migration",
"mix phx.gen.schema CatalogVideosToProducts.CatalogVideosToProduct catalog_videos_to_product product_id:uuid video_id:uuid --no-migration",
"mix phx.gen.schema CatalogProducts.CatalogProduct catalog_products name:string --no-migration",
"mix phx.gen.schema CatalogVideos.CatalogVideo catalog_videos path:string --no-migration"]
Link to this function

table_name(migration_name)

View Source
Link to this function

write_file(data, file \\ "db_migrate")

View Source