Questions tagged [migration]

An action of moving between major versions of any framework, product or language, or, just as commonly, alteration to the data schema of an application. This might involve modifying existing data to make it work with the new version.

An action of moving between major versions of any framework, product or language, or, just as commonly, alteration to the data schema of an application. This might involve modifying existing data to make it work with the new version.

11009 questions
82
votes
5 answers

Generate migration - create join table

I have looked through many SO and google posts for generating migration of join table for has many and belongs to many association and nothing work. All of the solutions are generating a empty migration file. I am using rails 3.2.13 and I have two…
gotqn
  • 42,737
  • 46
  • 157
  • 243
80
votes
32 answers

SQLSTATE[HY000] [2002] Connection refused within Laravel homestead

Using Mac OS X and Homestead 2.2.1 with Laravel 5.2. In terminal (within homestead in my project folder) I can do php artisan to see all the available commands. When I try to run php artisan migrate I get a connection error: SQLSTATE[HY000] [2002]…
nclsvh
  • 2,628
  • 5
  • 30
  • 52
78
votes
6 answers

Why don't my south migrations work?

First, I create my database. create database mydb; I add "south" to installed Apps. Then, I go to this tutorial: http://south.aeracode.org/docs/tutorial/part1.html The tutorial tells me to do this: $ py manage.py schemamigration wall…
TIMEX
  • 259,804
  • 351
  • 777
  • 1,080
77
votes
18 answers

Wordpress keeps redirecting to install-php after migration

Here's my situation. I have followed the exact instructions on wordpress codex page about moving a site to another server. Here are the step's i have taken. Export a copy of my database Make a new database in the new server Import the database I…
Hiilo
  • 2,381
  • 2
  • 15
  • 14
77
votes
1 answer

How to declare local variables in postgresql?

There is an almost identical, but not really answered question here. I am migrating an application from MS SQL Server to PostgreSQL. In many places in code I use local variables so I would like to go for the change that requires less work, so could…
UnDiUdin
  • 14,924
  • 39
  • 151
  • 249
76
votes
1 answer

Is there a way to undo a migration on Django and uncheck it from the list of showmigrations?

Actually, what I do is: Delete the migration file. Delete the row from the table of django_migrations on the database. Delete the changes applied by the migration that I want to delete or unapplied. I want to know if there's another way to do…
César Villaseñor
  • 822
  • 1
  • 7
  • 15
75
votes
7 answers

Laravel migration table field's type change

Following is my file 2015_09_14_051851_create_orders_table.php. And I want to change $table->integer('category_id'); as a string with new migration.
naing linhtut
  • 791
  • 1
  • 6
  • 9
75
votes
10 answers

How to import a SQL Server .bak file into MySQL?

The title is self explanatory. Is there a way of directly doing such kind of importing?
Marcel
  • 6,143
  • 15
  • 46
  • 52
72
votes
1 answer

rails run specific migration

I've deleted a table in the database, call it X. db:migrate no longer works. I have a migration file called CreateX. Is there a way to run just that specific migration?
Daniel
  • 16,026
  • 18
  • 65
  • 89
70
votes
1 answer

Does rake db:schema:dump recreate schema.rb from migrations or the database itself?

Does rake db:schema:dump recreate schema.rb from migrations or the database itself?
pingu
  • 8,719
  • 12
  • 50
  • 84
69
votes
3 answers

How to use JDK without JRE in Java 11

We are planning to migrate our Java 8 project to use Java 11. But I noticed that Java 11 doesn't have a JRE folder. In Java 9 and Java 10, folder structures are changed i.e. java\jdk1.x or java\jre1.x, where x is Java 9 or 10. But in Java 11, I am…
Maha Lak
  • 825
  • 1
  • 7
  • 7
69
votes
4 answers

django migrations - workflow with multiple dev branches

I'm curious how other django developers manage multiple code branches (in git for instance) with migrations. My problem is as follows: - we have multiple feature branches in git, some of them with django migrations (some of them altering fields, or…
Laurent S
  • 4,106
  • 3
  • 26
  • 50
67
votes
11 answers

How do I describe an enumeration column in a Rails 3 migration?

How do I describe an enumeration column in a Rails 3 migration?
Zeck
  • 6,433
  • 21
  • 71
  • 111
66
votes
4 answers

How to write SQL in a migration in Rails

I have the following SQL which I need to do CREATE TABLE cars_users2 AS SELECT DISTINCT * FROM cars_users; DROP TABLE cars_users; ALTER TABLE cars_users2 RENAME TO cars_users; since I cannot use heroku dataclips to drop a table, I cannot use…
Nick Ginanto
  • 31,090
  • 47
  • 134
  • 244
65
votes
3 answers

Laravel migrations change default value of column

I have a table with a default value already assigned. For an example we can look at the following: Schema::create('users', function (Blueprint $table) { $table->increments('id')->unsigned(); …