winix_fullmorm #4

Merged
tomasz.sowa merged 27 commits from winix_fullmorm into master 2021-05-27 10:49:46 +02:00
2 changed files with 4 additions and 2 deletions
Showing only changes of commit c87afb40d2 - Show all commits

View File

@ -200,7 +200,7 @@ void Model::to_text(PT::TextStream & stream, ModelData * model_data, bool clear_
{
try
{
prepare_table();
// prepare_table(); at the moment flat strings (json/space) do not need a table name
flat_connector->to_text(stream, *this);
}
catch(...)

View File

@ -969,10 +969,11 @@ protected:
field_model.model_env = &model_env_local;
field_model.model_env->has_primary_key_set = field_model.has_primary_key_set;
field_model.set_connector(model_connector);
field_model.prepare_table();
if( !is_empty_field(db_field_name) )
{
field_model.prepare_table();
if( field_type.is_foreign_key() || field_type.is_foreign_key_in_child() )
{
field_model_for_db(db_field_name, field_model, field_type);
@ -993,6 +994,7 @@ protected:
{
if( model_env->model_work_mode == MORM_MODEL_WORK_MODE_GENERATING_FLAT_STRING )
{
// calling field_model.prepare_table(); is not needed in generating strings (at least for json/space formats)
field_model_generate_flat_string(flat_field_name, field_model, field_type);
}
}