{"title":"Models","description":"Model-layer choices and release boundaries for Amber V2 applications","section":"guides","version":"v2","path":"guides/models","canonical_url":"https://amberframework.org/docs/v2/guides/models","markdown_url":"https://amberframework.org/docs/v2/guides/models.md","inherited":false,"content_markdown":"# Models in Amber V2\n\nAmber CLI `2.0.6` installs Grant and the selected database driver in the\nsupported web template. SQLite is the zero-setup default; PostgreSQL and MySQL\nare selected with `amber new APP -d pg` or `-d mysql`.\n\n[Grant](grant/) is the supported V2 model layer. The generated `shard.yml` pins\nthe reviewed Grant commit, `config/database.cr` registers the `primary`\nconnection, and `amber database` applies [Micrate migrations](grant/migrations/)\nunder `db/migrations/`.\n\nGenerate the first complete model and resource from the application root:\n\n**Run from: the application root beside `shard.yml`.**\n\n```bash\namber generate scaffold Pet name:string:required species:string:required adopted:bool\namber database migrate\n```\n\nIf you are migrating an Amber 1 application, keep the 1.4.1 documentation open\nfor the existing Granite or Jennifer code and use the\n[Granite-to-Grant guide](../../migration-guide/granite-to-grant/) only after\nreviewing its compatibility notice and proving a database restore."}