possible to retroactively set field as 'required'?

LabKey Support Forum (Inactive)
possible to retroactively set field as 'required'? Ben Bimber  2010-04-02 10:23
Status: Closed
 
the list export/import feature is extremely useful. however, it does not seem to export all the metadata for those lists. it mostly misses validation related information. this would be a minor inconvenience except that labkey does not let you set a field as 'required' once data already exists in a table. this means that when you re-import, because it makes the list and imports data you're stuck. is there a way to force a field to be required once data is in it? all existing rows have values for this field.

workarounds might include deleting all the records, changing the fields to 'required', then re-importing, but that kinda defeats the point of using the import/export mechanism. i will also look into whether i can manually edit the list.xml file produced by the list export to fill in any metadata missed by the list export.
 
 
adam responded:  2010-04-02 11:02
It's true we don't yet export/import some of the field metadata (e.g., regex validators & default values). But "required" should roundtrip via the "nullable" XML element. On 10.1, I just tried exporting a list with required fields and they imported as required. Are you seeing something different?

Adam
 
Ben Bimber responded:  2010-04-02 11:29
i encountered this a couple weeks ago when moving data from my laptop to the production server. i just recently noticed required fields were no longer required. however, i cant seem to reproduce this right now either. would overwriting existing lists have any impact on labkey's behavior? when i get a chance i will try it on the same data as before to see if i can reproduce it.
 
adam responded:  2010-04-02 11:55
Overwriting an existing list is fairly drastic -- we delete the list completely, then reimport the meta data & data. It's possible that some remnants remain after the delete and get reattached to a new list with the same name... but I doubt it.