"how to set default schema in yii2" Code Answer

4

try this variant of db.php to specify defaultschema

return [
    'class' => 'yiidbconnection',
    'dsn' => 'pgsql:host=localhost;dbname=db_name', 
    'username' => 'db_username',
    'password' => 'db_password',
    'charset' => 'utf8',
    'schemamap' => [
      'pgsql'=> [
        'class'=>'yiidbpgsqlschema',
        'defaultschema' => 'public' //specify your schema here
      ]
    ], // postgresql
];
By del_dan on March 19 2022

Answers related to “how to set default schema in yii2”

Only authorized users can answer the Search term. Please sign in first, or register a free account.