3
votes

I want to install & setup my Drupal databases in a specific schema of the PostgreSQL database. For example, let's say I have created a schema named "test_drupal" in my existing PostGreSQL database and want all Drupal tables such as "block_content", "block_content_field_data" etc. inside my schema.

I also tried specifying the prefix while doing the database setup through Advanced options but it is only adding a prefix before the table names. Ideally I want to put all my tables in a specific schema in PostGreSQL. How can prefix be used in this case?

Can someone please help?

I am using drupal version 8.7.1

Regards, Parth

1

1 Answers

0
votes

Without having it tested myself: there is an option 'init_commands'. Check the code Drupal\Core\Database\Driver\pgsql\Connection::__construct.

You could set the "search_path" to your schema e.g. how to set the connection with a schema in a Postgresql DB with PDO PHP

I don't think you can do this during installation, but importing the data into your own schema and setting the search_path with the init_command to the right schema could workd