Installation on a different schema

4 months 1 week ago - 4 months 1 week ago #155651 by ravgupta20
ravgupta20 created the topic: Installation on a different schema

I am trying to install LimeSurvey on PostgresSQL, on a different schema, called 'limesurvey', than the default 'public' schema.

I went into create-pgsql.sql file and set the search_path = limesurvey. This populates the 'limesurvey' schema on the database with all the tables correctly during installation.

The problem is when tries to create the admin log-in on the 'Addition Options' during installation. At first, it was creating a second lime_sessions table on the 'public' schema, with the table-based sessions activated. I changed the creation of config.php so that table-based session is uncommented when the installation is run.

So I changed the $autoCreateSessionTable to false, in the CDbHttpSession.php. This stopped creating the second lime_sessions table in the 'public' schema. However, now the queries that are run during installation cannot find 'lime_sessions' table. It's trying to look for it in the 'public' schema, instead of the 'limesurvey' schema where it actually is.

I also changed the DEFAULT_SCHEMA to 'limesurvey' in CPgsqlSchema.php and it still gives an error. It is trying to look for the lime_sessions table for LSYii_Application.php functions, and it can't find it.

Any ideas?

PS: I believe the problem might be that when it does a db connection ($db) it goes to the default 'public' schema, rather than the new 'limesurvey' schema. This is just my guess.
Last Edit: 4 months 1 week ago by ravgupta20.

Please Log in to join the conversation.

4 months 1 week ago #155689 by giatro
giatro replied the topic: Installation on a different schema
Hi, I resolved

On DB:

ALTER ROLE myuser IN DATABASE mydatabase SET search_path = mycustomschema;

On code:
replace 'public' with 'mycustomschema' on:

- limesurvey/installer/sql/create-pgsql.sql: row 4
- limesurvey/application/helpers/database_helper.php: row 181
- limesurvey/framework/db/schema/pgsql/CPgsqlSchema.php: row 20 [OPTIONAL?]
The following user(s) said Thank You: LouisGac

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now