migration

ActiveRecord migration change primary key for no reason

I've got a table with five columns, one of which is the primary key. This primary key is using a non-standard name, like nearly all tables in that database. I've added a migration to rename the other four columns in that table. The problem is after running that migration, the primary key constraint is gone! I've done that renaming thing ...

How can I use South's DataMigration to change the storage backend of Django model ImageField instance?

I'm trying to migrate some models ImageFields to using the S3BotoStorage storage backend from django-storages. As part of this process I've changed my Model's ImageField declaration to include the storage=instance_of_s3botostorage argument, and new instances of my Model that save an image to the ImageField attribute now get stored in S...

Migrating a tab bar-based iPhone project to iPad

Like many other developers out there, I've created iPhone projects that use a UITabBarController as the root controller, with the tab views using UINavigationControllers to drill down from lists to detail views. And like many other developers out there, I need to migrate these apps to the iPad so they take advantage of the bigger screen ...

How to judge the work involved in migrating a website from ColdFusion to .NET

I am trying to judge the work involved in migrating our website from Coldfusion to .NET. At this stage all we want to do is create an exact replica so scope creep should hopefully be avoidable. Does anyone have any suggestions for judging the volume of work required? ...

Tool for extracting diff between two MySQL db structures (including tables, procedures, triggers, functions)?

Hello, I'm starting to think about some kind of deployment script. So, sometimes we need to ALTER our tables in release etc. I need some kind of tool to compare DB structure on dev and production (or just previous version), find out difference in table's structures and generate appropriate ALTER's. It will also be great if this tool w...

Is there a Ruby on Rails generate migration statement to change "description" from string to text?

It looks like string is limited to 256 characters and text is usually 65536 characters. I tried ruby script/generate migration change_description_to_text description:text but the up and down in the migration file generated are both empty? Is there a way to generate this migration automatically? If added manually using a remove_colu...

What is the most efficient way to restore multiple databases in SQL 2008

Hi all, I'm in the process of doing a large scale server migration, as such I have to move 50+ SQL 2005 databases to a new SQL 2008 server installation. The DB guys have only given me a backup of each database, so I have a directory with some 50 .bak files sitting in a directory (ie c:\db) that I need to restore. I need to restore ea...

How to speed up single (last) migration test?

I'm writing my migration SQL against tests. Because the migration is the last one and we've got about 300 migrations, it's DAMN SLOW to get there, as it migrates from bottom up every time. Any ideas how to speed this up a bit? ...

How do I add a default value to a field in a RoR migration?

How do I add a default value to an existing field in a RoR migration? ...

Migrating and upgrading Oracle form Solaris to Linux, including stored procedures

Hello, We are planning a migration of an Oracle installation from Solaris to Linux. At the same time we will upgrade to latest version of Oracle. There are a few hundred stored procedures that should be migrated as well. Present version is Oracle SE 9.2. We will still use Oracle SE, potentially with RAC. Is there anything that we mu...

Converting Asp.Net web forms to Asp.Net MVC project makes build fail

We are migrating a project from classic Asp.Net web forms to Asp.Net MVC. I have followed the fours steps outlined here http://www.codeproject.com/KB/aspnet/webformmvcharmony.aspx and all is working well. Now I want to get Visual Studio to include MVC item templates in the "add new item" dialog. So I add {F85E285D-A4E0-4152-9332-AB1...

PHP to Java migration

We are occasionally in a position to take over PHP based projects, but as we are a Java-house we are searching for ways to turn a PHP-project (or codebase) into a Java-project. The approaches we came up to work in a mixed Java/PHP context are : PHP in frontend and Java in backend with separate front (PHP+JavaScript) and back (Java+SQL...

Import MySQL-DB-Dump into a Rails app using a migration file

I have an old PHP application with a bunch of MySQL tables. I want to rewrite it with Rails(3) and want to import the old data. How can I write a migration-script to import the MySQL-Dump into a sqlite DB? ...

Migrating a custom persistence layer to hibernate3

So, very soon, I will be part of a migration that will move a home-rolled persistence layer (circa any good, popular ORM) to hibernate3. However, at the same time that this migration happens, developers will be working to implement new business logic atop the current persistence layer, hence working against the migration! Does anyone hav...

Symfony Doctrine migrations : removeIndex not working

I'm using Symfony 1.4 with Doctrine. Here's my initial schema: Page: tableName: page columns: ref: type: string(50) notnull: true unique: true I'd like to remove the index on the ref column using migrations. So the schema becomes: Page: tableName: page columns: ref: type: string(50) notn...

Save after rename_column in Rails migration

I'm trying to work around Oracle's inability to change the type of a column with data in it. I cache the attribute's correct value, set it to nil, rename the column and then attempt to re-set the attribute: class SwitchToForeignKeys < ActiveRecord::Migration def self.up registration_countries = {} Registration.all.each do |r| ...

Doctrine 2 migrations how to alter a table with a sqlite db?

I'm having some issues with altering a table in the migrations of doctrine 2. Following code always throws the error: Operation 'Doctrine\DBAL\Platforms\AbstractPlatform::getAlterTableSQL' is not supported by platform. This is strange as alter table is supported by sqlite. public function up(Schema $schema) { $user = $schema->getTa...

How to drop a foreign key in doctrine 2 migrations

Hi all, I want to drop a foreign key in a doctrine 2 migration. But there is no dropForeignKeyConstraint() Does anybody know how to drop it? ...

Should we put data in a database migration files?

Hi all, I have a question about database migrations files. Do you think they should only contain database structure changes? Or is it okay to have data inside them as well? What's the best practices? Personally I think database migrations files get ugly by putting data inside them. ...

Migrating application from Microsoft Access to VB or C#.NET

I'm currently trying to convince management of the need to port one of our applications to .NET. The application has grown to be a bit of a monster in Access (backend in SQL), with 700 linked tables, 650 forms/subforms, 130 modules and 850 queries. I pretty much know all the major benefits of doing this, but now need to look at how this...