Migration CLI error: no schema has been selected to create in
See original GitHub issueKnex: 0.12.6 PostgreSQL 9.6.1 on x86_64-pc-linux-gnu, compiled by gcc (Alpine 6.2.1) 6.2.1 20160822, 64-bit Node: 7.5.0 OS: Windows 10
Is it possibly because I dropped the public schema and replaced it with another one - database_schema. How do I interact with the migration CLI and the database?
**// knexfile.js**
module.exports = {
development: {
client: 'postgresql',
connection: {
database: 'database_development',
user: 'admin_user',
password: 'admin_password',
host: '192.168.99.100'
},
pool: {
min: 2,
max: 10
},
migrations: {
tableName: 'knex_migrations'
}
}
};
This might be me misunderstanding Knex (first time using it), but I’m running into this problem:
λ knex migrate:currentVersion
Using environment: development
error: no schema has been selected to create in
at Connection.parseE (C:\Users\Toby\git\min-auth\min-auth-server\node_modules\pg\lib\connection.js:554:11)
at Connection.parseMessage (C:\Users\Toby\git\min-auth\min-auth-server\node_modules\pg\lib\connection.js:381:17)
at Socket.<anonymous> (C:\Users\Toby\git\min-auth\min-auth-server\node_modules\pg\lib\connection.js:117:22)
at emitOne (events.js:96:13)
at Socket.emit (events.js:189:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:551:20)
Connecting with PSQL works with the same arguments, as does connection with Knex outside the migration CLI.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
ERROR: no schema has been selected to create in
I am working on an amazon RDS postgresql database where I know there had been some issue with the public schema ( ...
Read more >python - No schema has been selected to create in ... error
no schema has been selected to create in. You get this error when your search_path setting has no valid first entry (typically empty)....
Read more >ERROR: no schema has been selected to create in #9528
I have the same error running npx prisma migrate dev --name initial-migration --create-only in a newly created database. datasource db { ...
Read more >no schema has been selected to create in - SonarQube
PSQLException : ERROR: no schema has been selected to create in Position: 14 at org.postgresql.core.v3.QueryExecutorImpl.
Read more >SQLSTATE[3F000]: Invalid schema name - Laracasts
[Illuminate\Database\QueryException] SQLSTATE[3F000]: Invalid schema name: 7 ERROR: no schema has been selected to create in (SQL: create table "migrations" ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’m experiencing the same issue and setting
searchPathin the knexfile doesn’t help.// EDIT:
Alright, I had to explicitly specify
schemaNamefield within amigrationsobject. This solved the problem.Does this work (added searchPath configuration)