Sha256: 55d42315748aa591c7e6679a15f11647f21a0b45e98614d4ae5bbd39fa971566

Contents?: true

Size: 676 Bytes

Versions: 6

Compression:

Stored size: 676 Bytes

Contents

class CreatePunchesTable < ActiveRecord::Migration[4.2]
	def self.up
		create_table :punches do |t|
			t.integer :punchable_id, :null => false
			t.string :punchable_type, :null => false, :limit => 20
			t.datetime :starts_at, :null => false
			t.datetime :ends_at, :null => false
			t.datetime :average_time, :null => false
			t.integer :hits, :null => false, :default=>1
		end

		add_index :punches, [:punchable_type, :punchable_id], :name => :punchable_index, :unique => false
		add_index :punches, :average_time, :unique => false
	end

	def self.down
		remove_index :punches, :name => :punchable_index
		remove_index :punches, :average_time
		drop_table :punches
	end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
proclaim-0.6.6 db/migrate/20190615232009_create_punches_table.rb
proclaim-0.6.5 db/migrate/20190615232009_create_punches_table.rb
proclaim-0.6.4 db/migrate/20190615232009_create_punches_table.rb
proclaim-0.6.3 db/migrate/20190615232009_create_punches_table.rb
proclaim-0.6.2 db/migrate/20190615232009_create_punches_table.rb
proclaim-0.6.1 db/migrate/20190615232009_create_punches_table.rb