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
51390ff9
Commit
51390ff9
authored
Apr 15, 2021
by
Andreas Brandl
Committed by
Heinrich Lee Yu
Apr 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prepare to convert PK type for ci_build_needs
parent
a4650301
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
1 deletion
+67
-1
changelogs/unreleased/ab-pk-conversion-cibuilds-satellites.yml
...elogs/unreleased/ab-pk-conversion-cibuilds-satellites.yml
+5
-0
db/migrate/20210415100159_initialize_conversion_of_ci_build_needs_to_bigint.rb
...0159_initialize_conversion_of_ci_build_needs_to_bigint.rb
+17
-0
db/post_migrate/20210415101228_backfill_ci_build_needs_for_bigint_conversion.rb
...15101228_backfill_ci_build_needs_for_bigint_conversion.rb
+30
-0
db/schema_migrations/20210415100159
db/schema_migrations/20210415100159
+1
-0
db/schema_migrations/20210415101228
db/schema_migrations/20210415101228
+1
-0
db/structure.sql
db/structure.sql
+13
-1
No files found.
changelogs/unreleased/ab-pk-conversion-cibuilds-satellites.yml
0 → 100644
View file @
51390ff9
---
title
:
Prepare to convert PK type for ci_build_needs
merge_request
:
59467
author
:
type
:
other
db/migrate/20210415100159_initialize_conversion_of_ci_build_needs_to_bigint.rb
0 → 100644
View file @
51390ff9
# frozen_string_literal: true
class
InitializeConversionOfCiBuildNeedsToBigint
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
def
up
initialize_conversion_of_integer_to_bigint
:ci_build_needs
,
:build_id
end
def
down
trigger_name
=
rename_trigger_name
(
:ci_build_needs
,
:build_id
,
:build_id_convert_to_bigint
)
remove_rename_triggers_for_postgresql
:ci_build_needs
,
trigger_name
remove_column
:ci_build_needs
,
:build_id_convert_to_bigint
end
end
db/post_migrate/20210415101228_backfill_ci_build_needs_for_bigint_conversion.rb
0 → 100644
View file @
51390ff9
# frozen_string_literal: true
class
BackfillCiBuildNeedsForBigintConversion
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
def
up
return
unless
should_run?
backfill_conversion_of_integer_to_bigint
:ci_build_needs
,
:build_id
,
batch_size:
15000
,
sub_batch_size:
100
end
def
down
return
unless
should_run?
Gitlab
::
Database
::
BackgroundMigration
::
BatchedMigration
.
where
(
job_class_name:
'CopyColumnUsingBackgroundMigrationJob'
)
.
where
(
table_name:
'ci_build_needs'
,
column_name:
'build_id'
)
.
where
(
'job_arguments = ?'
,
%w[build_id build_id_convert_to_bigint]
.
to_json
)
.
delete_all
end
private
def
should_run?
Gitlab
.
dev_or_test_env?
||
Gitlab
.
com?
end
end
db/schema_migrations/20210415100159
0 → 100644
View file @
51390ff9
dd6474593b6f4dd82f7f4776f558a82fa34307c45e20f13f77807f7dc96db368
\ No newline at end of file
db/schema_migrations/20210415101228
0 → 100644
View file @
51390ff9
2ba1f8832a6ba4300796ff9f74dfa2d0ff7a648a9231db369274ad002d0e4ec8
\ No newline at end of file
db/structure.sql
View file @
51390ff9
...
@@ -106,6 +106,15 @@ BEGIN
...
@@ -106,6 +106,15 @@ BEGIN
END;
END;
$$;
$$;
CREATE FUNCTION trigger_21e7a2602957() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
NEW."build_id_convert_to_bigint" := NEW."build_id";
RETURN NEW;
END;
$$;
CREATE FUNCTION trigger_69523443cc10() RETURNS trigger
CREATE FUNCTION trigger_69523443cc10() RETURNS trigger
LANGUAGE plpgsql
LANGUAGE plpgsql
AS $$
AS $$
...
@@ -10283,7 +10292,8 @@ CREATE TABLE ci_build_needs (
...
@@ -10283,7 +10292,8 @@ CREATE TABLE ci_build_needs (
build_id integer NOT NULL,
build_id integer NOT NULL,
name text NOT NULL,
name text NOT NULL,
artifacts boolean DEFAULT true NOT NULL,
artifacts boolean DEFAULT true NOT NULL,
optional boolean DEFAULT false NOT NULL
optional boolean DEFAULT false NOT NULL,
build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
);
);
CREATE SEQUENCE ci_build_needs_id_seq
CREATE SEQUENCE ci_build_needs_id_seq
...
@@ -24713,6 +24723,8 @@ CREATE TRIGGER table_sync_trigger_b99eb6998c AFTER INSERT OR DELETE OR UPDATE ON
...
@@ -24713,6 +24723,8 @@ CREATE TRIGGER table_sync_trigger_b99eb6998c AFTER INSERT OR DELETE OR UPDATE ON
CREATE TRIGGER trigger_07c94931164e BEFORE INSERT OR UPDATE ON push_event_payloads FOR EACH ROW EXECUTE PROCEDURE trigger_07c94931164e();
CREATE TRIGGER trigger_07c94931164e BEFORE INSERT OR UPDATE ON push_event_payloads FOR EACH ROW EXECUTE PROCEDURE trigger_07c94931164e();
CREATE TRIGGER trigger_21e7a2602957 BEFORE INSERT OR UPDATE ON ci_build_needs FOR EACH ROW EXECUTE PROCEDURE trigger_21e7a2602957();
CREATE TRIGGER trigger_69523443cc10 BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE PROCEDURE trigger_69523443cc10();
CREATE TRIGGER trigger_69523443cc10 BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE PROCEDURE trigger_69523443cc10();
CREATE TRIGGER trigger_8485e97c00e3 BEFORE INSERT OR UPDATE ON ci_sources_pipelines FOR EACH ROW EXECUTE PROCEDURE trigger_8485e97c00e3();
CREATE TRIGGER trigger_8485e97c00e3 BEFORE INSERT OR UPDATE ON ci_sources_pipelines FOR EACH ROW EXECUTE PROCEDURE trigger_8485e97c00e3();
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