migration

Use db:migrate:redo while properly handling exceptions from schema changes

I have a migration that's breaking in the middle of a couple of schema changes. When it breaks an exception is thrown and rake db:migrate exits, leaving my database in a half-migrated state. How can I set it up so that the migration automatically reverts just the changes that have run so far? I'd like to do so globally when in developm...

Modifying devise modules after first generation

Hi, I'm in the process of learning rails. I've found Devise to be great with getting authentication up and running quickly and seamlessly but I do have one question. How do I change the modules after the first run of the Devise generator (e.g. rails g devise User)? This defaults with the following migration: def self.up create_tab...

slow cognos report

We just migrated a report from Cognos reportnet to Cognos 8.4 and the report is too slow now. The report just has a crosstab nested inside a list with aggregates over periods/quarters/halfs/years Report Design: The mainqueryitem (queryitem) gets data via manual sql. The manual sql has 4 queries inturn unioned. All the 4 queries are j...

Updating models in a Doctrine Migration

I'm trying to update a model in the context of a Doctrine_Migration. Calling save() on the object doesn't seem to update the database. I also tried calling execute() a Doctrine_Query in the context of a Doctrine_Migration. I tried running getSqlQuery() on the query object and I get a valid query that works if executed in a mysql console,...

Can de VS2010 SQL Server 2008 Project type be used to do migrations

I just started using the new project type SQL Server 2008 Database. I can manage the complete schema in detail, but I don't see how I can use the deployment to do versioning like I can with migrations in Ruby on Rails. There is always just one version of a table (CREATE TABLE), and I see no way to go forward and backwards in time with t...

How to restore MOSS 2007 intranet site into share point 2010?

I have my company intranet portal in Moss 2007,i need to implement it into 2010,What are the possible way to do this.is that possible to restore the content data base in 2010 portal. ...

db:auto:migrate in Rails 3

I have just updated my app from Rails 2.3.5 to Rails 3. One of the plugins I liked most was Auto Migrations by Dizzy: http://www.dizzy.co.uk/ruby_on_rails/contents/auto-migrations This allowed me to make changes in the database simply by altering the schema then running db:auto:migrate. This plugin does not seem to be working in Rails ...

How to alter columns with ActiveRecord in Rails?

I'm new to ActiveRecord. I realized that I had forgotten to add a default value for a column in one of my tables. I want to create a migration to fix this, but I can't figure out how. Is there an alter_column method that you can call during migrations? If not, how can I do it? EDIT: I just tried using change_column, but this causes an e...

Migrating project from .NET 2.0 to .NET 4.0

Hi, I'm migrating my solutions from .NET 2.0 to .NET 4.0. I open the solution file in VS 2010 and follow migration wizard. While building the solution and comparing the changes with the server copy (since solution is under source control VSTS), I surprisingly found that 1) the public classes were changed to 'internal' and 2) the 'pu...

Moving data between identical database schema's in MySQL

I have 2 databases with identical schemas. One is a master database serving production/marketing purposes (probably 95% SELECTs) and the other is a "slave" and runs SELECTs/INSERTs for orders, customers, etc for a specific micro-site. The reason for the separation is not all micro-sites will run the same products/specials/coupons etc an...

Migrating SQL Server 2008 DB to Postgres

I would like to migrate a SQL Server 2008 database to Postgres. Is there a painless way to do this? are there any tools that will scan through the schema and stored procedures to flag compatibility problems? ...

Which language to use for writing an admin console à la webmin ?

Hi, We have an in house developed web-based admin console that uses a combination of C CGI and Perl scripts to administer our mail server stack. Of late we have been thinking of cleaning up the code (well, replacing most of it), making the implementation more secure, and improving the overall behavior. I don't have much programming kno...

when to copy Resource database and when system databases?

"The Resource database is a read-only database that contains all the system objects that are included with SQL Server" [1] This sounds that one database from one instance (which one?) contains all information on the whole SQL Server, though I observe that each instance has its own Resource database copy. Is this phrase "with SQL S...

How To: Delete Migration Files in Rails 3

I would like to remove/delete a migration file. How would I go about doing that? I now there are similar questions on here but as an update, is there a better way than doing script/destroy? Also, should I do a db:reset or db:drop if I remove/delete a migration? Thanks in advance. ...

CC2SVN - Jar migration problem

I migrate a Clearcase project to a SVN project. My Clearcase project is composed of : Br_Int => Br_Dev => Br_2 and Br_1 I have created a view on Br_int and I have processed the migration with this view. In my SVN project, branches are migrated : Branches => Br_int and Br_Dev and Br_1 and Br_2 But in my ClearCase project I have J...

How to configure an extra/different migrations folder

Hello. Me and a colleage are working in different projects that share some models. So, we are sharing the models thru a git submodule. Additionally, we'd like to be able to also share migrations: In this way, my collegue's migrations would be in the folder db/migrate/other_db of my project. How can I configure rails migrations to also...

How do I write a migration that will remove certain records from my database?

I have a Note model, with a note_type field. How do write a migration that will remove Note records from the database if the type is "short_note"? ...

Migrate a folder from repository to another repository, with all the changes tree data

I have a folder in a mercurial repository, that I want to copy to another mercurial repository, but with all the changes that I made to this folder, and without losing the all version control that I did on this folder. Is that possible to do with mercurial? ...

Problem with Codeigniter and Doctrine, migrating from Windows to Linux server

Hi, I’ve recently been learning how to use both Doctrine and CI and have been overhauling my website using both tools… all has been absolutely awesome up until the following issue(s) occurred: Essentially it would seem that either PHP, CI or Doctrine can’t find my Base classes unless I explicitly require/include them in the correspondi...

How to export MS SQL database to MYSQL?

I'm trying to convert from a MSSQL .bak database 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 suggested, but seems to have been replaced my the MYSQL Workbench. Is it possible to use the MYSQL Workbench to...