Questions tagged [database-migration]

database-migration is the process of transferring data between storage types, formats, or computer systems. Also refers to migrating the database from one vendor to another, or to upgrading the version of the database software.

is the process of transferring data between storage types, formats, or computer systems. Also refers to migrating the database from one vendor to another, or to upgrading the version of the database software.

See also:

4296 questions
553
votes
16 answers

EF Migrations: Rollback last applied migration?

This looks like a really common task, but I can't find an easy way to do it. I want to undo the last applied migration. I would have expected a simple command, like PM> Update-Database -TargetMigration:"-1" Instead, all I can come up with is: PM>…
484
votes
28 answers

Rollback one specific migration in Laravel

I want to rollback only : Rolled back: 2015_05_15_195423_alter_table_web_directories I run php artisan migrate:rollback, 3 of my migration are rolling back. Rolled back: 2015_05_15_195423_alter_table_web_directories Rolled back:…
code-8
  • 54,650
  • 106
  • 352
  • 604
367
votes
17 answers

Reset Entity-Framework Migrations

I've mucked up my migrations, I used IgnoreChanges on the initial migration, but now I want to delete all my migrations and start with an initial migration with all of the logic. When I delete the migrations in the folder and try and Add-Migration…
224
votes
24 answers

How do I copy SQL Azure database to my local development server?

Does anyone know how I can copy a SQL Azure database to my development machine? I'd like to stop paying to have a development database in the cloud, but it's the best way to get production data. I copy my production database to a new development…
BZink
  • 7,687
  • 10
  • 37
  • 55
220
votes
13 answers

How do I move a redis database from one server to another?

I currently have a live redis server running on a cloud instance and I want to migrate this redis server to a new cloud instance and use that instance as my new redis server. If it were MySQL, I would export the DB from the old server and import it…
ErJab
  • 6,056
  • 10
  • 42
  • 54
199
votes
5 answers

Make column not nullable in a Laravel migration

I'm writing a migration to make certain columns in a table nullable right now. For the down function, I of course want to make those columns not nullable again. I looked through the schema builder docs, but couldn't see a way to do this.
bilalq
  • 7,279
  • 3
  • 22
  • 28
182
votes
35 answers

django.db.migrations.exceptions.InconsistentMigrationHistory

When I run python manage.py migrate on my Django project, I get the following error: Traceback (most recent call last): File "manage.py", line 22, in execute_from_command_line(sys.argv) File "/home/hari/project/env/local/lib/python2.7/site-…
182
votes
32 answers

Access denied for user 'homestead'@'localhost' (using password: YES)

I'm on a Mac OS Yosemite using Laravel 5.0. While in my local environment, I run php artisan migrate I keep getting : Access denied for user 'homestead'@'localhost' (using password: YES) Configuration Here is my…
code-8
  • 54,650
  • 106
  • 352
  • 604
166
votes
12 answers

Sequelize.js: how to use migrations and sync

I'm close to having my project ready to launch. I have big plans for after launch and the database structure is going to change -- new columns in existing tables as well as new tables, and new associations to existing and new models. I haven't…
tremby
  • 9,541
  • 4
  • 55
  • 74
151
votes
2 answers

Rails Migration: Remove constraint

I have a table in a Rails application which (in schema.rb) looks like: create_table "users", :force => true do |t| t.string "name", :null=>false t.string "address", :null=>false end I would like to write a rails migration to allow nulls for…
Jay Godse
  • 15,163
  • 16
  • 84
  • 131
146
votes
7 answers

Room database migration if only new table is added

Let't assume, I have a simple Room database: @Database(entities = {User.class}, version = 1) abstract class AppDatabase extends RoomDatabase { public abstract Dao getDao(); } Now, I'm adding a new entity: Pet and bumping version to…
146
votes
8 answers

Dropping column with foreign key Laravel error: General error: 1025 Error on rename

I've created a table using migration like this: public function up() { Schema::create('despatch_discrepancies', function($table) { $table->increments('id')->unsigned(); $table->integer('pick_id')->unsigned(); …
Latheesan
  • 23,247
  • 32
  • 107
  • 201
131
votes
6 answers

How do I enable EF migrations for multiple contexts to separate databases?

How do I enable Entity Framework 5 (version 5.0.0) migrations for multiple DB contexts in the same project, where each context corresponds to its own database? When I run Enable-Migrations in the PM console (Visual Studio 2012), there's an error…
aknuds1
  • 65,625
  • 67
  • 195
  • 317
103
votes
9 answers

Ruby on Rails: How can I revert a migration with rake db:migrate?

After installing devise MODEL User i got this. class DeviseCreateUsers < ActiveRecord::Migration def self.up create_table(:users) do |t| t.database_authenticatable :null => false t.recoverable t.rememberable …
cola
  • 12,198
  • 36
  • 105
  • 165
94
votes
11 answers

How to export SQL Server database to MySQL?

I'm trying to convert from a SQL Server database backup file (.bak) to MySQL. This question and answers have been very useful, and I have successfully imported the database, but am now stuck on exporting to MySQL. The MySQL Migration Toolkit was…
matkins
  • 1,991
  • 1
  • 16
  • 22
1
2 3
99 100