debian-mirror-gitlab/db/migrate/20230203011359_create_automation_rules.rb
2023-04-23 21:23:45 +05:30

28 lines
913 B
Ruby

# frozen_string_literal: true
class CreateAutomationRules < Gitlab::Database::Migration[2.1]
enable_lock_retries!
def up
create_table :automation_rules do |t|
t.references :namespace, null: false, index: false, foreign_key: { on_delete: :cascade }
t.boolean :issues_events, default: false, null: false
t.boolean :merge_requests_events, default: false, null: false
t.boolean :permanently_disabled, default: false, null: false
t.text :name, null: false, limit: 255
t.text :rule, null: false, limit: 2048
t.timestamps_with_timezone null: false
t.index 'namespace_id, LOWER(name)',
name: 'index_automation_rules_namespace_id_name',
unique: true
t.index [:namespace_id, :permanently_disabled],
name: 'index_automation_rules_namespace_id_permanently_disabled'
end
end
def down
drop_table :automation_rules
end
end