Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

шаг 2 настройки постгрес #10

Open
des1roer opened this issue Jul 20, 2015 · 0 comments
Open

шаг 2 настройки постгрес #10

des1roer opened this issue Jul 20, 2015 · 0 comments

Comments

@des1roer
Copy link

для постгрес использую такие настройки

     'yii\db\Connection',
        //'dsn' => 'mysql:host=localhost;dbname=localdb',
        'dsn' => 'pgsql:host=*.ru;port=5432;dbname=DB_*',
        'username' => '*',
        'password' => '*',
        'charset' => 'utf8',
        'schemaMap' => [
            'pgsql' => [
                'class' => 'yii\db\pgsql\Schema',
                'defaultSchema' => 'yii2', //specify your schema here
            ]
        ],
        'on afterOpen' => function ($event)
        {
            $event->sender->createCommand("SET search_path TO yii2")->execute();
        }
    ];

по умолчании берется схема public, что чаще всего нужно менять

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant