2017-06-13 07:44:13 -04:00
|
|
|
# rubocop:disable Migration/Timestamps
|
2018-11-13 02:27:31 -05:00
|
|
|
class CreatePipelineSchedulesTable < ActiveRecord::Migration[4.2]
|
2017-05-07 18:35:56 -04:00
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
def up
|
|
|
|
create_table :ci_pipeline_schedules do |t|
|
|
|
|
t.string :description
|
|
|
|
t.string :ref
|
|
|
|
t.string :cron
|
|
|
|
t.string :cron_timezone
|
|
|
|
t.datetime :next_run_at
|
|
|
|
t.integer :project_id
|
|
|
|
t.integer :owner_id
|
|
|
|
t.boolean :active, default: true
|
|
|
|
t.datetime :deleted_at
|
|
|
|
|
2018-01-18 06:18:47 -05:00
|
|
|
t.timestamps null: true
|
2017-05-07 18:35:56 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index(:ci_pipeline_schedules, :project_id)
|
|
|
|
add_index(:ci_pipeline_schedules, [:next_run_at, :active])
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
drop_table :ci_pipeline_schedules
|
|
|
|
end
|
|
|
|
end
|