ecto-essentials
Installation
SKILL.md
Ecto Essentials
Use this skill before modifying ANY schema, query, or migration.
RULES — Follow these with no exceptions
- Add database constraints (unique_index, foreign_key, check_constraint) AND changeset validations — both layers are required
- Add indexes on foreign keys and frequently queried fields — never omit indexes on foreign keys
- Parameterize all user input in queries — never interpolate values into SQL fragments, always use
^ - Never combine schema changes and data backfill in the same migration
Schema Definition
Define schemas with proper types and associations. The example below shows a child schema with belongs_to; a parent schema uses has_many in the same pattern (see Folder in the migration section for reference).