Comments (6)
Have you tried specifying the search_path
?
Docs:
- https://github.com/golang-migrate/migrate/tree/master/database/postgres
- https://godoc.org/github.com/lib/pq#hdr-Connection_String_Parameters
- https://www.postgresql.org/docs/10/static/runtime-config-client.html
from migrate.
I don't understand how this would solve the problem. The migration scripts work with several schemas inside the same database. The library code assumes that after a migration script run, the initial current schema remains the same as before the script was run. To work for me, I just set the search path to be public schema again. But I don't think the code should make such an assumption in the first place.
from migrate.
I don't understand the issue you're having. You should be able to work with multiple schemas in your migration files w/o any issue. Are your migrations setting the search_path? The search_path should be specified as an option to migrate.
from migrate.
Yes, they are. One script can do that multiple times, switching between schemas.
If I understand correctly, using search_path as part of dsn, this would mean that all operations would consider that to be the current schema, including everything the migrate library does ?
from migrate.
If you're setting the search_path in your migration files, you'll need to "revert"/reset it. migrate cannot track DB state changes made in migrations.
Instead of setting the search_path in your migration files, you could also specify the schema explicitly.
Setting the search_path in the DSN will affect migrate and the migrations it runs. Keep in mind that multiple schemas can be specified in the search_path.
from migrate.
Thanks. I did revert the schema back to public ( initial schema ) in migration script. I just thought that I make an issue in case this is not intended behavior.
from migrate.
Related Issues (20)
- Option to skip locking for postgres
- Migration not run inside other schema using extensions using search_path HOT 3
- Does the down command supports to down the migration to specific version ? HOT 1
- Database seeds concept
- source/iofs silently ignores errors when parsing migrations
- mysql should allow tls=preferred option not only skip-verify
- Filter File By Profile
- Not documented which DBs are parallel-safe
- Actualize/improve documentation about installation process (go toolchain) HOT 1
- Spanner not support the Postgresql dialect HOT 1
- Cloud Spanner using Google SQL: ON DELETE NO ACTION is not supported HOT 1
- Migrations that begin with the year 2024 fail during the 'up' migration process HOT 7
- Unable to install on Linux Mint 21.1 HOT 1
- Enhance & Feat: Database connection with go wire dependency injection
- SQL Lite CLI usage (unknown driver error) HOT 1
- run with provided *sql.DB instance and dont close database after run
- Unable to run migrations with timestamp: converting driver.Value type int64 to a int
- Can support hardcode sql string instead from file?
- can not go mod tidy
- migrate attempts to run the wrong files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from migrate.