Class: CreateShops

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/shopqi_app/templates/db/migrate/create_shops.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
# File 'lib/generators/shopqi_app/templates/db/migrate/create_shops.rb', line 2

def change
  create_table :shops do |t|
    t.integer :shop_id     , unique: true, null: false
    t.string :name         , limit: 32   , null: false
    t.string :shopqi_domain, limit: 64   , null: false
    t.string :access_token , limit: 64
  end
  add_index :shops, :shop_id, :unique => true
end