Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Model hasOne type #59

@abbadon1334

Description

@abbadon1334

when type is not defined for referenceOne and their_field don't have a type, it will get integer as default even if in atk4/field default type is string and atk4/schema SQL default type is string.

'type' => $ref_type !== self::REF_TYPE_NONE && empty($persist_field->type) ? 'integer' : $persist_field->type,

I discovered it today, while i add download feature to atk4/filestore in this pr : atk4/filestore#14

The demos/basic.php of that pr is a perfect example of the problem.

if type is removed from the definition here : https://github.com/atk4/filestore/blob/ccb9aadef79c27d4ef1bd6011d1bf2e04ae01c86/src/Model/File.php#L19

the table will be created with field token as integer.

Discuss the problem even here : atk4/filestore#13

I know schema is dangerous to be changed, but this probably is just an alignment of functionality between atk4/data and atk4/schema.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions