class CreateHacks < ActiveRecord::Migration[5.2] def change create_table :hacks do |t| t.string :name t.integer :difficult t.integer :category t.integer :status, default: 0 t.boolean :open_or_not, default: true t.integer :time_limit t.integer :memory_limit t.string :identifier t.references :user t.text :description t.timestamps end add_index :hacks, :identifier, unique: true end end