migration

Foreign keys with Rails' ActiveRecord::Migration?

Hello, I'm new to Ruby on Rails (I know Ruby just decently though) and looking at the Migration tools, it sounds really awesome. Database schemas can finally (easily) go in source control. Now my problem with it. When using Postgres as the database, it does not setup foreign keys. I would like the benefits of foreign keys in my schema ...

Moving from php4 to php5

I tried moving to php5, I am getting into lot of issues. This class gives error : Class DatabaseConnection { // error here private $connection; private $result; // public function __construct() { $this->databaseName = $GLOBALS['configuration']['db']; } // ot...

Rails migration won't run, no error thrown

Here's a simple migration I'd like to run : class AddTimeOfRevisionToBrandWikis < ActiveRecord::Migration def self.up add_column :brand_wikis, :time_of_revision, :datetime end def self.down remove_column :brand_wikis, :time_of_revision end end Here's what I get when I try to run it : $ rake db:migrate (in /Users/koua...

Migrating a Large amount of data from old publishing site to new site

Hi, I am currently in the process of creating a new news/publishing site on the Movable Type platform. There are around 20 or so sites with 20,000+ rows of data to be moved/aggregated to ~8 sites (we have a number of location specific sites and are going to aggregate the content from these into 1 single site for each niche). We have di...

Interoperability between Weblogic 10.3.1 and Oracle BPM 10.3.1

Hi, Im migrating an ALBPM 6.5 running on a WLS 10.0 to an Oracle BPM 10.3.1 running on WLS 10.3.1 I got some problems with the Oracle driver because the old driver (weblogic.jdbcx.oracle.OracleDataSource) was definitely removed from the server and is not longer supported. Instead I used the thin driver (oracle.jdbc.xa.OracleXADataSource...

Any tool to convert SQLite database to sql server?

DBConvert is one such tool I know. Any open source or any other product? ...

Why do I have to run migration twice for values to appear in DB?

Inexplicably, when I run the following migration code using rake, the column, but not the values, appear in the MySQL DB table: class AddTypeToItems < ActiveRecord::Migration def self.up add_column :items, 'type', :string, :limit => 100, :null => false Item.find_by_name('YUMMY_JUICE').update_attribute(:type, 'Juice') Item...

Database migrations for SQL Server

I need a database migration framework for SQL Server, capable of managing both schema changes and data migrations. I guess I am looking for something similar to django's South framework here. Given the fact that South is tightly coupled with django's ORM, and the fact that there's so many ORMs for SQL Server I guess having just a gener...

PHP - Database schema: version control, branching, migrations.

I'm trying to come up with (or find) a reusable system for database schema versioning in php projects. There are a number of Rails-style migration projects available for php. http://code.google.com/p/mysql-php-migrations/ is a good example. It uses timestamps for migration files, which helps with conflicts between branches. General pro...

Good reasons to migrate PHP libraries to namespaces

I have a significant number of object libraries written for PHP 5.2.5, and I'm trying to weigh the benefits of retrofitting them for namespaces. I don't have any concerns about the server PHP version at the moment, since any relevant machines are under my control, so I'm not worried about backwards compatibility. As far as the structure ...

Migrating svn repo with non-flat branch hierarchy to mercurial

Is there a conversion utility from svn to hg that can deal with a branch hierarchy that's more complex than just a flat list of branches under /branches? My repository has a directory that looks (conceptually) like this: /branches /projectA /v1.x /v1.1 /v1.2 etc.. IOW I need a tool that can get a tree structur...

Problem with migrating a model in ruby

I run script/generate model query edit query.rb in models.. class Query < ActiveRecord::Base #I even tried Migrations instead of Base def sef.up create table :queries do|t| t.string :name end end def self.down drop_table :queries end end ,run rake db:migrate. and what I see in db is this: mysql> desc quer...

Any tips on moving from ActionScript 3 to Python?

I've been developing stuff using ActionScript since AS2,and when AS3 was released i had a bit of a hard time to understand its concepts. Then i realized i had to learn some OOP. I started studying OOP and now i feel i need to take a step further, that's why i chose Python. Are there any tips/advices/hints or whatever like that to help me...

Exception with Subsonic 2.2, SQLite and Migrations

Hi, I'm playing with Migrations and created a simple migration like public class Migration001 : Migration { public override void Up() { TableSchema.Table testTable = CreateTableWithKey("TestTable"); } public override void Down() { } } after executing sonic.exe migra...

Three questions before I leave PHP: Formsets, datasources and remote auth

I've been using CakePHP for a long time now and feel comfortable developing sites with it. I do however like Python more then PHP and would like to move to Django. EDIT: split in three separate questions How can I mix multiple models in one form? I know formsets are used for this, but I can't find a decent tutorial on this (views + tem...

Execute a Rake task from within migration?

I have a Rake task that loads configuration data into the DB from a file, is there a correct ruby/rails way to call it on a migration up? My objective is to sync my team DB configs, without have to broadcast then to run the task lalala def self.up change_table :fis_situacao_fiscal do |t| t.remove :mostrar_endereco t...

Way to view Rails Migration output

Is there an easy way to see the actual SQL generated by a rails migration? I have a situation where a migration to change a column type worked on my local development machine by partially failed on the production server. My postgreSQL versions are different between local and production (7 on production, 8 on local) so I'm hoping by lo...

Is their any tool that can create Ruby on Rail migration script of existing Database

Hi I wanted to know if their is any tool that can be used to create sql migration script of existing database in Ruby on Rails. Also is their any visual tool that can be used to write Ruby on Rails migration script. ...

Java 1.4 to Java 6 migration

Hi, I have some enterprise apps running on Java 1.4. They mostly invoke Stored Procedures on a DB, Parse XML files (at the most few megs large), read and write from and to disk. We have a requirement where now we have to migrate these apps to Java 6(No code changes to be done at all). My questions: If I don't recompile my apps under...

Add foreign key constraints to existing tables in Ruby on Rails (MySQL)

What's the best way to add foreign keys to my existing tables in Rails with an underlying MySQL database? clearly the solution should be done in a migration, as I want this versioned. Otherwise I'd create the constraints myself. I can't seem to find one, conducive response to they above. Again, the tables have already been created with ...