Sha256: ea74f108e88dc088831c4a8f651406eb3383ad48caf77ad654fc978af21d660f

Contents?: true

Size: 778 Bytes

Versions: 4

Compression:

Stored size: 778 Bytes

Contents

class AddOrganizationsTables < ActiveRecord::Migration
  
  def change
    create_table :organization_hosts do |t|
      t.integer  :organization_id, :null => false
      t.string   :host,            :null => false
      t.datetime :created_at,      :null => false
      t.datetime :updated_at,      :null => false
    end
    add_index :organization_hosts, [:host], :unique => true
    
    create_table :organizations do |t|
      t.string   :name
      t.string   :code,                         :null => false
      t.boolean  :active,     :default => true, :null => false
      t.datetime :created_at,                   :null => false
      t.datetime :updated_at,                   :null => false
    end
    add_index :organizations, [:code], :unique => true
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
multidb-4.0.1 testapp_mysql2/db/migrate/master/20140110031857_add_organizations_tables.rb
multidb-3.2.1 testapp_mysql2/db/migrate/master/20140110031857_add_organizations_tables.rb
multidb-4.0.0 testapp_mysql2/db/migrate/master/20140110031857_add_organizations_tables.rb
multidb-3.2.0 testapp_mysql2/db/migrate/master/20140110031857_add_organizations_tables.rb