Enum Type Field - define a default value

Hi,
I would like to assign a default value for a Type Field which is actually a enum type.

Here my enum type:

enum type MyEnum {
    
    OFF = 0

    ON = 1

}

Here, my type which has a enum type field:

entity type MyType schema name 'MYTP' {

  id: !string

  state: int enum MyEnum post default 0

  fetch: ....

}

When I perform a “fetch” on MyType and I get value undefined:

MyType.fetch({ filter: Filter.eq('id', "myId"), include: 'state' }).objs[0].state

What’s wrong?

Did you create/upsert the object with id myId after adding post default 0 to your type definition? post default is applied only when creating new objects in the database

Yes. Actually, MyType instances are injected by means of seed data contained in the package.

Edit: looks like post default values may be removed after provisioning an object a second time. I’ve filed a ticket internally and the team will investigate to see if this is a bug or expected behavior. I will try to update this post after their investigation.