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.

9601 questions
125
votes
13 answers

Warning about `$HTTP_RAW_POST_DATA` being deprecated

I switched to PHP 5.6.0 and now I get the following warning everywhere: Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1'…
rr-
  • 12,630
  • 6
  • 42
  • 62
124
votes
4 answers

Rails has_and_belongs_to_many migration

I have two models restaurant and user that I want to perform a has_and_belongs_to_many relationship. I have already gone into the model files and added the has_and_belongs_to_many :restaurants and has_and_belongs_to_many :users I assume at this…
123
votes
6 answers

Rails migration for has_and_belongs_to_many join table

How do I do a script/generate migration to create a join table for a has_and_belongs_to_many relationship? The application runs on Rails 2.3.2, but I also have Rails 3.0.3 installed.
ma11hew28
  • 106,283
  • 107
  • 420
  • 616
120
votes
9 answers

How to migrate/convert from SVN to Mercurial (hg) on windows

I'm looking for a tool to migrate a couple of SVN repositories to Mercurial, with history, labels and so on. I'm using TortoiseHg (Windows x32), so ConvertExtensions are discarded. There's some info on how to do this process on a Linux box (hgsvn),…
David Lay
  • 2,936
  • 4
  • 25
  • 48
119
votes
5 answers

Removing a model in rails (reverse of "rails g model Title...")

rails g model Rating user_id:integer message:string value:integer How can I completely remove this model? Thanks
Colbern
  • 1,191
  • 2
  • 8
  • 3
116
votes
12 answers

Want to upgrade project from Angular v5 to Angular v6

As Angular 6 is here, I want to upgrade or move my angular 5 client application to angular 6, but I'm not getting any tutorial or anything which can guide me through. According to me I just need to run a new Angular CLI and then have to move my…
Abhishek Chokra
  • 1,247
  • 2
  • 6
  • 14
111
votes
5 answers

Assigning default value while creating migration file

rails generate migration AddRetweetsCountToTweet retweets_count:integer Ok I use above line to create migration file that automatically generates code in the generated file to add a column to a model Tweet with datatype integer. Now I want to add…
kxhitiz
  • 1,829
  • 4
  • 18
  • 25
105
votes
8 answers

Convert SQLITE SQL dump file to POSTGRESQL

I've been doing development using SQLITE database with production in POSTGRESQL. I just updated my local database with a huge amount of data and need to transfer a specific table to the production database. Based on running sqlite database .dump >…
DevX
  • 1,464
  • 2
  • 13
  • 17
100
votes
7 answers

How can I rename column in laravel using migration?

I have columns as mentioned bellow: public function up() { Schema::create('stnk', function(Blueprint $table) { $table->increments('id'); $table->string('no_reg', 50)->unique(); $table->string('no_bpkb',…
Ariasa
  • 1,289
  • 3
  • 11
  • 18
98
votes
7 answers

Loading initial data with Django 1.7 and data migrations

I recently switched from Django 1.6 to 1.7, and I began using migrations (I never used South). Before 1.7, I used to load initial data with a fixture/initial_data.json file, which was loaded with the python manage.py syncdb command (when creating…
Mickaël
  • 2,883
  • 3
  • 21
  • 29
98
votes
11 answers

Rake just one migration

I'm trying to run just one migration out of a whole bunch in my rails app. How can I do this? I don't want to run any of the migrations before or after it. Thanks.
Anon
  • 4,793
  • 9
  • 41
  • 56
96
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 …
shibly
  • 11,180
  • 33
  • 97
  • 162
96
votes
24 answers

Laravel 5.4 Specific Table Migration

Hi read all the included documentation here in https://laravel.com/docs/5.4/migrations. Is there a way on how to migrate a certain migration file (1 migration only), cause right now every time there is a change I use php artisan migrate:refresh and…
Martney Acha
  • 2,144
  • 3
  • 22
  • 42
94
votes
1 answer

Rails 3 Migration with longtext

I am needing to change a column type from text to longtext in my Rails script, but can't find anything on how to do this. Has anyone ran across this? Thanks! Dennis
dennismonsewicz
  • 23,382
  • 26
  • 107
  • 175
90
votes
10 answers

Java error: Comparison method violates its general contract

I saw many questions about this, and tried to solve the problem, but after one hour of googling and a lots of trial & error, I still can't fix it. I hope some of you catch the problem. This is what I get: java.lang.IllegalArgumentException:…
Lakatos Gyula
  • 3,529
  • 4
  • 28
  • 52