Class: CreateShops

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

Class Method Summary collapse

Class Method Details

.downObject



12
13
14
# File 'lib/generators/shopify_app/shop_model/templates/db/migrate/create_shops.rb', line 12

def self.down
  drop_table :shops
end

.upObject



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

def self.up
  create_table :shops  do |t|
    t.string :shopify_domain, null: false
    t.string :shopify_token, null: false
    t.timestamps
  end

  add_index :shops, :shopify_domain, unique: true
end