Class: CreateRopenlayerStructure

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/ropenlayer/migration/templates/migration.rb

Class Method Summary collapse

Class Method Details

.downObject



27
28
29
30
# File 'lib/generators/ropenlayer/migration/templates/migration.rb', line 27

def self.down
  drop_table :ropenlayer_nodes
  drop_table :ropenlayer_localizations
end

.upObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/generators/ropenlayer/migration/templates/migration.rb', line 3

def self.up

  create_table :ropenlayer_nodes do |t|
    t.string  :mapper_id
    t.integer :mapper_type
    t.string  :geometry
    t.integer :category_id
    t.integer :icon_id
    t.string  :nodeable_type
    t.integer :nodeable_id
    t.timestamps
  end
  
   create_table :ropenlayer_localizations do |t|
    t.float   :longitude
    t.float   :latitude
    t.integer :node_id
    t.integer :order
    t.timestamps
  end


end