-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4aec9c7
commit aeaacd1
Showing
3 changed files
with
117 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[[Tables]] | ||
Name = "users" | ||
[Tables.Anonymise] | ||
email = "EmailAddress" | ||
firstName = "FirstName" | ||
password = "SimplePassword" | ||
[Tables.Filter] | ||
# import the last 100 active created users | ||
Match = "users.active = true" | ||
Limit = 100 | ||
[Tables.Filter.Sorts] | ||
created_at = "desc" | ||
|
||
[[Tables]] | ||
# Dump only orders which are related to the matching users | ||
Name = "orders" | ||
PrimaryKey = "id" | ||
# Behind the scenes it will generate the following sql query: | ||
# SELECT orders.* FROM orders | ||
# JOIN users ON users.id = orders.user_id | ||
# WHERE users.status = 'active' | ||
# GROUP BY order_items.id | ||
[[Tables.Relationships]] | ||
Table = "orders" | ||
ForeignKey = "user_id" | ||
ReferencedTable = "users" | ||
ReferencedKey = "id" | ||
[Tables.Filter] | ||
Match = "users.active = true" | ||
Limit = 100 | ||
[Tables.Filter.Sorts] | ||
created_at = "desc" | ||
|
||
[[Tables]] | ||
# Dump only order items which are related to the matching users orders | ||
Name = "order_items" | ||
PrimaryKey = "id" | ||
# Behind the scenes it will generate the following sql query: | ||
# SELECT order_items.* FROM order_items | ||
# JOIN orders ON orders.id = order_items.order_id | ||
# JOIN users ON users.id = orders.user_id | ||
# WHERE users.status = 'active' | ||
# GROUP BY order_items.id | ||
[[Tables.Relationships]] | ||
Table = "order_items" | ||
ForeignKey = "order_id" | ||
ReferencedTable = "orders" | ||
ReferencedKey = "id" | ||
[[Tables.Relationships]] | ||
Table = "orders" | ||
ForeignKey = "user_id" | ||
ReferencedTable = "users" | ||
ReferencedKey = "id" | ||
[Tables.Filter] | ||
Match = "users.active = true" | ||
Limit = 100 | ||
[Tables.Filter.Sorts] | ||
created_at = "desc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[[Tables]] | ||
# Dump the database structure without importing data | ||
Name = "user_history" | ||
IgnoreData = true | ||
|
||
[[Tables]] | ||
Name = "users" | ||
[Tables.Anonymise] | ||
email = "EmailAddress" | ||
username = "FirstName" | ||
password = "SimplePassword" | ||
[Tables.Filter] | ||
# import the last 100 created users | ||
Limit = 100 | ||
[Tables.Filter.Sorts] | ||
created_at = "desc" |