Class: CreateDomains
- Inherits:
-
Object
- Object
- CreateDomains
- Defined in:
- lib/generators/doamin_handler/migration/tempates/create_domain.rb
Instance Method Summary collapse
Instance Method Details
#change ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/generators/doamin_handler/migration/tempates/create_domain.rb', line 2 def change create_table :domains, id: false, primary_key: :domain_id do |t| t.references :shop, foreign_key: true t.string :host, null: false, default: '' t.string :localization t.string :market_web_presence t.boolean :ssl_enabled, null: false t.string :url t.string :domain_id # You probably would want `domain_id` to be unique. In that case... t.index :domain_id, unique: true t. end end |