You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

032_create_time_entries.rb 971B

123456789101112131415161718192021222324
  1. class CreateTimeEntries < ActiveRecord::Migration[4.2]
  2. def self.up
  3. create_table :time_entries do |t|
  4. t.column :project_id, :integer, :null => false
  5. t.column :user_id, :integer, :null => false
  6. t.column :issue_id, :integer
  7. t.column :hours, :float, :null => false
  8. t.column :comments, :string, :limit => 255
  9. t.column :activity_id, :integer, :null => false
  10. t.column :spent_on, :date, :null => false
  11. t.column :tyear, :integer, :null => false
  12. t.column :tmonth, :integer, :null => false
  13. t.column :tweek, :integer, :null => false
  14. t.column :created_on, :datetime, :null => false
  15. t.column :updated_on, :datetime, :null => false
  16. end
  17. add_index :time_entries, [:project_id], :name => :time_entries_project_id
  18. add_index :time_entries, [:issue_id], :name => :time_entries_issue_id
  19. end
  20. def self.down
  21. drop_table :time_entries
  22. end
  23. end