Class: CreateBaseStructure

Inherits:
Object
  • Object
show all
Defined in:
lib/kindle/migrations/base_migration.rb

Class Method Summary collapse

Class Method Details

.downObject



17
18
19
20
# File 'lib/kindle/migrations/base_migration.rb', line 17

def self.down
  drop_table :books
  drop_table :highlights
end

.upObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/kindle/migrations/base_migration.rb', line 3

def self.up
  create_table :books do |t|
    t.string :asin, :title, :author
    t.integer :highlight_count
    t.timestamps
  end
  create_table :highlights do |t|
    t.text :highlight
    t.string :amazon_id
    t.integer :book_id
    t.timestamps
  end
end