diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20180913102839_create_build_schedules.rb | 19 | ||||
-rw-r--r-- | db/schema.rb | 8 |
2 files changed, 27 insertions, 0 deletions
diff --git a/db/migrate/20180913102839_create_build_schedules.rb b/db/migrate/20180913102839_create_build_schedules.rb new file mode 100644 index 00000000000..1e9d9a70b0f --- /dev/null +++ b/db/migrate/20180913102839_create_build_schedules.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class CreateBuildSchedules < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def change + create_table :ci_build_schedules, id: :bigserial do |t| + t.integer :build_id, null: false + t.datetime :execute_at, null: false + + t.foreign_key :ci_builds, column: :build_id, on_delete: :cascade + t.index :build_id, unique: true + end + end +end diff --git a/db/schema.rb b/db/schema.rb index b3d4badaf82..581496d78ce 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -260,6 +260,13 @@ ActiveRecord::Schema.define(version: 20180924141949) do add_index "chat_teams", ["namespace_id"], name: "index_chat_teams_on_namespace_id", unique: true, using: :btree + create_table "ci_build_schedules", id: :bigserial, force: :cascade do |t| + t.integer "build_id", null: false + t.datetime "execute_at", null: false + end + + add_index "ci_build_schedules", ["build_id"], name: "index_ci_build_schedules_on_build_id", unique: true, using: :btree + create_table "ci_build_trace_chunks", id: :bigserial, force: :cascade do |t| t.integer "build_id", null: false t.integer "chunk_index", null: false @@ -2288,6 +2295,7 @@ ActiveRecord::Schema.define(version: 20180924141949) do add_foreign_key "boards", "namespaces", column: "group_id", on_delete: :cascade add_foreign_key "boards", "projects", name: "fk_f15266b5f9", on_delete: :cascade add_foreign_key "chat_teams", "namespaces", on_delete: :cascade + add_foreign_key "ci_build_schedules", "ci_builds", column: "build_id", on_delete: :cascade add_foreign_key "ci_build_trace_chunks", "ci_builds", column: "build_id", on_delete: :cascade add_foreign_key "ci_build_trace_section_names", "projects", on_delete: :cascade add_foreign_key "ci_build_trace_sections", "ci_build_trace_section_names", column: "section_name_id", name: "fk_264e112c66", on_delete: :cascade |