Closed egaba closed 6 years ago
Had you perhaps initially used a non-slice type for the field prior and re-used the same database?
If it's not important data, try deleting the system.db
file in your repo (you'll need to re-initialize the CMS with a user and login. Then re-run the server and try to add / view data.
There is currently no "migration" step for ponzu databases, which makes it a little difficult if you need to change the underlying type of a struct field.
Had you perhaps initially used a non-slice type for the field prior and re-used the same database?
This was true. I deleted my system.db
and content/review.go
files, then re-ran the generation command and it fixed the issue. Thank you again!
Glad to hear it! Btw, your existing generated code would have worked. No need to re-generate it if your content types didn't change after you deleted the DB.
I'm trying to create an array of photos. Using the "Review" generator example, the command I'm using to generate is:
ponzu generate content review title:"string" author:"string" rating:"float64" body:"string":richtext website_url:"string" items:"[]string" photo:"[]string":file
When running
ponzu build && ponzu run
, i see the error:Although there's an error, I'm still able to start up the server. I upload two different photos, and see only one photo in the response:
I expected
photo
to be an array likeitems
. What's the correct way to generate an array of files?