Class: CreateOrgUnits

Inherits:
Object
  • Object
show all
Defined in:
lib/ucb_orgs/migrations/20171211220534_create_org_units.rb

Instance Method Summary collapse

Instance Method Details

#downObject



20
21
22
# File 'lib/ucb_orgs/migrations/20171211220534_create_org_units.rb', line 20

def down
  drop_table :org_units
end

#upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/ucb_orgs/migrations/20171211220534_create_org_units.rb', line 2

def up
  create_table :org_units do |t|
    t.string :code
    t.string :name
    t.integer :level
    t.string :level_2
    t.string :level_3
    t.string :level_4
    t.string :level_5
    t.string :level_6

    t.timestamps
  end

  add_index :org_units, :code, unique: true

end