This project is archived and is in readonly mode.

#1874 ✓committed
Leonardo Borges

Add short-hand definition for PostgreSQL XML data type

Reported by Leonardo Borges | February 4th, 2009 @ 03:23 PM | in 2.3.4

I'm starting a project in rails that uses the XML data type in postgres.

The migration for that to work needs to be like this:


class CreateDocuments < ActiveRecord::Migration
  def self.up
    create_table :documents do |t|
      **t.column :data, :xml**

      t.timestamps
    end
  end

  def self.down
    drop_table :documents
  end
end

While with the new sexy migrations it should work like this as well:


class CreateDocuments < ActiveRecord::Migration
  def self.up
    create_table :documents do |t|
      **t.xml :data**

      t.timestamps
    end
  end

  def self.down
    drop_table :documents
  end
end

This small patch does only that.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Tags