Whatwasit v0.2.1 Mix.Tasks.Whatwasit.Install
Setup the Whatwasit package for your Phoenix application.
Adds a migration for the Version model used to trackage changes to the desired models.
Prints example configuration that should be added to your config/config.exs file.
Examples
# create the migration and print configuration
mix whatwasit.install
# print configuration
mix whatwasit.install --no-migrations
# Add current user tracking
mix whatwasit.install --whodoneit
# use a different user model
mix whatwasit.install --whodoneit --model="Account accounts"
# use a simple whodoneit_id field
mix whatwasit.install --whodoneit-id=integer
# store the whodoneit model in a map
mix whatwasit.install --whodoneit-map
# set the whodoneit model foreign key type to uuid
mix whatwasit.install --whodoneit-id-type=uuid
The following options are available:
--model
— The authentication model and table_name--repo
— The project’s repo if different than the standard default--module
— The projects base module--migration-path
— The migration path--whodoneit
— Add current user tracking--whodoneit-id
— Use a simple id field instead of a relationship--whodoneit-map
— Store the current_user as a map--whodoneit-id-type
— Set the foreign key type
The following options are available to disable features:
--no-migrations
— Don’t generate the migration--no-boilerplate
— Don’t generate anything--no-models
— Dont’ generate models