Class: CreateDocumentsAndParagraphs

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

Class Method Summary collapse

Class Method Details

.downObject



20
21
22
23
# File 'lib/rticles/generators/templates/create_documents_and_paragraphs.rb', line 20

def self.down
  drop_table :paragraphs
  drop_table :documents
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rticles/generators/templates/create_documents_and_paragraphs.rb', line 2

def self.up
  create_table :documents do |t|
    t.string 'title'
    t.timestamps
  end
  create_table :paragraphs do |t|
    t.text 'body'
    t.integer 'position'
    t.integer 'parent_id'
    t.integer 'document_id'
    t.integer 'heading'
    t.boolean 'continuation'
    t.string 'name'
    t.string 'topic'
    t.timestamps
  end
end