- pikotools is in src subdirectory now
- map_fields() -> fields()
- prepare_table() -> table()
- instead of pt::MainSpaceParser we have pt::MainOptionsParser now
FT class has following types:
enum FieldType
{
default_type = 0,
primary_key = 1,
foreign_key = 2,
foreign_key_in_child = 4,
no_insertable = 8,
no_updatable = 16,
no_fetchable = 32, /* not supported yet */
};
an object of FT class are now used in Model::field() methods instead of insertable/updatable/is_primary_key/... boolean flags
changed the semantic of has_foreign_key (which was a bool) flag in child Models:
now on Models and list/vector of Models you should use either FT::foreign_key or FT::foreign_key_in_child
1. FT::foreign_key means that field with this flag is a foreign key and is pointing to the child object
(it was the case when has_foreign_key was equal to true beforehand)
2. FT::foreign_key_in child means that the foreign key is in the child object and is pointing to the parent object
Now we know whether the primary key is defined or not
and we do not allow to make update/remove if the key is not defined.
And when doing insert/update we can put NULL if child models don't have
the primary key set (fields with has_foreign_key set to true).
Now in after_select() we should also set has_primary_key_set flag
or just call get_last_sequence_for_primary_key instead of get_last_sequence.
fixed: added prefix +00 when serializing PT::Date to PostgreSQL (time zone)
(for a column with a time zone there was a wrong value saved)