debian-mirror-gitlab/db/migrate/20200408125046_create_ci_freeze_periods.rb
2020-06-23 00:09:42 +05:30

32 lines
855 B
Ruby

# frozen_string_literal: true
class CreateCiFreezePeriods < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
unless table_exists?(:ci_freeze_periods)
create_table :ci_freeze_periods do |t|
t.references :project, foreign_key: true, null: false
t.text :freeze_start, null: false
t.text :freeze_end, null: false
t.text :cron_timezone, null: false
t.timestamps_with_timezone null: false
end
end
add_text_limit :ci_freeze_periods, :freeze_start, 998
add_text_limit :ci_freeze_periods, :freeze_end, 998
add_text_limit :ci_freeze_periods, :cron_timezone, 255
end
def down
# rubocop:disable Migration/DropTable
drop_table :ci_freeze_periods
# rubocop:enable Migration/DropTable
end
end