Error: additive schema change

I’m getting this error when I try to add new property to the schema:

ending session with error: additive schema change: adding schema for Realm table “article_twitter_meta”, additive changes from clients are restricted when developer mode is disabled (ProtocolErrorCode=225)

My old schema was:

export const articleSchema = {
  name: 'article',
  properties: {
    _id: 'objectId?',
    __v: 'int?',
    _partition_key: 'string?',
    active_search: 'bool?',
    analysed_by: 'article_analysed_by[]',
    article_meta: 'articlemeta',
    catalog_id: 'objectId?',
    color_label: 'string?',
    content: 'objectId?',
    createdAt: 'date?',
    flagged: 'bool?',
    keywords: 'article_keywords[]',
    owner_id: 'objectId?',
    rating: 'int?',
    read: 'bool?',
    status: 'string?',
    status_updated_at: 'date?',
    subscriptions: 'article_subscriptions[]',
    updatedAt: 'date?',
  },
  primaryKey: '_id',
};

New schema is:

export const articleSchema = {
  name: 'article',
  properties: {
    _id: 'objectId?',
    __v: 'int?',
    _partition_key: 'string?',
    active_search: 'bool?',
    analysed_by: 'article_analysed_by[]',
    article_meta: 'articlemeta',
    catalog_id: 'objectId?',
    color_label: 'string?',
    content: 'objectId?',
    createdAt: 'date?',
    flagged: 'bool?',
    keywords: 'article_keywords[]',
    owner_id: 'objectId?',
    rating: 'int?',
    read: 'bool?',
    status: 'string?',
    status_updated_at: 'date?',
    subscriptions: 'article_subscriptions[]',
    twitter_meta: 'article_twitter_meta',
    updatedAt: 'date?',
  },
  primaryKey: '_id',
};

Hello @Abhishek_Matta

ending session with error: additive schema change: adding schema for Realm table “article_twitter_meta”, additive changes from clients are restricted when developer mode is disabled (ProtocolErrorCode=225)

Normally you will receive this type of error when you are changing your schema directly in your client code and you don’t have development mode on. Development mode enables developers to develop faster, and design schemas directly in client application code.

This is not recommended for production applications and thus, if you don’t have it enabled, adding schema changes directly in your client code is not supported.

Please, be aware that destructive changes are not allowed regardless of having development mode on/off.

A destructive change is defined as:

  • Changing the primary key
  • Changing a field from required to optional, or vice versa
  • Changing a field type but keeping the name the same
  • Dropping a collection in MongoDB that was already synced - this is because there is sync history metadata stored for this collection
  • Deleting Classes or Fields from your cloud sync schema

The above destructive changes will necessitate a full re-sync, ie. a termination of sync on the cloud and the re-enablement.

Please let me know if you have any additional questions or concerns regarding the details above.

Kind Regards,
Josman

1 Like