Commit a8fa277e authored by Douwe Maan's avatar Douwe Maan

Remove project_mirror_data created_at and updated_at columns

parent df349b66
......@@ -4,6 +4,9 @@ module EE
extend ::Gitlab::Utils::Override
prepended do
include IgnorableColumn
ignore_column :created_at, :updated_at
BACKOFF_PERIOD = 24.seconds
JITTER = 6.seconds
......
......@@ -21,9 +21,7 @@ class CreateProjectMirrorDataEE < ActiveRecord::Migration
0 AS retry_count,
CAST(NULL AS #{timestamp}) AS last_update_started_at,
CAST(NULL AS #{timestamp}) AS last_update_scheduled_at,
NOW() AS next_execution_timestamp,
NOW() AS created_at,
NOW() AS updated_at
NOW() AS next_execution_timestamp
FROM projects
WHERE mirror IS TRUE
);
......
......@@ -12,17 +12,13 @@ class EnsureProjectMirrorData < ActiveRecord::Migration
retry_count,
last_update_started_at,
last_update_scheduled_at,
next_execution_timestamp,
created_at,
updated_at
next_execution_timestamp
)
SELECT id AS project_id,
0 AS retry_count,
CAST(NULL AS TIMESTAMP) AS last_update_started_at,
CAST(NULL AS TIMESTAMP) AS last_update_scheduled_at,
NOW() AS next_execution_timestamp,
NOW() AS created_at,
NOW() as updated_at
NOW() AS next_execution_timestamp
FROM projects
WHERE mirror IS TRUE
AND NOT EXISTS (
......
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment