Class: CreateNisetegamiTemplates

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/migrations/001_create_nisetegami_templates.rb

Class Method Summary collapse

Class Method Details

.downObject



32
33
34
# File 'lib/generators/migrations/001_create_nisetegami_templates.rb', line 32

def self.down
  drop_table :nisetegami_templates
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/generators/migrations/001_create_nisetegami_templates.rb', line 2

def self.up
  create_table :nisetegami_templates do |t|

    ## mapping
    t.string :mailer # EG: "TestMailer"
    t.string :action # EG: "simple"
    t.string :name

    ## headers
    t.string :from
    t.string :cc
    t.string :bcc
    t.string :reply_to

    ## content
    t.text :subject
    t.text :body_text
    t.text :body_html
    t.text :layout_text
    t.text :layout_html

    ## controls
    t.boolean :enabled, null: false, default: false
    t.boolean :only_text, null: false, default: true

    t.timestamps
  end
  add_index :nisetegami_templates, [:mailer, :action], unique: true
end