Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defining Field("description",gorma.Text) results in varchar(255) field #130

Closed
Gys opened this issue Sep 20, 2016 · 2 comments
Closed

defining Field("description",gorma.Text) results in varchar(255) field #130

Gys opened this issue Sep 20, 2016 · 2 comments

Comments

@Gys
Copy link

Gys commented Sep 20, 2016

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.

@Gys
Copy link
Author

Gys commented Sep 23, 2016

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 :-(

@Gys
Copy link
Author

Gys commented Sep 23, 2016

From the slack conversion, for anybody having the same issue:
This is a related Gorm issue:
https://github.com/jinzhu/gorm/issues/510
So its not a Gorma issue.

@Gys Gys closed this as completed Sep 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant