Class: CreateGrassSources

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/templates/app/db/migrate/1_create_grass_sources.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



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

def change
  create_table :grass_sources, id: false do |t|
    t.column    :keyid, :string, null: false, index: true, primary: true 
    t.column    :dir, :string
    t.column    :path, :string
    t.column    :locale, :string
    t.column    :format, :string
    t.column    :handler, :string
    t.column    :filepath, :string      

    t.column    :raw, :text
    t.column    :result, :text      
    t.column    :binary, :oid, limit: 2147483648 #:binary      
    
    t.column    :pairs, :string, default: []
    t.column    :hidden, :boolean, default: false
    t.column    :mime_type, :string

    t.timestamps
  end
  add_index :grass_sources, [:locale,:dir,:path], unique: true
end