robinjoseph08 / go-pg-migrations Goto Github PK
View Code? Open in Web Editor NEWA Go package to help write migrations with go-pg/pg.
License: MIT License
A Go package to help write migrations with go-pg/pg.
License: MIT License
The template on line 16 still says migrations "github.com/robinjoseph08/go-pg-migrations"
when it should read migrations "github.com/robinjoseph08/go-pg-migrations/v2"
I try to use your lib, took code from example and it doesn't work.
When I do go run cmd/migrate/*.go create create_users_table it works fine. After inserting code into Exec
I do migrate and in my db 2 tables for migrations were appeared
go run cmd/migrate/*.go create create_users_table
Creating database/migrations/20200128144423_create_users_table.go...
go run cmd/migrate/*.go migrate
Migrations already up to date
go run cmd/migrate/*.go rollback
No migrations have been run yet
But main table isn't present nowhere
Current release seems to be incompatible with github.com/go-pg/pg/v10
Right now creating migration files requires postgresql connection even if it's not used during the process
There's also no possibility to make custom wrapper, since create function is private and can't be imported.
It would help a lot if any one of these two were possible
See:
https://github.com/robinjoseph08/go-pg-migrations/blob/master/migrate.go#L25
https://github.com/robinjoseph08/go-pg-migrations/blob/master/rollback.go#L10
directory
is passed in, but not used at all, hence migration and rollbacks don't work when migration is run from a separate directory?
Hi there,
i would like to have my migrations in a separate folder like so:
err := gpgm.Run(db, "migrations", os.Args)
Using the "create" command creates the migration in the right place but the package name is wrong.
It should be the name of the folder but it is "main" instead.
Is there any way to move the tables crated by this package migrations
& migration_lock
to a separate schema ? (so that it is not in the public Schema & does not conflict with existing tables)
Hello,
Is a configurable migration template (for a migration creation) would be something acceptable for this project?
ERROR #23502 null value in column "is_locked" violates not-null constraint
This occurs when the migration is running any command even the help command as it is trying to insert a migration lock and failing with that error. The SQL being run is the following.
INSERT INTO migration_lock ("id", "is_locked") VALUES ('lock', false) RETURNING "is_locked"
Edit the actual query is:
INSERT INTO migration_lock ("id", "is_locked") VALUES ('lock', DEFAULT) RETURNING "is_locked"
Is it possible to revert only last migration? ๐ค
go-getting this repo produces a compiler error:
../../robinjoseph08/go-pg-migrations/setup.go:57:9: assignment mismatch: 2 variables but 1 values
go-pg/pg#957 changed the signature of CreateTable
to omit the Result
and only return an error, so createTable
in setup.go
should be changed to just return orm.CreateTable(...)
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.