2016-06-10 21:36:54 +00:00
|
|
|
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
|
|
|
|
# for more information on how to write migrations for GitLab.
|
|
|
|
|
2017-06-13 11:44:13 +00:00
|
|
|
# rubocop:disable Migration/Datetime
|
2016-06-10 21:36:54 +00:00
|
|
|
class AddEnvironments < ActiveRecord::Migration
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
def change
|
|
|
|
create_table :environments, force: true do |t|
|
2016-06-15 10:03:49 +00:00
|
|
|
t.integer :project_id, null: false
|
2016-06-10 21:36:54 +00:00
|
|
|
t.string :name, null: false
|
|
|
|
t.datetime :created_at
|
|
|
|
t.datetime :updated_at
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index :environments, [:project_id, :name]
|
|
|
|
end
|
|
|
|
end
|