Class: CreateCustomReportTable

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

Class Method Summary collapse

Class Method Details

.downObject



25
26
27
28
# File 'lib/generators/custom_report/templates/migration.rb', line 25

def self.down
  drop_table :custom_report_report_check_items
  drop_table :custom_report_reports
end

.upObject



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

def self.up
  create_table :custom_report_reports do |t|
    t.string   :name
    t.text     :description
    t.text     :scope
    t.text     :columns
    t.text     :filters
    t.boolean  :has_checklist
    t.integer  :administrator_id
    t.string   :administrator_type
    t.string   :category
    t.datetime :last_opened
    t.datetime :deleted_at
    t.timestamps
  end

  create_table :custom_report_report_check_items do |t|
    t.integer  :report_id
    t.integer  :item_id
    t.timestamps
  end
end