GithubHelp home page GithubHelp logo

bradcypert / deckard Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 1.0 146 KB

Deckard is a framework agnostic tool for running database migrations.

License: Apache License 2.0

Go 98.54% HCL 1.46%
database-migrations golang hacktoberfest

deckard's Introduction

Hi ๐Ÿ‘‹, I'm Brad.

I write code and code accessories

  • ๐Ÿ”ญ Iโ€™m currently working on Luna Journal

  • ๐ŸŒฑ Iโ€™m currently learning Svelte & Machine Learning

  • ๐Ÿ‘จโ€๐Ÿ’ป All of my public projects are available at https://github.com/bradcypert

  • ๐Ÿ“ I regulary write articles on https://bradcypert.com

  • ๐Ÿ“น Youtube tutorials and more at https://www.youtube.com/bradcypert

  • ๐Ÿ’ฌ Ask me about React, Go, TypeScript, Flutter, or Svelte

  • ๐Ÿ“ซ How to reach me brad[dot]cypert[at]gmail[dot]com

Connect with me:

bradcypert bradcypert bradcypert agent404 bradcypert

Languages and Tools:

bash css3 dart docker flutter go graphql java javascript Svelte postgresql react sass typescript webpack webpack

bradcypert

deckard's People

Contributors

bradcypert avatar dependabot-preview[bot] avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

Forkers

kubenetic

deckard's Issues

Cant connect and run migrations against Heroku because SSL mode is set to disable.

Cant connect and run migrations against Heroku because SSL mode is set to disable.
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Create new Postgres Instance
  2. Create a hosts file targeting the new instance. (probably shouldnt do this, overall, but thats ok for now).
  3. Try to run the up migrations
  4. Notice it fails.

Expected behavior
I'd expect to be able to run my migrations against Heroku.

Stack Traces or System Dumps

goroutine 1 [running]:
github.com/bradcypert/deckard/db.Database.connect(0xc0001580c0, 0x26, 0x1538, 0xc0000b8770, 0xe, 0xc0001541c0, 0x40, 0xc0000b87a0, 0xe, 0xc0000b87b0, ...)
	/Users/bradcypert/go/src/github.com/bradcypert/deckard/db/database.go:131 +0x18e
github.com/bradcypert/deckard/db.Database.RunUp(0xc0001580c0, 0x26, 0x1538, 0xc0000b8770, 0xe, 0xc0001541c0, 0x40, 0xc0000b87a0, 0xe, 0xc0000b87b0, ...)
	/Users/bradcypert/go/src/github.com/bradcypert/deckard/db/database.go:39 +0x7a
github.com/bradcypert/deckard/cmd.upFunc(0xc0000c07a0, 0x0, 0x2)
	/Users/bradcypert/go/src/github.com/bradcypert/deckard/cmd/up.go:47 +0x2ed
github.com/bradcypert/deckard/cmd.glob..func4(0x1983fe0, 0xc0000c07a0, 0x0, 0x2)
	/Users/bradcypert/go/src/github.com/bradcypert/deckard/cmd/up.go:59 +0x3f
github.com/spf13/cobra.(*Command).execute(0x1983fe0, 0xc0000c0780, 0x2, 0x2, 0x1983fe0, 0xc0000c0780)
	/Users/bradcypert/go/src/github.com/spf13/cobra/command.go:830 +0x2ae
github.com/spf13/cobra.(*Command).ExecuteC(0x1984c60, 0xc000151f68, 0x146eb1e, 0x1984260)
	/Users/bradcypert/go/src/github.com/spf13/cobra/command.go:914 +0x2fc
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/bradcypert/go/src/github.com/spf13/cobra/command.go:864
github.com/bradcypert/deckard/cmd.Execute()
	/Users/bradcypert/go/src/github.com/bradcypert/deckard/cmd/root.go:38 +0x32
main.main()
	/Users/bradcypert/go/src/github.com/bradcypert/deckard/main.go:6 +0x20

Platform (please complete the following information):

  • OS: OSX
  • Version v0.1.3

Additional context
Add any other context about the problem here.

Dependabot can't resolve your Go dependency files

Dependabot can't resolve your Go dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

github.com/bradcypert/deckard/cmd: cannot find module providing package github.com/bradcypert/deckard/cmd

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Down migrations are destructive and should warn a user and ask them to confirm before running

Down migrations are destructive and should warn a user and ask them to confirm before running
When running down migrations, they often contain destructive operations (discarding columns, dropping tables, etc). To prevent accidental down migrations, especially without steps, we should warn the user that they're about to make a potentially dangerous change and prompt them to accept before continuing with the migrations.

Ideally, that will default to y/N.

Also, it might be a good idea to add a flag to skip confirmation for CI related endeavors.

--silent flag

Feature Request
I'd like to be able to provide a silent flag to Deckard and have it not print unless it has to.

Describe the solution you'd like
I'd like to be able to provide a silent flag to Deckard and have it not print unless it has to.

Dependabot can't resolve your Go dependency files

Dependabot can't resolve your Go dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

fatal: The remote end hung up unexpectedly

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Need to plan a better way to parse config files

The deckard hosts (config) file is a huge part to deckard. However, it currently does not support multiple Databases well, as the config options vary heavily from database to database.

I'm trying to plan a way to allow the config to be handed off to the database layer (as well as the flags, I suppose?) so that each database can read what it needs from the config/flags to prepare itself for execution.

Proper execution of this refactor should also solve #15

Need to support running a set number of up/down migrations.

When I want to run migrations, I want to run them one at a time.
Deckard should not necessarily run all of my up or down migrations when I run up or down.

Describe the solution you'd like
I should be able to specify the number of migrations to run.
Possibly something like deckard up --num=1 --key=prod

Describe alternatives you've considered
Alternatively, we could/should support running a specific migration via filepath?

Support Windows

Some people use windows, please support them.
See above ^

I'd like to download a binary that I can run on Windows
A clear and concise description of what you want to happen.

Describe alternatives you've considered
I could use another tool ๐Ÿ˜ญ

Migrations are not sorted appropriately before being ran

Migrations are not sorted appropriately.
While up migrations seem to work fine, due to the way the filesystem works, down migrations are being run in the same order (ie: the incorrect order, should be opposite).

To Reproduce
Steps to reproduce the behavior:

  1. deckard create foo
  2. deckard create bar
  3. Modify foo migration to have a users table.
  4. Modify bar migration to reference a field in the users table via FK.
  5. deckard up
  6. deckard down.
  7. Observe that it will try to run the foo down before the bar down.

Expected behavior
It should run the down migrations in reverse chronological order.

Platform (please complete the following information):

  • OS: OSX
  • Version v0.1.0

Dependabot can't resolve your Go dependency files

Dependabot can't resolve your Go dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

github.com/bradcypert/deckard/cmd: cannot find module providing package github.com/bradcypert/deckard/cmd

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Add support for SQL Server

Is your feature request related to a problem? Please describe.
I'd love to be able to run deckard migrations against MS SQL Server.

Describe the solution you'd like
Deckard can leverage an existing popular SQL Server library (see below) to performa operations against SQL Servers.
https://github.com/denisenkom/go-mssqldb

Describe alternatives you've considered
Not using SQL Server ๐Ÿคทโ€โ™‚

Additional context
Flagging this as a "Good First Issue" despite the name being intimidating, this issue shouldn't be too difficult as the way Deckard handles database operations is relatively tame. If you want to pick this one up and have questions, lemme know. I'd be happy to help answer those. :)

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.