Add deploy_strategy to ProjectAutoDevops

上级 2de002b3
class ProjectAutoDevops < ActiveRecord::Base
belongs_to :project
enum deploy_strategy: {
manual: 1,
continuous: 2
}
scope :enabled, -> { where(enabled: true) }
scope :disabled, -> { where(enabled: false) }
......
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class AddDeployStrategyToProjectAutoDevops < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
def change
change_table :project_auto_devops do |t|
t.integer :deploy_strategy, null: false, default: 0
end
end
end
......@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20180529093006) do
ActiveRecord::Schema.define(version: 20180601213245) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......@@ -1490,6 +1490,7 @@ ActiveRecord::Schema.define(version: 20180529093006) do
t.datetime_with_timezone "updated_at", null: false
t.boolean "enabled"
t.string "domain"
t.integer "deploy_strategy", default: 0, null: false
end
add_index "project_auto_devops", ["project_id"], name: "index_project_auto_devops_on_project_id", unique: true, using: :btree
......
......@@ -5,6 +5,8 @@ describe ProjectAutoDevops do
it { is_expected.to belong_to(:project) }
it { is_expected.to define_enum_for(:deploy_strategy) }
it { is_expected.to respond_to(:created_at) }
it { is_expected.to respond_to(:updated_at) }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册