Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Schema migration is expected to happen after before_save #452

Closed
2 tasks
rickmak opened this issue Aug 10, 2017 · 0 comments
Closed
2 tasks

Schema migration is expected to happen after before_save #452

rickmak opened this issue Aug 10, 2017 · 0 comments

Comments

@rickmak
Copy link
Member

rickmak commented Aug 10, 2017

For plugin developer, one of the before_save usages is to remove un-wanted attributes to be saved to the database.

For example, conversation have a reference column message. Plugin SDK populate the message as JSON object for easy access. At before_save, the plugin will filter the message away preventing it being saved to DB.

refs: SkygearIO/chat-SDK-JS#65

  • Skygear Server Date/Version: 1.1.0
  • Application Platform: py-skygear
  • Is this a regression?
  • Attached logs, screenshots

Expected Results

The message key got filtered out and will not save to DB.

Actual Results

There is schema migration error. Since the passing type (jsonb) is not compatible with the DB type (reference).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants