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

DEV_MODE behaviour is inconsistent with integer type column #319

Closed
2 tasks
louischan-oursky opened this issue Mar 15, 2017 · 2 comments
Closed
2 tasks
Assignees

Comments

@louischan-oursky
Copy link
Contributor

louischan-oursky commented Mar 15, 2017

DEV_MODE behaviour is inconsistent.

  • Skygear Server Date/Version: v0.22.1
  • Application Platform:
  • Is this a regression?
  • Attached logs, screenshots

Steps to reproduce

  1. Create a skygear-like table with one column set to postgresql data type integer
  2. Use sdk api save to save a record.

Actual Results

When DEV_MODE=YES, saving to a table containing integer column is fine and the column does NOT auto migrate to double precision.
When DEV_MODE=NO, skygear server complains it cannot perform migration.

Expected Results

I think skygear-server should complain that integer is never a supported data type regardless of DEV_MODE is on or off.

@ben181231 ben181231 changed the title DEV_MODE behaviour is inconsistent. DEV_MODE behaviour is inconsistent with integer type column Mar 15, 2017
@cheungpat
Copy link
Contributor

I think the desired result should be that when the column has integer type, the following should happens, regardless of DEV_MODE settings:

  • when saving a record with field value that can be interpreted as integer without losing precision, saving should be successful
  • otherwise, the saving should result in an error (probably incompatible schema/data type (forgot the actual name))

@cheungpat
Copy link
Contributor

On the other hand, I am guessing what @louischan-oursky meant when he said the behaviour is inconsistent. I haven’t looked at the code yet, but I suppose that when DEV_MODE=NO, integer is considered incompatible with double precision while when DEV_MODE=YES, it is considered compatible. We could probably improve the compatibility check.

cheungpat added a commit to cheungpat/skygear-server that referenced this issue Apr 5, 2017
When saving to integer column, the request my fail depending on different
dev mode settings. This is due to separate checking involved when
determining if two record schemas are compatible.

refs SkygearIO#319
cheungpat added a commit to cheungpat/skygear-server that referenced this issue Apr 5, 2017
When saving to integer column, the request my fail depending on different
dev mode settings. This is due to separate checking involved when
determining if two record schemas are compatible.

refs SkygearIO#319
rickmak pushed a commit that referenced this issue Apr 5, 2017
When saving to integer column, the request my fail depending on different
dev mode settings. This is due to separate checking involved when
determining if two record schemas are compatible.

refs #319
@chpapa chpapa closed this as completed Apr 18, 2017
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

4 participants