2bf5fe5ede
The time tracking feature was backported from EE to CE, thus the CE migrations should be uniquely named and should skip the actual migration content if the table/columns already exist (that means that the EE migrations were already performed). Signed-off-by: Rémy Coutable <remy@rymai.me>
20 lines
480 B
Ruby
20 lines
480 B
Ruby
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
|