Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b6ad71fc
Commit
b6ad71fc
authored
Mar 05, 2021
by
Dmytro Zaporozhets (DZ)
Committed by
Andreas Brandl
Mar 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove outdated ci db columns
Signed-off-by:
Dmytro Zaporozhets
<
dzaporozhets@gitlab.com
>
parent
8da5d135
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
66 additions
and
12 deletions
+66
-12
changelogs/unreleased/remove-deprecated-columns.yml
changelogs/unreleased/remove-deprecated-columns.yml
+5
-0
db/post_migrate/20210218105431_remove_deprecated_ci_builds_columns.rb
...ate/20210218105431_remove_deprecated_ci_builds_columns.rb
+36
-0
db/post_migrate/20210218110552_remove_deprecated_ci_runner_column.rb
...rate/20210218110552_remove_deprecated_ci_runner_column.rb
+22
-0
db/schema_migrations/20210218105431
db/schema_migrations/20210218105431
+1
-0
db/schema_migrations/20210218110552
db/schema_migrations/20210218110552
+1
-0
db/structure.sql
db/structure.sql
+0
-11
spec/lib/gitlab/background_migration/migrate_legacy_artifacts_spec.rb
...lab/background_migration/migrate_legacy_artifacts_spec.rb
+1
-1
No files found.
changelogs/unreleased/remove-deprecated-columns.yml
0 → 100644
View file @
b6ad71fc
---
title
:
Remove outdated ci db columns
merge_request
:
54564
author
:
type
:
changed
db/post_migrate/20210218105431_remove_deprecated_ci_builds_columns.rb
0 → 100644
View file @
b6ad71fc
# frozen_string_literal: true
class
RemoveDeprecatedCiBuildsColumns
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
disable_ddl_transaction!
def
up
with_lock_retries
do
remove_column
:ci_builds
,
:artifacts_file
remove_column
:ci_builds
,
:artifacts_file_store
remove_column
:ci_builds
,
:artifacts_metadata
remove_column
:ci_builds
,
:artifacts_metadata_store
remove_column
:ci_builds
,
:artifacts_size
remove_column
:ci_builds
,
:commands
end
end
def
down
# rubocop:disable Migration/AddColumnsToWideTables
with_lock_retries
do
add_column
:ci_builds
,
:artifacts_file
,
:text
add_column
:ci_builds
,
:artifacts_file_store
,
:integer
add_column
:ci_builds
,
:artifacts_metadata
,
:text
add_column
:ci_builds
,
:artifacts_metadata_store
,
:integer
add_column
:ci_builds
,
:artifacts_size
,
:bigint
add_column
:ci_builds
,
:commands
,
:text
end
# rubocop:enable Migration/AddColumnsToWideTables
add_concurrent_index
:ci_builds
,
:artifacts_expire_at
,
where:
"artifacts_file <> ''::text"
,
name:
'index_ci_builds_on_artifacts_expire_at'
end
end
db/post_migrate/20210218110552_remove_deprecated_ci_runner_column.rb
0 → 100644
View file @
b6ad71fc
# frozen_string_literal: true
class
RemoveDeprecatedCiRunnerColumn
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
disable_ddl_transaction!
def
up
with_lock_retries
do
remove_column
:ci_runners
,
:is_shared
end
end
def
down
add_column
:ci_runners
,
:is_shared
,
:boolean
,
default:
false
unless
column_exists?
(
:ci_runners
,
:is_shared
)
add_concurrent_index
:ci_runners
,
:is_shared
end
end
db/schema_migrations/20210218105431
0 → 100644
View file @
b6ad71fc
b5ff5aeb9cef243165d9c40db7211f61a632edb6a189c09112ef069d267bf64d
\ No newline at end of file
db/schema_migrations/20210218110552
0 → 100644
View file @
b6ad71fc
7631c82f9762e643a4da9c03f3870ab1c97fae93da4975219d9ab7cd629720ec
\ No newline at end of file
db/structure.sql
View file @
b6ad71fc
...
...
@@ -10266,7 +10266,6 @@ CREATE TABLE ci_builds (
runner_id integer,
coverage double precision,
commit_id integer,
commands text,
name character varying,
options text,
allow_failure boolean DEFAULT false NOT NULL,
...
...
@@ -10279,14 +10278,11 @@ CREATE TABLE ci_builds (
type character varying,
target_url character varying,
description character varying,
artifacts_file text,
project_id integer,
artifacts_metadata text,
erased_by_id integer,
erased_at timestamp without time zone,
artifacts_expire_at timestamp without time zone,
environment character varying,
artifacts_size bigint,
"when" character varying,
yaml_variables text,
queued_at timestamp without time zone,
...
...
@@ -10296,8 +10292,6 @@ CREATE TABLE ci_builds (
auto_canceled_by_id integer,
retried boolean,
stage_id integer,
artifacts_file_store integer,
artifacts_metadata_store integer,
protected boolean,
failure_reason integer,
scheduled_at timestamp with time zone,
...
...
@@ -10832,7 +10826,6 @@ CREATE TABLE ci_runners (
description character varying,
contacted_at timestamp without time zone,
active boolean DEFAULT true NOT NULL,
is_shared boolean DEFAULT false,
name character varying,
version character varying,
revision character varying,
...
...
@@ -21752,8 +21745,6 @@ CREATE INDEX index_ci_builds_metadata_on_build_id_and_id_and_interruptible ON ci
CREATE INDEX index_ci_builds_metadata_on_project_id ON ci_builds_metadata USING btree (project_id);
CREATE INDEX index_ci_builds_on_artifacts_expire_at ON ci_builds USING btree (artifacts_expire_at) WHERE (artifacts_file <> ''::text);
CREATE INDEX index_ci_builds_on_auto_canceled_by_id ON ci_builds USING btree (auto_canceled_by_id);
CREATE INDEX index_ci_builds_on_commit_id_and_stage_idx_and_created_at ON ci_builds USING btree (commit_id, stage_idx, created_at);
...
...
@@ -21916,8 +21907,6 @@ CREATE INDEX index_ci_runner_projects_on_runner_id ON ci_runner_projects USING b
CREATE INDEX index_ci_runners_on_contacted_at ON ci_runners USING btree (contacted_at);
CREATE INDEX index_ci_runners_on_is_shared ON ci_runners USING btree (is_shared);
CREATE INDEX index_ci_runners_on_locked ON ci_runners USING btree (locked);
CREATE INDEX index_ci_runners_on_runner_type ON ci_runners USING btree (runner_type);
spec/lib/gitlab/background_migration/migrate_legacy_artifacts_spec.rb
View file @
b6ad71fc
...
...
@@ -2,7 +2,7 @@
require
'spec_helper'
RSpec
.
describe
Gitlab
::
BackgroundMigration
::
MigrateLegacyArtifacts
do
RSpec
.
describe
Gitlab
::
BackgroundMigration
::
MigrateLegacyArtifacts
,
schema:
20210210093901
do
let
(
:namespaces
)
{
table
(
:namespaces
)
}
let
(
:projects
)
{
table
(
:projects
)
}
let
(
:pipelines
)
{
table
(
:ci_pipelines
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment