Sha256: 8d8f3da4ee4baad24e94798d21d47c9e6be1f24d20891b54d51f4c67a7ec77d9

Contents?: true

Size: 1.46 KB

Versions: 6

Compression:

Stored size: 1.46 KB

Contents

#!/usr/bin/env ruby
require 'yaml'
require 'rubygems'
require 'active_record'

# A migration script uses a database configuration and creates tables
# very conveniently in a database-agnostic way. Below, add any customizations
# to the sample schema or leave it as-is. When done, execute this script.

ActiveRecord::Base.establish_connection YAML.load_file('config/database.yml')

class CreateUsers < ActiveRecord::Migration
  # Available column types are :primary_key, :string, :text, :integer,
  # :float, :datetime, :timestamp, :time, :date, :binary, and :boolean
  def self.up
    create_table :users do |t|
      t.column :name, :string
      t.column :callerid_name, :string
      t.column :callerid_num, :string
      t.column :group_id, :integer # Foreign key
      t.column :ivr_extension, :string
      t.column :extension, :string
      t.column :email, :string
      t.column :im_username, :string
      t.column :im_provider, :string
      # t.column :billed_time, :integer, :null => false
    end
  end

  def self.down
    drop_table :users
  end
end

class CreateGroups < ActiveRecord::Migration
  def self.up
    create_table :groups do |t|
      t.column :name, :string
      t.column :administrator_email, :string
      t.column :callerid_name, :string
      t.column :callerid_num, :string
      #t.column :usage_limit, :integer
    end
  end

  def self.down
    drop_table :groups
  end
end

# Run "rake migrate" to run this script properly.
# CreateUsers.up
# CreateGroups.up

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
adhearsion-0.7.0 new_projects/config/migration.rb
adhearsion-0.7.1 new_projects/config/migration.rb
adhearsion-0.7.2 new_projects/config/migration.rb
adhearsion-0.7.3 new_projects/config/migration.rb
adhearsion-0.7.4 apps/default/config/migration.rb
adhearsion-0.7.5 apps/default/config/migration.rb