diff options
Diffstat (limited to 'db/migrate/20161223034646_create_timelogs_ce.rb')
-rw-r--r-- | db/migrate/20161223034646_create_timelogs_ce.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/db/migrate/20161223034646_create_timelogs_ce.rb b/db/migrate/20161223034646_create_timelogs_ce.rb new file mode 100644 index 00000000000..e8a4b406012 --- /dev/null +++ b/db/migrate/20161223034646_create_timelogs_ce.rb @@ -0,0 +1,20 @@ +class CreateTimelogsCe < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + unless table_exists?(:timelogs) + create_table :timelogs do |t| + t.integer :time_spent, null: false + t.references :trackable, polymorphic: true + t.references :user + + t.timestamps null: false + end + + add_index :timelogs, [:trackable_type, :trackable_id] + add_index :timelogs, :user_id + end + end +end |