Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/server: expand databases supported to include mysql #100

Merged
merged 17 commits into from
Jul 18, 2019

Conversation

adamdecaf
Copy link
Member

@adamdecaf adamdecaf commented Jul 12, 2019

This Pull Request adds support for mysql inside of OFAC persistence.

Issue: #94

@codecov-io
Copy link

codecov-io commented Jul 12, 2019

Codecov Report

Merging #100 into master will decrease coverage by 0.09%.
The diff coverage is 60.16%.

@@            Coverage Diff            @@
##           master     #100     +/-   ##
=========================================
- Coverage   58.46%   58.37%   -0.1%     
=========================================
  Files          21       23      +2     
  Lines        2292     2448    +156     
=========================================
+ Hits         1340     1429     +89     
- Misses        808      853     +45     
- Partials      144      166     +22

Copy link
Member

@wadearnold wadearnold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That code change would have required a stack overflow post for me.

@adamdecaf
Copy link
Member Author

This worked for me. The mysql tables were populated. I added a docker-compose.yml with mysql as the default database.

$ mysql -h 127.0.0.1 -u ofac -p ofac 
Enter password: 

mysql> show tables;
+-----------------------+
| Tables_in_ofac        |
+-----------------------+
| company_name_watches  |
| company_status        |
| company_watches       |
| customer_name_watches |
| customer_status       |
| customer_watches      |
| migrations            |
| ofac_download_stats   |
| webhook_stats         |
+-----------------------+
9 rows in set (0.00 sec)

mysql> select * from migrations;
+----+----------------------------------------------+
| id | version                                      |
+----+----------------------------------------------+
|  0 | create_customer_name_watches                 |
|  1 | create_customer_status                       |
|  2 | create_customer_watches                      |
|  3 | create_company_name_watches                  |
|  4 | create_company_status                        |
|  5 | create_company_watches                       |
|  6 | create_ofac_download_stats                   |
|  7 | create_webhook_stats                         |
|  8 | add__denied_persons__to__ofac_download_stats |
+----+----------------------------------------------+
9 rows in set (0.00 sec)

mysql> select * from ofac_download_stats;
+---------------------+------+-----------+-----------+----------------+
| downloaded_at       | sdns | alt_names | addresses | denied_persons |
+---------------------+------+-----------+-----------+----------------+
| 2019-07-16 17:27:09 | 7727 |     10117 |     12149 |            560 |
+---------------------+------+-----------+-----------+----------------+
1 row in set (0.00 sec)

@adamdecaf adamdecaf merged commit 772dd0b into moov-io:master Jul 18, 2019
@adamdecaf adamdecaf deleted the support-mysql branch July 18, 2019 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants