-
Notifications
You must be signed in to change notification settings - Fork 9
Migrating Existing Columns
flex_columns
should automatically be compatible with existing columns that have JSON stored in them. You'll need to declare them as flex columns, and define fields for the data in them, but, assuming the JSON is stored in your database as standard JSON, it should all "just work".
If JSON in your database contains a field that isn't declared in the model, then, by default, that data will be preserved — you won't be able to access it from your application without declaring it as a field, but you won't lose anything, either. (See unknown JSON keys for more information.)
If the column you're using is of type BINARY
, VARBINARY
, BLOB
, or any other binary type, then new data will be saved, by default, with a small header on it to indicate that it's from flex_columns
and to say whether it's compressed using GZip or not. (Existing data is not required to have this header for it to work properly.) See column compression for more information; there's an option that will disable this header if you want.