diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2017-08-30 15:38:16 +0200 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2017-09-06 16:40:31 +0200 |
commit | 235b105c917c16ab14a79ba13280aff4fd9f1cf9 (patch) | |
tree | 27bfe7e1ff2e4caacbdc4450e510164771b66c19 /spec/lib/gitlab/import_export | |
parent | 1632ffa6ad16738994122f0e84f331d50f220879 (diff) | |
download | gitlab-ce-235b105c917c16ab14a79ba13280aff4fd9f1cf9.tar.gz |
Finish migration to the new events setupevents-migration-cleanup
This finishes the procedure for migrating events from the old format
into the new format. Code no longer uses the old setup and the database
tables used during the migration process are swapped, with the old table
being dropped.
While the database migration can be reversed this will 1) take a lot of
time as data has to be coped around 2) won't restore data in the
"events.data" column as we have no way of restoring this.
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/37241
Diffstat (limited to 'spec/lib/gitlab/import_export')
-rw-r--r-- | spec/lib/gitlab/import_export/project.json | 87 | ||||
-rw-r--r-- | spec/lib/gitlab/import_export/project_tree_restorer_spec.rb | 6 | ||||
-rw-r--r-- | spec/lib/gitlab/import_export/safe_model_attributes.yml | 2 |
3 files changed, 2 insertions, 93 deletions
diff --git a/spec/lib/gitlab/import_export/project.json b/spec/lib/gitlab/import_export/project.json index 331b7cf2fea..1115fb218d6 100644 --- a/spec/lib/gitlab/import_export/project.json +++ b/spec/lib/gitlab/import_export/project.json @@ -75,8 +75,6 @@ "id": 487, "target_type": "Milestone", "target_id": 1, - "title": null, - "data": null, "project_id": 46, "created_at": "2016-06-14T15:02:04.418Z", "updated_at": "2016-06-14T15:02:04.418Z", @@ -364,8 +362,6 @@ "id": 487, "target_type": "Milestone", "target_id": 1, - "title": null, - "data": null, "project_id": 46, "created_at": "2016-06-14T15:02:04.418Z", "updated_at": "2016-06-14T15:02:04.418Z", @@ -2311,8 +2307,6 @@ "id": 487, "target_type": "Milestone", "target_id": 1, - "title": null, - "data": null, "project_id": 46, "created_at": "2016-06-14T15:02:04.418Z", "updated_at": "2016-06-14T15:02:04.418Z", @@ -2336,8 +2330,6 @@ "id": 240, "target_type": "Milestone", "target_id": 20, - "title": null, - "data": null, "project_id": 36, "created_at": "2016-06-14T15:02:04.593Z", "updated_at": "2016-06-14T15:02:04.593Z", @@ -2348,8 +2340,6 @@ "id": 60, "target_type": "Milestone", "target_id": 20, - "title": null, - "data": null, "project_id": 5, "created_at": "2016-06-14T15:02:04.593Z", "updated_at": "2016-06-14T15:02:04.593Z", @@ -2373,8 +2363,6 @@ "id": 241, "target_type": "Milestone", "target_id": 19, - "title": null, - "data": null, "project_id": 36, "created_at": "2016-06-14T15:02:04.585Z", "updated_at": "2016-06-14T15:02:04.585Z", @@ -2385,41 +2373,6 @@ "id": 59, "target_type": "Milestone", "target_id": 19, - "title": null, - "data": { - "object_kind": "push", - "before": "0000000000000000000000000000000000000000", - "after": "de990aa15829d0ab182ad5a55b4c527846c0d39c", - "ref": "refs/heads/removable-group-owner", - "checkout_sha": "de990aa15829d0ab182ad5a55b4c527846c0d39c", - "message": null, - "user_id": 273486, - "user_name": "James Lopez", - "user_email": "james@jameslopez.es", - "project_id": 562317, - "repository": { - "name": "GitLab Community Edition", - "url": "git@gitlab.com:james11/gitlab-ce.git", - "description": "Version Control on your Server. See http://gitlab.org/gitlab-ce/ and the README for more information", - "homepage": "https://gitlab.com/james11/gitlab-ce", - "git_http_url": "https://gitlab.com/james11/gitlab-ce.git", - "git_ssh_url": "git@gitlab.com:james11/gitlab-ce.git", - "visibility_level": 20 - }, - "commits": [ - { - "id": "de990aa15829d0ab182ad5a55b4c527846c0d39c", - "message": "fixed last group owner issue and added test\\n", - "timestamp": "2015-10-29T16:10:27+00:00", - "url": "https://gitlab.com/james11/gitlab-ce/commit/de990aa15829d0ab182ad5a55b4c527846c0d39c", - "author": { - "name": "James Lopez", - "email": "james.lopez@vodafone.com" - } - } - ], - "total_commits_count": 1 - }, "project_id": 5, "created_at": "2016-06-14T15:02:04.585Z", "updated_at": "2016-06-14T15:02:04.585Z", @@ -2947,8 +2900,6 @@ "id": 221, "target_type": "MergeRequest", "target_id": 27, - "title": null, - "data": null, "project_id": 36, "created_at": "2016-06-14T15:02:36.703Z", "updated_at": "2016-06-14T15:02:36.703Z", @@ -2959,8 +2910,6 @@ "id": 187, "target_type": "MergeRequest", "target_id": 27, - "title": null, - "data": null, "project_id": 5, "created_at": "2016-06-14T15:02:36.703Z", "updated_at": "2016-06-14T15:02:36.703Z", @@ -3230,8 +3179,6 @@ "id": 222, "target_type": "MergeRequest", "target_id": 26, - "title": null, - "data": null, "project_id": 36, "created_at": "2016-06-14T15:02:36.496Z", "updated_at": "2016-06-14T15:02:36.496Z", @@ -3242,8 +3189,6 @@ "id": 186, "target_type": "MergeRequest", "target_id": 26, - "title": null, - "data": null, "project_id": 5, "created_at": "2016-06-14T15:02:36.496Z", "updated_at": "2016-06-14T15:02:36.496Z", @@ -3513,8 +3458,6 @@ "id": 223, "target_type": "MergeRequest", "target_id": 15, - "title": null, - "data": null, "project_id": 36, "created_at": "2016-06-14T15:02:25.262Z", "updated_at": "2016-06-14T15:02:25.262Z", @@ -3525,8 +3468,6 @@ "id": 175, "target_type": "MergeRequest", "target_id": 15, - "title": null, - "data": null, "project_id": 5, "created_at": "2016-06-14T15:02:25.262Z", "updated_at": "2016-06-14T15:02:25.262Z", @@ -4202,8 +4143,6 @@ "id": 224, "target_type": "MergeRequest", "target_id": 14, - "title": null, - "data": null, "project_id": 36, "created_at": "2016-06-14T15:02:25.113Z", "updated_at": "2016-06-14T15:02:25.113Z", @@ -4214,8 +4153,6 @@ "id": 174, "target_type": "MergeRequest", "target_id": 14, - "title": null, - "data": null, "project_id": 5, "created_at": "2016-06-14T15:02:25.113Z", "updated_at": "2016-06-14T15:02:25.113Z", @@ -4274,9 +4211,7 @@ { "id": 529, "target_type": "Note", - "target_id": 2521, - "title": "test levels", - "data": null, + "target_id": 793, "project_id": 4, "created_at": "2016-07-07T14:35:12.128Z", "updated_at": "2016-07-07T14:35:12.128Z", @@ -4749,8 +4684,6 @@ "id": 225, "target_type": "MergeRequest", "target_id": 13, - "title": null, - "data": null, "project_id": 36, "created_at": "2016-06-14T15:02:24.636Z", "updated_at": "2016-06-14T15:02:24.636Z", @@ -4761,8 +4694,6 @@ "id": 173, "target_type": "MergeRequest", "target_id": 13, - "title": null, - "data": null, "project_id": 5, "created_at": "2016-06-14T15:02:24.636Z", "updated_at": "2016-06-14T15:02:24.636Z", @@ -5247,8 +5178,6 @@ "id": 226, "target_type": "MergeRequest", "target_id": 12, - "title": null, - "data": null, "project_id": 36, "created_at": "2016-06-14T15:02:24.253Z", "updated_at": "2016-06-14T15:02:24.253Z", @@ -5259,8 +5188,6 @@ "id": 172, "target_type": "MergeRequest", "target_id": 12, - "title": null, - "data": null, "project_id": 5, "created_at": "2016-06-14T15:02:24.253Z", "updated_at": "2016-06-14T15:02:24.253Z", @@ -5506,8 +5433,6 @@ "id": 227, "target_type": "MergeRequest", "target_id": 11, - "title": null, - "data": null, "project_id": 36, "created_at": "2016-06-14T15:02:23.865Z", "updated_at": "2016-06-14T15:02:23.865Z", @@ -5518,8 +5443,6 @@ "id": 171, "target_type": "MergeRequest", "target_id": 11, - "title": null, - "data": null, "project_id": 5, "created_at": "2016-06-14T15:02:23.865Z", "updated_at": "2016-06-14T15:02:23.865Z", @@ -6195,8 +6118,6 @@ "id": 228, "target_type": "MergeRequest", "target_id": 10, - "title": null, - "data": null, "project_id": 36, "created_at": "2016-06-14T15:02:23.660Z", "updated_at": "2016-06-14T15:02:23.660Z", @@ -6207,8 +6128,6 @@ "id": 170, "target_type": "MergeRequest", "target_id": 10, - "title": null, - "data": null, "project_id": 5, "created_at": "2016-06-14T15:02:23.660Z", "updated_at": "2016-06-14T15:02:23.660Z", @@ -6478,8 +6397,6 @@ "id": 229, "target_type": "MergeRequest", "target_id": 9, - "title": null, - "data": null, "project_id": 36, "created_at": "2016-06-14T15:02:22.927Z", "updated_at": "2016-06-14T15:02:22.927Z", @@ -6490,8 +6407,6 @@ "id": 169, "target_type": "MergeRequest", "target_id": 9, - "title": null, - "data": null, "project_id": 5, "created_at": "2016-06-14T15:02:22.927Z", "updated_at": "2016-06-14T15:02:22.927Z", diff --git a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb index 5b16fc5d084..85221dced7f 100644 --- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb @@ -57,10 +57,6 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do expect(Ci::Pipeline.where(ref: nil)).not_to be_empty end - it 'restores the correct event with symbolised data' do - expect(Event.where.not(data: nil).first.data[:ref]).not_to be_empty - end - it 'preserves updated_at on issues' do issue = Issue.where(description: 'Aliquam enim illo et possimus.').first @@ -80,7 +76,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do end context 'event at forth level of the tree' do - let(:event) { Event.where(title: 'test levels').first } + let(:event) { Event.where(action: 6).first } it 'restores the event' do expect(event).not_to be_nil diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml index b852ac570a3..b94bbc7502d 100644 --- a/spec/lib/gitlab/import_export/safe_model_attributes.yml +++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml @@ -29,8 +29,6 @@ Event: - id - target_type - target_id -- title -- data - project_id - created_at - updated_at |