yesod-generate assumes a canonical file structure based on the output of the yesod scaffolder. if you move files around yesod-generate will fail.
- test the output
- make it pretty
- add bootstrap option
Generators to help kickstart yesod projects and promote best practices.
- dumpwidgets - can dump a widgets.hs for the current model file
yesod-generate model <TableName> (<field Type [Maybe]>[, <field Type [Maybe]>])+
yesod-generate model User name Text, age Int Maybe, bday Day Maybe, group GroupId
- put a comma after each field.
- can put Maybe after the type to denote a nullable type
- Other persistent Ids
- note that any type ending in Id is assumed to be a persistent key and will be treated as such.
- Note that we will assume you meant Text, since you should be.
- uses ISO3166 2 letter codes from iso3166-country-codes
- Gives an example of how to add in a simple, but totally alien type to persistent
- IF YOU ADD IMAGES, your JSON/VIEWs will be Ugly. you are warned.
- naively stores image data in the database as a byte string
possibly coming soon