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
9a8972f5
Commit
9a8972f5
authored
Mar 03, 2021
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove AuditEventArchived model
This removes the unused model
parent
94c5bb3f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
63 deletions
+0
-63
.rubocop_manual_todo.yml
.rubocop_manual_todo.yml
+0
-1
app/models/audit_event_archived.rb
app/models/audit_event_archived.rb
+0
-10
spec/models/audit_event_archived_spec.rb
spec/models/audit_event_archived_spec.rb
+0
-52
No files found.
.rubocop_manual_todo.yml
View file @
9a8972f5
...
...
@@ -2278,7 +2278,6 @@ Gitlab/NamespacedClass:
-
'
app/models/application_setting/term.rb'
-
'
app/models/approval.rb'
-
'
app/models/audit_event.rb'
-
'
app/models/audit_event_archived.rb'
-
'
app/models/authentication_event.rb'
-
'
app/models/award_emoji.rb'
-
'
app/models/badge.rb'
...
...
app/models/audit_event_archived.rb
deleted
100644 → 0
View file @
94c5bb3f
# frozen_string_literal: true
# This model is not intended to be used.
# It is a temporary reference to the pre-partitioned
# audit_events table.
# Please refer to https://gitlab.com/groups/gitlab-org/-/epics/3206
# for details.
class
AuditEventArchived
<
ApplicationRecord
self
.
table_name
=
'audit_events_archived'
end
spec/models/audit_event_archived_spec.rb
deleted
100644 → 0
View file @
94c5bb3f
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
AuditEventArchived
do
let
(
:source_table
)
{
AuditEvent
}
let
(
:destination_table
)
{
described_class
}
it
'has the same columns as the source table'
do
column_names_from_source_table
=
column_names
(
source_table
)
column_names_from_destination_table
=
column_names
(
destination_table
)
expect
(
column_names_from_destination_table
).
to
match_array
(
column_names_from_source_table
)
end
it
'has the same null constraints as the source table'
do
constraints_from_source_table
=
null_constraints
(
source_table
)
constraints_from_destination_table
=
null_constraints
(
destination_table
)
expect
(
constraints_from_destination_table
.
to_a
).
to
match_array
(
constraints_from_source_table
.
to_a
)
end
it
'inserts the same record as the one in the source table'
,
:aggregate_failures
do
expect
{
create
(
:audit_event
)
}.
to
change
{
destination_table
.
count
}.
by
(
1
)
event_from_source_table
=
source_table
.
connection
.
select_one
(
"SELECT * FROM
#{
source_table
.
table_name
}
ORDER BY created_at desc LIMIT 1"
)
event_from_destination_table
=
destination_table
.
connection
.
select_one
(
"SELECT * FROM
#{
destination_table
.
table_name
}
ORDER BY created_at desc LIMIT 1"
)
expect
(
event_from_destination_table
).
to
eq
(
event_from_source_table
)
end
def
column_names
(
table
)
table
.
connection
.
select_all
(
<<~
SQL
)
SELECT c.column_name
FROM information_schema.columns c
WHERE c.table_name = '
#{
table
.
table_name
}
'
SQL
end
def
null_constraints
(
table
)
table
.
connection
.
select_all
(
<<~
SQL
)
SELECT c.column_name, c.is_nullable
FROM information_schema.columns c
WHERE c.table_name = '
#{
table
.
table_name
}
'
AND c.column_name != 'created_at'
SQL
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