Skip to content

Commit

Permalink
Fix masking commands (#5071)
Browse files Browse the repository at this point in the history
* Added check for unique indexes

* Added procedure to make up what the unique indexes are build with
Added check if excluded column is in a unique index

* Added table

* Added extra options for data generation

* Removed unused rowcount
Added unique value dictionary creation

* Added format for masking types

* Added support for using formatting of values

* Added check if any masking info is present

* Implemented unique index support

* Renamed variable

* Revert "Renamed variable"

This reverts commit 3f7adb8.

* Renamed variable and applied formatiing

* Fixed errors in unique value generation

* Added variable for the unique value columns
Changed the if statement for the unique columns

* Explicitly reset the new value variable

* Moved variables to make sure they get cleared in the loop

* Removed date selection
Added section for finance. Can be used for other types that support max

* Revert "Removed date selection"

This reverts commit 6ec4f16.

* Added section for support of max

* Added part for finance

* Removed finance from other section

* Changed if statement to switch

* Changed switch back to if statement
Removed sections
Added finance to other section

* Removed section for finance

* Added checks for supported data types, masking types and sub types

* Moved retrieval of method and properties to begin
Changed if statements for types

* Changed message of unsupported types

* Added new known types
Added format key to known types

* Added extra known types

* Implemented support for text and ntext data types

* Added ntext and text data types

* Added decimal data type

* Moved data retrieval down

* Added types and synonyms
Rearranged the types to be in alphabetical order

* Added types

* Added types to automatically assign the right maskingtype

* Improved the check for supported data types

* Fixed bug missing curly bracket

* Moved the retrieval of the data
Implemented selective columns for data retrieval

* Changed back to SELECT * instead of selective columns

* Changed the SELECT * to be selective columns from table and not object

* Moved data retrieval
Changed where statement build-up

* Removed debug query outputs

* Moved where build-up

* Added special conversion to date and datetime columns

* Fixed bug with missing comma

* Added error record

* Removed unneccesary if statement
Fixed bug with TEXT and NTEXT cast in WHERE clause

* Implemented handling of temporal  values generation
Formatted code

* Fixed bool handling

* Added decimal type

* Added fax synonyms

* Fixed bool handling

* Updates test should statement

* Changed back the should statement

* Enabled rdp

* Changed rdp password

* Formatted test

* Reset appveyor.yml to original settings

* Changed instance

* Changed instance

* Changed instance back

* Added credential

* 0.9.773

* change instance

* Make Backup-DbaDatabase use Database and ExcludeDatabase when piping (#5069)

* fixes #5044

* fix one test

* in instead of contains

* 0.9.773 changelog (#5118)

* Pass Login values to Copy-DbaLogin (#5120)

Call to `Copy-DbaLogin` simply didn't pass the values.

Fixes #5119

* Updated test to use other instance

* Enabled RDP

* Set RDP to be started before tests

* Removed RDP option again

* Added fix for datetime

* Formatted code

* Added extra check for temporal tables

* Changed test back to 2008 instance
  • Loading branch information
sanderstad authored and potatoqualitee committed Feb 26, 2019
1 parent 8264f68 commit c65acdf
Show file tree
Hide file tree
Showing 6 changed files with 509 additions and 86 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ shallow_clone: true
environment:
environment: development
version: 0.9.$(appveyor_build_number)
#appveyor_rdp_password: 2odCuiKmYiem
appveyor_rdp_password: 2odCuiKmYiem
azurepasswd:
secure: ZnF3fWSDfHraMCWlHaekvWrXf3sDqY5M28HMK4236PBbNSoqP29wEhsWMQioSSYGomzgIp9vuiwR8Fc9ViNLoqq0bVcErxEojBFTaPMEzOg2ZwO9OnOTiuUEc5JkoLBv6rEBBWef/DvkFfhr1r0K0xQu6OAPYHVTCRajTZbBRNfCTUM2X2o41t+cSa7681rtnJQnB/8cAfVVnPtJ+97s8w==
azurelegacypasswd:
Expand Down
117 changes: 88 additions & 29 deletions bin/datamasking/columntypes.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,54 @@
[
{
"TypeName": "Firstname",
"TypeName": "Address",
"Synonym": [
"Firstname",
"Forename"
"Address",
"Location",
"Headquarters",
"Street"
]
},
{
"TypeName": "Lastname",
"TypeName": "Bic",
"Synonym": [
"Lastname",
"Surname"
"Bic",
"BicAddress"
]
},
{
"TypeName": "Fullname",
"TypeName": "Bitcoin",
"Synonym": [
"Fullname",
"TypeName"
"Bitcoin",
"BitcoinAddress"
]
},
{
"TypeName": "Phone",
"TypeName": "Email",
"Synonym": [
"Phonenumber",
"Phone",
"Telephone",
"TelephoneNumber"
"Email",
"E-mail",
"EmailAddress"
]
},
{
"TypeName": "Address",
"TypeName": "Ethereum",
"Synonym": [
"Address",
"Location",
"Headquarters",
"Street"
"Ethereum",
"EthereumAddress"
]
},
{
"TypeName": "Zipcode",
"TypeName": "Creditcard",
"Synonym": [
"Zipcode",
"Zip",
"Postalcode"
"Creditcard",
"CreditcardNumber"
]
},
{
"TypeName": "CreditcardCVV",
"Synonym": [
"Cvv",
"CreditcardCvv"
]
},
{
Expand All @@ -53,9 +58,10 @@
]
},
{
"TypeName": "State",
"TypeName": "Company",
"Synonym": [
"State"
"Company",
"CompanyName"
]
},
{
Expand All @@ -70,6 +76,34 @@
"CountryCode"
]
},
{
"TypeName": "Firstname",
"Synonym": [
"Firstname",
"Forename"
]
},
{
"TypeName": "Fullname",
"Synonym": [
"Fullname",
"TypeName"
]
},
{
"TypeName": "Iban",
"Synonym": [
"Iban",
"IbanNumber"
]
},
{
"TypeName": "Lastname",
"Synonym": [
"Lastname",
"Surname"
]
},
{
"TypeName": "Latitude",
"Synonym": [
Expand All @@ -85,19 +119,44 @@
]
},
{
"TypeName": "Creditcard",
"TypeName": "Phone",
"Synonym": [
"Creditcard",
"CreditcardNumber"
"Fax",
"FaxNumber",
"Phonenumber",
"Phone",
"Telephone",
"TelephoneNumber"
]
},
{
"TypeName": "State",
"Synonym": [
"State"
]
},
{
"TypeName": "StateAbbr",
"Synonym": [
"StateAbbreviation",
"StateCode"
]
},
{
"TypeName": "Username",
"Synonym": [
"Login",
"LoginId",
"LoginId",
"User",
"UserId"
]
},
{
"TypeName": "Zipcode",
"Synonym": [
"Zipcode",
"Zip",
"Postalcode"
]
}
]
Loading

0 comments on commit c65acdf

Please sign in to comment.