This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Right now all strings are deployed as text fields in the database is there anyway you can force your model to render varchars ? As the title mentions perhaps this could be deferred from the Validate Length property ? On a related note it would be nice if we could put ">=8 AND <-128" in the Validate Length and have it create a CONSTRAINT/CHECK when possible on the database too.
|
|
|
This should already be happening. For PostgreSQL, a string property with a length validation is rendered as a VARCHAR(n); only a property with no length validation will be rendered as TEXT. If you're seeing something different could you send us your .lsmodel file and the generated SQL (check the Log SQL box in the Update dialog)? Thanks! To specify a length range, use the shorthand min-max e.g. 8-127 in the Validate Length box. We don't currently generate a database CONSTRAINT/CHECK for the minimum length but I'll log this as a feature request. |
|
|
If I change the property in the designer it's not triggering any changes. In fact if I change the length validation and try to push it to the database it simply tells me the database is up to date. The other way around works fine though (changing a text into a varchar(20) sets validation length 20) but that's not a very good Model first approach :) Is there an email I can send the lsmodel and database dump to ? (databasedump is just a few kb) or credentials to my source code repository ? Thanks for putting CONSTRAINT/CHECK on the backlog. I am all for Model first design but it is still a comfort to know Lightspeed enforces integrity on the database as much as possible too. |
|
|
Aaah... I think we have a bug where if you've already created the table and then you add a length validation to one of the entity properties, that doesn't get picked up. I.e. we only pick up the length validation when you create the column/table, or if the column *already* has a maximum length and it's different from the length validation. I'll look into this and see if we can get it fixed. |
|