PageRenderTime 21ms CodeModel.GetById 9ms app.highlight 9ms RepoModel.GetById 2ms app.codeStats 0ms

/db/post_migrate/20170425130047_drop_ci_trigger_schedules_table.rb

https://gitlab.com/visay/gitlab-ce
Ruby | 33 lines | 26 code | 6 blank | 1 comment | 0 complexity | 7c0e26837bb65a5bad8352595dee25a1 MD5 | raw file
 1# rubocop:disable Migration/Datetime
 2class DropCiTriggerSchedulesTable < ActiveRecord::Migration
 3  include Gitlab::Database::MigrationHelpers
 4
 5  DOWNTIME = false
 6
 7  disable_ddl_transaction!
 8
 9  def up
10    drop_table :ci_trigger_schedules
11  end
12
13  def down
14    create_table "ci_trigger_schedules", force: :cascade do |t|
15      t.integer "project_id"
16      t.integer "trigger_id", null: false
17      t.datetime "deleted_at"
18      t.datetime "created_at"
19      t.datetime "updated_at"
20      t.string "cron"
21      t.string "cron_timezone"
22      t.datetime "next_run_at"
23      t.string "ref"
24      t.boolean "active"
25    end
26
27    add_index "ci_trigger_schedules", %w(active next_run_at), name: "index_ci_trigger_schedules_on_active_and_next_run_at", using: :btree
28    add_index "ci_trigger_schedules", ["project_id"], name: "index_ci_trigger_schedules_on_project_id", using: :btree
29    add_index "ci_trigger_schedules", ["next_run_at"], name: "index_ci_trigger_schedules_on_next_run_at"
30
31    add_concurrent_foreign_key "ci_trigger_schedules", "ci_triggers", column: :trigger_id, on_delete: :cascade
32  end
33end