Coder Social home page Coder Social logo

go-pg-migrations's People

Contributors

bennichols avatar kaffineaddict avatar nyergler avatar robinjoseph08 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

go-pg-migrations's Issues

Create.go doesn't reference new /v2 lib

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"

Need help with usage

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

Do not require postgres connection on create

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

create uses wrong package name

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.

Move migrations tables to seperate schema

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)

Getting an Error is_locked violates not-null constraint

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"

CreateTable assignment mismatch

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(...).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.