Errr: Conflicting schema


I have created a table using record/save API, The table has a column with text type. the value of the column is greater then 256, so its getting truncated. So what i did was i altered the table manually through pg admin. And then when i try to save another record. it fails with following error

{'error': {'code': 114, 'message': 'conflicting schema {TypeUnknown  {0 <nil>} character varying(512)} => {TypeString  {0 <nil>} }', 'name': 'IncompatibleSchema'}}

is there something that should be done in skygear for this to work ?



@Priyanka_Navgire In PostgreSQL there is no length limit for text type, so the data should not be truncated. I tried using skygear js sdk to save record and I am able to save value which is longer than 256. Which SDK are you using? or would you mind providing the code snippet that can reproduce the problem?

For the conflicting schema error, it is because the db schema is changed. We don’t suggest changing the column type in db directly since that will cause the schema conflict in skygear server.


This is the actual token which i am saving to data base

This is what i am getting when i read it

And this is being done through py-skygear


@Priyanka_Navgire Would you mind showing me how you save the record in py-skygear? :slight_smile: Thanks!

user_info = user_response
	payload_session = {"access-token": user_info['result']['access_token'],
	"api_key": SKYGEAR_API_KEY, 
	"records": [{
		"linkedin_token": accessToken.access_token,
		"_access": None,
		"_id": "user_session_token/" + user_info['result']['user_id']
	}]	}

	response = + "record/save", data =json.dumps(payload_session), headers = { "Content-Type": "application/json", "X-Skygear-API-Key":SKYGEAR_API_KEY, "X-Skygear-Access-Token":user_info['result']['access_token']}).json()



@Priyanka_Navgire Just tried your code in my environment (skygear cloud), I can save the full token which are not truncated. May I know are you using skygear cloud or self deployment?