summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-04-26 15:06:04 +0900
committerShinya Maeda <shinya@gitlab.com>2018-04-26 15:06:04 +0900
commit9d6fe7bfdf9ff3f68ee73baa0e3d0aa7df13c351 (patch)
tree575021ca2d2a2775ee6fe74bd2a323735afa9f22 /db
parent4eb67ccff350d181e60e4666e459a364cd36b064 (diff)
downloadgitlab-ce-9d6fe7bfdf9ff3f68ee73baa0e3d0aa7df13c351.tar.gz
Refactoring ci_job_trace to ci_build_trace
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180326202229_create_ci_build_trace_chunks.rb17
-rw-r--r--db/migrate/20180326202229_create_ci_job_trace_chunks.rb17
-rw-r--r--db/migrate/20180406204716_add_limits_ci_build_trace_chunks_raw_data_for_mysql.rb (renamed from db/migrate/20180406204716_add_limits_ci_job_trace_chunks_raw_data_for_mysql.rb)6
-rw-r--r--db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql.rb9
-rw-r--r--db/migrate/limits_ci_job_trace_chunks_raw_data_for_mysql.rb9
-rw-r--r--db/schema.rb22
6 files changed, 40 insertions, 40 deletions
diff --git a/db/migrate/20180326202229_create_ci_build_trace_chunks.rb b/db/migrate/20180326202229_create_ci_build_trace_chunks.rb
new file mode 100644
index 00000000000..fb3f5786e85
--- /dev/null
+++ b/db/migrate/20180326202229_create_ci_build_trace_chunks.rb
@@ -0,0 +1,17 @@
+class CreateCiBuildTraceChunks < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def change
+ create_table :ci_build_trace_chunks, id: :bigserial do |t|
+ t.integer :build_id, null: false
+ t.integer :chunk_index, null: false
+ t.integer :data_store, null: false
+ t.binary :raw_data
+
+ t.foreign_key :ci_builds, column: :build_id, on_delete: :cascade
+ t.index [:build_id, :chunk_index], unique: true
+ end
+ end
+end
diff --git a/db/migrate/20180326202229_create_ci_job_trace_chunks.rb b/db/migrate/20180326202229_create_ci_job_trace_chunks.rb
deleted file mode 100644
index 23bc478eb29..00000000000
--- a/db/migrate/20180326202229_create_ci_job_trace_chunks.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-class CreateCiJobTraceChunks < ActiveRecord::Migration
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def change
- create_table :ci_job_trace_chunks, id: :bigserial do |t|
- t.integer :job_id, null: false
- t.integer :chunk_index, null: false
- t.integer :data_store, null: false
- t.binary :raw_data
-
- t.foreign_key :ci_builds, column: :job_id, on_delete: :cascade
- t.index [:job_id, :chunk_index], unique: true
- end
- end
-end
diff --git a/db/migrate/20180406204716_add_limits_ci_job_trace_chunks_raw_data_for_mysql.rb b/db/migrate/20180406204716_add_limits_ci_build_trace_chunks_raw_data_for_mysql.rb
index e7343db7da0..0f2734853e6 100644
--- a/db/migrate/20180406204716_add_limits_ci_job_trace_chunks_raw_data_for_mysql.rb
+++ b/db/migrate/20180406204716_add_limits_ci_build_trace_chunks_raw_data_for_mysql.rb
@@ -1,13 +1,13 @@
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
-require Rails.root.join('db/migrate/limits_ci_job_trace_chunks_raw_data_for_mysql')
+require Rails.root.join('db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql')
-class AddLimitsCiJobTraceChunksRawDataForMysql < ActiveRecord::Migration
+class AddLimitsCiBuildTraceChunksRawDataForMysql < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
- LimitsCiJobTraceChunksRawDataForMysql.new.up
+ LimitsCiBuildTraceChunksRawDataForMysql.new.up
end
end
diff --git a/db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql.rb b/db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql.rb
new file mode 100644
index 00000000000..e1771912c3c
--- /dev/null
+++ b/db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql.rb
@@ -0,0 +1,9 @@
+class LimitsCiBuildTraceChunksRawDataForMysql < ActiveRecord::Migration
+ def up
+ return unless Gitlab::Database.mysql?
+
+ # Mysql needs MEDIUMTEXT type (up to 16MB) rather than TEXT (up to 64KB)
+ # Because 'raw_data' is always capped by Ci::BuildTraceChunk::CHUNK_SIZE, which is 128KB
+ change_column :ci_build_trace_chunks, :raw_data, :binary, limit: 16.megabytes - 1 #MEDIUMTEXT
+ end
+end
diff --git a/db/migrate/limits_ci_job_trace_chunks_raw_data_for_mysql.rb b/db/migrate/limits_ci_job_trace_chunks_raw_data_for_mysql.rb
deleted file mode 100644
index 38310b7443a..00000000000
--- a/db/migrate/limits_ci_job_trace_chunks_raw_data_for_mysql.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-class LimitsCiJobTraceChunksRawDataForMysql < ActiveRecord::Migration
- def up
- return unless Gitlab::Database.mysql?
-
- # Mysql needs MEDIUMTEXT type (up to 16MB) rather than TEXT (up to 64KB)
- # Because 'raw_data' is always capped by Ci::JobTraceChunk::CHUNK_SIZE, which is 128KB
- change_column :ci_job_trace_chunks, :raw_data, :binary, limit: 16.megabytes - 1 #MEDIUMTEXT
- end
-end
diff --git a/db/schema.rb b/db/schema.rb
index 19ae9cbf443..06232f68894 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20180425131009) do
+ActiveRecord::Schema.define(version: 20180425205249) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -246,6 +246,15 @@ ActiveRecord::Schema.define(version: 20180425131009) do
add_index "chat_teams", ["namespace_id"], name: "index_chat_teams_on_namespace_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
+ t.integer "data_store", null: false
+ t.binary "raw_data"
+ end
+
+ add_index "ci_build_trace_chunks", ["build_id", "chunk_index"], name: "index_ci_build_trace_chunks_on_build_id_and_chunk_index", unique: true, using: :btree
+
create_table "ci_build_trace_section_names", force: :cascade do |t|
t.integer "project_id", null: false
t.string "name", null: false
@@ -371,15 +380,6 @@ ActiveRecord::Schema.define(version: 20180425131009) do
add_index "ci_job_artifacts", ["job_id", "file_type"], name: "index_ci_job_artifacts_on_job_id_and_file_type", unique: true, using: :btree
add_index "ci_job_artifacts", ["project_id"], name: "index_ci_job_artifacts_on_project_id", using: :btree
- create_table "ci_job_trace_chunks", id: :bigserial, force: :cascade do |t|
- t.integer "job_id", null: false
- t.integer "chunk_index", null: false
- t.integer "data_store", null: false
- t.binary "raw_data"
- end
-
- add_index "ci_job_trace_chunks", ["job_id", "chunk_index"], name: "index_ci_job_trace_chunks_on_job_id_and_chunk_index", unique: true, using: :btree
-
create_table "ci_pipeline_schedule_variables", force: :cascade do |t|
t.string "key", null: false
t.text "value"
@@ -2075,6 +2075,7 @@ ActiveRecord::Schema.define(version: 20180425131009) 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_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
add_foreign_key "ci_build_trace_sections", "ci_builds", column: "build_id", name: "fk_4ebe41f502", on_delete: :cascade
@@ -2087,7 +2088,6 @@ ActiveRecord::Schema.define(version: 20180425131009) do
add_foreign_key "ci_group_variables", "namespaces", column: "group_id", name: "fk_33ae4d58d8", on_delete: :cascade
add_foreign_key "ci_job_artifacts", "ci_builds", column: "job_id", on_delete: :cascade
add_foreign_key "ci_job_artifacts", "projects", on_delete: :cascade
- add_foreign_key "ci_job_trace_chunks", "ci_builds", column: "job_id", on_delete: :cascade
add_foreign_key "ci_pipeline_schedule_variables", "ci_pipeline_schedules", column: "pipeline_schedule_id", name: "fk_41c35fda51", on_delete: :cascade
add_foreign_key "ci_pipeline_schedules", "projects", name: "fk_8ead60fcc4", on_delete: :cascade
add_foreign_key "ci_pipeline_schedules", "users", column: "owner_id", name: "fk_9ea99f58d2", on_delete: :nullify