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

Multiple schema in same postgresql will result migration fails on citext #53

Closed
1 task done
rickmak opened this issue Jun 22, 2016 · 1 comment
Closed
1 task done

Comments

@rickmak
Copy link
Member

rickmak commented Jun 22, 2016

Try to use two schema under same DB, but it fails on create citext extension.

  • Skygear Server Date/Version: v0.12
  • Application Platform:
  • Is this a regression?

Expected Results

One database will allow multiple skygear schema working.

Actual Results

ERRO[0001] Error executing schema migration "" -> "c0397f15027": pq: type "citext" does not exist 
ERRO[0001] Failed to start skygear: failed to open connection: skydb/pq: unable to migrate database because of an error = skydb/pq: failed to init database: pq: type "citext" does not exist 

Steps to reproduce

  1. init the skygear-server with APP_NAME=first, skygear-server will do the database migration correctly.
  2. Terminate skygear-server
  3. Change the APP_NAME config to second
  4. Try to kick start the skygear-server again, skygear-server will raise migration error
@cheungpat
Copy link
Contributor

It appears that extension is created specific to schema. Therefore we might need to specify the schema when creating the extension.

Many examples on the web do this, where public is the name of the schema.

CREATE EXTENSION IF NOT EXISTS citext WITH SCHEMA public;

Quoting documentation on CREATE EXTENSION (emphasis mine):

The name of the schema in which to install the extension's objects, given that the extension allows its contents to be relocated. The named schema must already exist. If not specified, and the extension's control file does not specify a schema either, the current default object creation schema is used.

rickmak added a commit to rickmak/skygear-server that referenced this issue Jul 22, 2016
rickmak added a commit to rickmak/py-skygear that referenced this issue Jul 22, 2016
It take the assumption on the citext extension are on public schema, which
is related to skyegar-server migration issue at
SkygearIO/skygear-server#53

refs SkygearIO#31
cheungpat pushed a commit to SkygearIO/py-skygear that referenced this issue Jul 25, 2016
It take the assumption on the citext extension are on public schema, which
is related to skyegar-server migration issue at SkygearIO/skygear-server#53

refs #31
@royuen royuen closed this as completed Jul 27, 2016
@royuen royuen removed the In Review label Jul 27, 2016
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