mix drops.relation.gen_schemas (drops_relation v0.1.0)
View SourceGenerates Ecto schema files from Drops.Relation inferred schemas.
This task introspects database tables and generates explicit Ecto schema files with field definitions based on the inferred schema metadata.
Usage
mix drops.relations.gen_schemas [options]Options
--namespace- The namespace for generated schemas (e.g., "MyApp.Relations")--repo- The Ecto repository module (e.g., "MyApp.Repo")--app- The application name to infer defaults from (e.g., "MyApp")--sync- Whether to sync/update existing files (default: true)--tables- Comma-separated list of specific tables to generate schemas for
Examples
# Generate schemas for all tables with default settings
mix drops.relations.gen_schemas --app MyApp
# Generate schemas with custom namespace
mix drops.relations.gen_schemas --namespace MyApp.Schemas --app MyApp
# Generate schemas for specific tables only
mix drops.relations.gen_schemas --tables users,posts --app MyApp
# Overwrite existing files instead of syncing
mix drops.relations.gen_schemas --app MyApp --sync false