mix phx_media_library.install (PhxMediaLibrary v0.7.0)

Copy Markdown View Source

Installs PhxMediaLibrary in your project.

This task will:

  1. Generate the media table migration
  2. Print configuration instructions

Usage

$ mix phx_media_library.install

Options

--no-migration        Skip migration generation
--id-type TYPE        Type for the mediable_id column: binary_id (default), integer, string
--binary-id BOOL      Deprecated  use --id-type instead (false maps to --id-type integer)
--table NAME          Custom table name (default: "media")

Examples

# Apps with UUID primary keys (default)
$ mix phx_media_library.install

# Apps with integer primary keys
$ mix phx_media_library.install --id-type integer

# Apps with string/slug primary keys
$ mix phx_media_library.install --id-type string