New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lotus DB Migration Generator #136

Closed
joneslee85 opened this Issue Jan 15, 2015 · 7 comments

Comments

Projects
None yet
5 participants
@joneslee85
Copy link
Member

joneslee85 commented Jan 15, 2015

Status: In Progress
Taker: @thecatwasnot

Hi all

I am in the progress of implementing DB migration at lotus/model and there are much works to be done. I would love to get help from our beloved community in the implementation of the first Lotus Migration generator ever!

The idea is to implement following CLI: bundle exec lotus generate migration <name_of_migration> and it will generate new migration file /lib/<app_name>/db/migrate/<timestamp>_<name_of_migration>.rb with content:

class <name_of_migration_in_constantized_form> < Lotus::Model::Migration
  def up
  end

  def down
  end
end

It is much the same as of Rails migration. There aren't any magic atm.

@joneslee85 joneslee85 added this to the v0.3.0 milestone Jan 15, 2015

@AlfonsoUceda

This comment has been minimized.

Copy link
Member

AlfonsoUceda commented Jan 16, 2015

👍

@midas

This comment has been minimized.

Copy link

midas commented Jan 16, 2015

I will take this one if not already taken? Is there any documentation of best practices for participating in Lotus development that I need to review prior to getting started? Thanks!

@thecatwasnot

This comment has been minimized.

Copy link

thecatwasnot commented Jan 16, 2015

Have started this, got a bunch of boilerplate CLI code done, hopefully can finish and PR tonight.
Do we for sure want this going to lib/app/db instead of db that exists already?

@joneslee85

This comment has been minimized.

Copy link
Member

joneslee85 commented Jan 17, 2015

@midas @thecatwasnot no one has claimed this ticket yet.

@thecatwasnot your question about the location of db migration is excellent. I have been giving thought about it and I strongly believe that we should place them in lib/app/db instead of db. Because:

  • eventually app in apps/ could have their own DB setup
  • lib/app is truly a 1st class of itself

^ @jodosha thoughts?

@thecatwasnot

This comment has been minimized.

Copy link

thecatwasnot commented Jan 17, 2015

@joneslee85 I do agree, actually, on second thought.
Then I'm only waiting on figuring out how to get the app name, I know there was some discussion in #123 on a .lotusrc file that might help. If we're not going to use the .lotusrc there, I can whip something up quick.

@joneslee85

This comment has been minimized.

Copy link
Member

joneslee85 commented Jan 17, 2015

@thecatwasnot for now, can you please generate it for db/migrate?

I will have a look to see how could we retrieve the app_name without using .lotusrc

@thecatwasnot

This comment has been minimized.

Copy link

thecatwasnot commented Jan 17, 2015

@jodosha jodosha removed the help-wanted label Feb 28, 2015

@jodosha jodosha modified the milestone: v0.3.0 Mar 20, 2015

@jodosha jodosha modified the milestone: v0.4.0 May 27, 2015

@jodosha jodosha closed this in #256 Jun 17, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment