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
eb586c7f
Commit
eb586c7f
authored
Jun 21, 2018
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove mapping keys for join tables
parent
fbfb7138
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
lib/pseudonymizer/dumper.rb
lib/pseudonymizer/dumper.rb
+9
-5
No files found.
lib/pseudonymizer/dumper.rb
View file @
eb586c7f
...
...
@@ -21,12 +21,12 @@ module Pseudonymizer
tables
=
config
[
:tables
]
FileUtils
.
mkdir_p
(
output_dir
)
unless
File
.
directory?
(
output_dir
)
schema_to_yml
@output_files
=
tables
.
map
do
|
k
,
v
|
table_to_csv
(
k
,
v
[
:whitelist
],
v
[
:pseudo
])
end
.
compact
schema_to_yml
file_list_to_json
@output_files
end
...
...
@@ -96,12 +96,16 @@ module Pseudonymizer
end
def
set_schema_column_types
(
table
,
type_results
)
has_id
=
type_results
.
any?
{
|
c
|
c
[
:name
]
==
"id"
}
type_results
.
each
do
|
type_result
|
@schema
[
table
][
type_result
[
:name
]]
=
type_result
[
:data_type
]
@schema
[
table
.
to_s
][
type_result
[
:name
]]
=
type_result
[
:data_type
]
end
# hard coded because all mapping keys in GL are id
@schema
[
table
][
"gl_mapping_key"
]
=
"id"
if
has_id
# if there is an ID, it is the mapping_key
@schema
[
table
.
to_s
][
"gl_mapping_key"
]
=
"id"
end
end
def
write_to_csv_file
(
table
,
contents
)
...
...
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