Skip to content
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
runlevel5 opened this issue Jan 15, 2015 · 7 comments
Closed

Lotus DB Migration Generator #136

runlevel5 opened this issue Jan 15, 2015 · 7 comments
Milestone

Comments

@runlevel5
Copy link
Member

@runlevel5 runlevel5 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.

@AlfonsoUceda
Copy link
Contributor

@AlfonsoUceda AlfonsoUceda commented Jan 16, 2015

👍

@midas
Copy link

@midas 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
Copy link

@thecatwasnot 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?

@runlevel5
Copy link
Member Author

@runlevel5 runlevel5 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
Copy link

@thecatwasnot 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.

@runlevel5
Copy link
Member Author

@runlevel5 runlevel5 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
Copy link

@thecatwasnot thecatwasnot commented Jan 17, 2015

@joneslee85 Ok

@jodosha jodosha removed this from the v0.3.0 milestone Mar 20, 2015
@jodosha jodosha removed this from the v0.3.0 milestone Mar 20, 2015
@jodosha jodosha added this to the v0.4.0 milestone May 27, 2015
@jodosha jodosha added this to the v0.4.0 milestone 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
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants