gitlab-org--gitlab-foss/db/migrate/20170828093725_create_project_auto_dev_ops.rb
Zeger-Jan van de Weg 6ed490401f
Implement the implied CI/CD config for AutoDevOps
Behind an application setting, which defaults to false, this commit
implements the implied CI/CD config. Which means that in the case we
can't find the `.gitlab-ci.yml` on the commit we want to start a
pipeline for, we fall back to an implied configuration.

For now the Bash template has been copied to
`Auto-Devops.gitlab-ci.yml` so the tests actually work.

Fixes #34777
2017-08-31 22:25:25 +02:00

24 lines
593 B
Ruby

class CreateProjectAutoDevOps < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
create_table :project_auto_devops do |t|
t.belongs_to :project, index: true
t.boolean :enabled, default: true
t.string :domain
end
add_timestamps_with_timezone(:project_auto_devops, null: false)
# No need to check for violations as its a new table
add_concurrent_foreign_key(:project_auto_devops, :projects, column: :project_id)
end
def down
drop_table(:project_auto_devops)
end
end