Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gnuside-mongoid_migration

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gnuside-mongoid_migration

  • 0.0.9
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

= MongoidMigration

ActiveRecord::Migration ported to Mongoid to run incremental/reversible migrations to manipulate/populate data in the database.

== Rails 3.x

insert this line to Gemfile:

gem "mongoid_migration", "~> 0.0.3"

== Rails Generator

Run the generator to generate timestamped migration files:

rails generate mongoid_migration Thing

which generates a timestamped migration file: mongodb/migrate/20111114234935_thing.rb similar to AR.

The migration has 2 class methods defined, self.up - executed when migrating up and self.down - executed when migrating down. Obviously ActiveRecord::ConnectionAdapters::SchemaStatements methods have not been ported over, so don't attempt to use them. (they make no sense for mongodb anyways)

== The following rake tasks are available:

  • rake db:mongoid:migrate # Migrate the database (options: VERSION=x, VERBOSE=false).
  • rake db:mongoid:migration:down # Runs the "down" for a given migration VERSION.
  • rake db:mongoid:migration:status # Display status of migrations
  • rake db:mongoid:migration:up # Runs the "up" for a given migration VERSION.
  • rake db:mongoid:rollback # Rolls migrations back to the previous version (specify steps w/ STEP=n).
  • rake db:mongoid:version # Retrieves the current schema version number

== Contributing to MongoidMigration

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
  • Fork the project
  • Start a feature/bugfix branch
  • Commit and push until you are happy with your contribution
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

This is the fork of ActiveRecord::Migrations ported to work with mongoid. All thanks should go to the Rails team.

FAQs

Package last updated on 14 Dec 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc