Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7861129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:34:31+00:00 2026-06-02T22:34:31+00:00

How do you perform database migrations with Meteor? With Ruby on Rails there is

  • 0

How do you perform database migrations with Meteor? With Ruby on Rails there is ActiveRecord::Migration. Is there an equivalent mechanism in Meteor?

For example, I make an app with some user data. I’m storing the data in Mongo using a JSON format. The app changes, and the JSON database schema needs to change. I can write a migration method to change the schema, however, I only want this to run if the server database is out of date.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T22:34:33+00:00Added an answer on June 2, 2026 at 10:34 pm

    There’s nothing built in for this. What I’ve done myself for now is similar to how Rails works, but as part of startup instead of a separate task. First create a Meteor.Collection called Migrations, and then for each discrete migration, create a function under the server subdirectory that runs on startup. It should only run the migration if it hasn’t run before, and it should flag the migration in the Migrations collection once its done.

    // database migrations
    Migrations = new Meteor.Collection('migrations');
    
    Meteor.startup(function () {
      if (!Migrations.findOne({name: "addFullName"})) {
        Users.find().forEach(function (user) {
          Users.update(user._id, {$set: {fullname: users.firstname + ' ' + users.lastname}});
        });
        Migrations.insert({name: "addFullName"});
      }
    });
    

    You could extend this technique to support down migrations (look for the existence of a given migration and reverse it), enforce a sort order on the migrations, and split each migration into a separate file if you wanted.

    It’d be interesting to think about a smart package for automating this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We need to perform the following operation in our database : There is a
Is there a way to perform database schema generation with the Simple.Data library (similar
I was looking for some kind of a library that could perform database operations
Is there a command that performs migrations on test database in Yii?
In Rails, migrations have a down method by default for reverting a migration. In
I'm writing an app in C# which allows the user to perform database queries
I am planing to use BackgroundWorker on my .net site to perform some database
I'm writing a script to perform some database maintenance, and MySQL is not accepting
Is model comprises of model object and classes that perform database connection and database
You have two servers when you perform a SQL Server database mirroring You have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.