You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on my first project using Goa and Gorma. One of the fields in one of the tables should be of the type text (be able to hold a lot of text). However, I seem unable to make this happen.
For Goa I defined a Resource("thing") with an Action("create") that has a payload with Member("description"). In the ThingMedia (MediaType) I defined the Attribute("description", String).
For Gorma I define a Model("Thing") that RendersTo(ThingMedia) and refers in BuildsFrom() to Payload("thing", "create").
I understand from the docs the way to make this a text field (to override, customize the field creation) is to add Field("description",gorma.Text) to the Model() as well. So I did.
After generating the models and create the tables, the table still defines the field "description" as being varchar(255). I expected the text-type.
Did I do something wrong ? The others fields, for example of type DateTime, are defined in the ThingMedia and are correctly created as such in the table. However, Goa does not have a specific type for Text so I have to redefine/specify that in the Gorma definition.
Maybe of importance:
All this is done using sqlite3. Because for testing the modelling a local db file is the easiest to manipulate. Gorm supports sqlite3 but Gorma does not. So I defined it as a mysql database and then in my code just open an sqlite database. This works well. Except for the Text-type problem above. But as Gorm is to be database agnostic I assume using sqlite does not matter.
The text was updated successfully, but these errors were encountered:
The same problem is with mysql, so its not a sqlite specific problem.
I noticed #96
It might be the same issue ?
But it refers to a slack conversation :-(
Hello
I am working on my first project using Goa and Gorma. One of the fields in one of the tables should be of the type text (be able to hold a lot of text). However, I seem unable to make this happen.
For Goa I defined a Resource("thing") with an Action("create") that has a payload with Member("description"). In the ThingMedia (MediaType) I defined the Attribute("description", String).
For Gorma I define a Model("Thing") that RendersTo(ThingMedia) and refers in BuildsFrom() to Payload("thing", "create").
I understand from the docs the way to make this a text field (to override, customize the field creation) is to add Field("description",gorma.Text) to the Model() as well. So I did.
After generating the models and create the tables, the table still defines the field "description" as being varchar(255). I expected the text-type.
Did I do something wrong ? The others fields, for example of type DateTime, are defined in the ThingMedia and are correctly created as such in the table. However, Goa does not have a specific type for Text so I have to redefine/specify that in the Gorma definition.
Maybe of importance:
All this is done using sqlite3. Because for testing the modelling a local db file is the easiest to manipulate. Gorm supports sqlite3 but Gorma does not. So I defined it as a mysql database and then in my code just open an sqlite database. This works well. Except for the Text-type problem above. But as Gorm is to be database agnostic I assume using sqlite does not matter.
The text was updated successfully, but these errors were encountered: