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 9134717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:42:46+00:00 2026-06-17T08:42:46+00:00

I started using Laravel (I added RoR as a tag since I know that

  • 0

I started using Laravel (I added RoR as a tag since I know that the migrations are kind of similar between the two) just a few weeks ago and am still struggling somewhat getting used to working with migrations. I’ve tried to read some documentations and tutorials (both for Laravel and other frameworks who use them, like Rails) and they generally do a good job explaining how to use them, but I still fail to grasp how to effectively work with them. Some questions I have:

  1. If I create a table in a view and later on decide to add a few columns and maybe drop a few other, how do I do this? I understand that editing an existing migration is not the right way. Do I add a new migration which adds the new columns and drops the old ones? If so, is there a naming convention for them, when creating say a table called users, all the tutorials usually name the migration create_users, do I call this migration update_users? What if I wanted to make another update to users, then I would have two classes called Update_Users. Also, the problem I’m having with this approach is that I’m feeling like I don’t have a good overview over the database structure, a tables columns could be scattered over a dozen of migration files.

  2. If I want to populate my tables with test data, is it better to do that in separate migrations, like seeds in Laravel 4?

  3. Should I only have one table in each migration? As of know, in my create_users migration I create three tables; users, roles and role_user, is it better to put them in separate migrations?

  • 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-17T08:42:47+00:00Added an answer on June 17, 2026 at 8:42 am
    1. Editing an existing migration is not the way to go. Otherwise the changes won’t be used when deploying to your production system (the migration numbers are stored in the database itself to avoid running them again). Add another migration to do the changes. There is no real naming convention for update/alter migrations in place. So name it the way you want. But a proper names pointing out why you did the migration may be helpful (e.g. AddCommentsToUsers).

    2. Rails has a seeding mechanism (see Screencast). You should use this. Data migrations have their drawbacks.

    3. I prefer one table per migration. If the first table creation runs through but the second doesn’t, you get into trouble later on when you try to rerun the migration (after having fixed any issue with).

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

Sidebar

Related Questions

I just started using Laravel. When I use codeigniter or zend framework, I can
Started using Visual Studio 2012 RC since yesterday, We have one WCF solution. Whenever
I started using srbac in Yii. The options that are available: create a role,
I am just getting started with Laravel and working on porting a mess of
Just started using JSON in iOS. I have a previous version of an application
Just started using VBA and I'm trying to access all the data in a
Hello i started using Laravel framework for my Facebook apps lateley and i created
I have just recently started working with Laravel. Great framework so far! However I
We started using Redmine at work. I know it uses MySQL as the database,
I started using ruby-electric-mode. I like it except that I am used to closing

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.