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
a8fa277e
Commit
a8fa277e
authored
May 09, 2018
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove project_mirror_data created_at and updated_at columns
parent
df349b66
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
9 deletions
+24
-9
ee/app/models/ee/project_import_state.rb
ee/app/models/ee/project_import_state.rb
+3
-0
ee/db/migrate/20170509153720_create_project_mirror_data_ee.rb
...b/migrate/20170509153720_create_project_mirror_data_ee.rb
+1
-3
ee/db/post_migrate/20170530111134_ensure_project_mirror_data.rb
...post_migrate/20170530111134_ensure_project_mirror_data.rb
+2
-6
ee/db/post_migrate/20180509091305_remove_project_mirror_data_created_at_updated_at.rb
...91305_remove_project_mirror_data_created_at_updated_at.rb
+18
-0
No files found.
ee/app/models/ee/project_import_state.rb
View file @
a8fa277e
...
@@ -4,6 +4,9 @@ module EE
...
@@ -4,6 +4,9 @@ module EE
extend
::
Gitlab
::
Utils
::
Override
extend
::
Gitlab
::
Utils
::
Override
prepended
do
prepended
do
include
IgnorableColumn
ignore_column
:created_at
,
:updated_at
BACKOFF_PERIOD
=
24
.
seconds
BACKOFF_PERIOD
=
24
.
seconds
JITTER
=
6
.
seconds
JITTER
=
6
.
seconds
...
...
ee/db/migrate/20170509153720_create_project_mirror_data_ee.rb
View file @
a8fa277e
...
@@ -21,9 +21,7 @@ class CreateProjectMirrorDataEE < ActiveRecord::Migration
...
@@ -21,9 +21,7 @@ class CreateProjectMirrorDataEE < ActiveRecord::Migration
0 AS retry_count,
0 AS retry_count,
CAST(NULL AS
#{
timestamp
}
) AS last_update_started_at,
CAST(NULL AS
#{
timestamp
}
) AS last_update_started_at,
CAST(NULL AS
#{
timestamp
}
) AS last_update_scheduled_at,
CAST(NULL AS
#{
timestamp
}
) AS last_update_scheduled_at,
NOW() AS next_execution_timestamp,
NOW() AS next_execution_timestamp
NOW() AS created_at,
NOW() AS updated_at
FROM projects
FROM projects
WHERE mirror IS TRUE
WHERE mirror IS TRUE
);
);
...
...
ee/db/post_migrate/20170530111134_ensure_project_mirror_data.rb
View file @
a8fa277e
...
@@ -12,17 +12,13 @@ class EnsureProjectMirrorData < ActiveRecord::Migration
...
@@ -12,17 +12,13 @@ class EnsureProjectMirrorData < ActiveRecord::Migration
retry_count,
retry_count,
last_update_started_at,
last_update_started_at,
last_update_scheduled_at,
last_update_scheduled_at,
next_execution_timestamp,
next_execution_timestamp
created_at,
updated_at
)
)
SELECT id AS project_id,
SELECT id AS project_id,
0 AS retry_count,
0 AS retry_count,
CAST(NULL AS TIMESTAMP) AS last_update_started_at,
CAST(NULL AS TIMESTAMP) AS last_update_started_at,
CAST(NULL AS TIMESTAMP) AS last_update_scheduled_at,
CAST(NULL AS TIMESTAMP) AS last_update_scheduled_at,
NOW() AS next_execution_timestamp,
NOW() AS next_execution_timestamp
NOW() AS created_at,
NOW() as updated_at
FROM projects
FROM projects
WHERE mirror IS TRUE
WHERE mirror IS TRUE
AND NOT EXISTS (
AND NOT EXISTS (
...
...
ee/db/post_migrate/20180509091305_remove_project_mirror_data_created_at_updated_at.rb
0 → 100644
View file @
a8fa277e
class
RemoveProjectMirrorDataCreatedAtUpdatedAt
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
def
up
# A project_mirror_data table created in EE would have these columns, but
# one created in CE wouldn't. We don't actually need them, so let's remove them.
remove_column
:project_mirror_data
,
:created_at
if
column_exists?
(
:project_mirror_data
,
:created_at
)
remove_column
:project_mirror_data
,
:updated_at
if
column_exists?
(
:project_mirror_data
,
:updated_at
)
end
def
down
# The columns do not need to be re-added; no application logic ever used them,
# and migrations that did have been modified to no longer do so.
end
end
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