|
1 | | -# Java_DiffChecker [](https://github.com/pjkaufman/Java_DiffChecker) [](https://github.com/pjkaufman/Java_DiffChecker/issues) [](https://github.com/pjkaufman/Java_DiffChecker/blob/master/LICENSE) |
| 1 | +# Database Difference Checker - Database Updater [](https://github.com/pjkaufman/Java_DiffChecker/issues) [](https://github.com/pjkaufman/Java_DiffChecker/blob/master/LICENSE) |
2 | 2 | ###### By Peter Kaufman |
3 | 3 |
|
4 | 4 | ## Description |
5 | 5 |
|
6 | | -Java_DiffChecker is a Java program compares MySQL databases and generates the SQL statements that are needed to make the two databases the same. The SQL statements can then be run or just copied to review later. |
7 | | - |
8 | | -## Table of Contents |
9 | | - |
10 | | -- [Installation](https://github.com/pjkaufman/Java_DiffChecker#installation) |
11 | | -- [Usage](https://github.com/pjkaufman/Java_DiffChecker#usage) |
12 | | -- [Documentation](https://github.com/pjkaufman/Java_DiffChecker#documentation) |
13 | | -- [License](https://github.com/pjkaufman/Java_DiffChecker#license) |
14 | | - |
15 | | -## Installation |
| 6 | + Compares MySQL databases and generates the SQL statements that are needed to make the two databases the same. The SQL statements can then be run or just copied to review or run later. |
| 7 | + |
| 8 | +<h2 id="table_of_contents">Table of Contents<h2> |
| 9 | + |
| 10 | +<ul> |
| 11 | + <li> |
| 12 | + <a href="#installation">Installation</a> |
| 13 | + </li> |
| 14 | + <li> |
| 15 | + <a href="#features">Features</a> |
| 16 | + </li> |
| 17 | + <li> |
| 18 | + <a href="#usage">Usage</a> |
| 19 | + </li> |
| 20 | + <li> |
| 21 | + <a href="#documentation">Documentation</a> |
| 22 | + </li> |
| 23 | + <li> |
| 24 | + <a href="#license">License</a> |
| 25 | + </li> |
| 26 | +</ul> |
| 27 | + |
| 28 | +<h2 id="installation"> Installation </h2> |
16 | 29 |
|
17 | 30 | ### Dependencies |
18 | 31 |
|
19 | | -1. [Java](https://java.com/en/download/) |
20 | | -2. [Python 2.7](https://www.python.org/downloads/) |
21 | | -3. Some kind of hosting service hosting your MySQL databse such as [WAMP](http://wampserver.aviatechno.net/). |
| 32 | +<ol> |
| 33 | + <li> |
| 34 | + <a href="https://java.com/en/download/">Java</a> |
| 35 | + </li> |
| 36 | + <li> |
| 37 | + <a href="https://www.python.org/downloads/">Python 2.7</a> |
| 38 | + </li> |
| 39 | + <li> |
| 40 | + Some kind of hosting service for MySQL such as <a href="http://wampserver.aviatechno.net/">WAMP</a> |
| 41 | + </li> |
| 42 | +</ol> |
22 | 43 |
|
23 | 44 | _Note: the python scripts have only been tested in Python 2.7_ |
24 | 45 |
|
25 | 46 | Clone this repo by running `git clone https://github.com/pjkaufman/Java_DiffChecker.git`. |
26 | 47 |
|
27 | 48 | Make sure that Python and the jre paths have been added to your PATH variable. |
28 | 49 |
|
29 | | -## Usage |
30 | | - |
31 | | -Go to the python folder and run `python routines.py`. |
32 | | - |
33 | | -There will be several options which include 'run' and 'debug'. |
| 50 | +<a href="#table_of_contents">Back to Table of Contents</a> |
| 51 | + |
| 52 | +<h2 id="features">Features</h2> |
| 53 | + |
| 54 | +<ol> |
| 55 | + <li> |
| 56 | + Two Connection Database Comparison |
| 57 | + <p>This type of database comparison connects to two databases and compares them yeilding the SQL statements to make them the same.</p> |
| 58 | + <p>When this option is selected in the application it will take you to the following screen: |
| 59 | + <center> |
| 60 | + <img src="UserGuides\images\twoDBComparison.png" alt="Two Database Comparison Screen" height = "300"/> |
| 61 | + </center> |
| 62 | + Fill out each of the needed fields and click Compare. <br> |
| 63 | + <i>Note: the default port for MYSQL is 3306 and that the development database information goes on the LEFT and the live database information goes on the RIGHT</i> |
| 64 | + </p> |
| 65 | + </li> |
| 66 | + <li> |
| 67 | + One Connection Database Comparison |
| 68 | + <p>This type of database comparison connects to one database and uses a serialized file to compare them yeilding the SQL statements to make them the same.</p> |
| 69 | + <p>When this option is selected in the application it will take you to the following screen: |
| 70 | + <center> |
| 71 | + <img src="UserGuides\images\oneDBComparison.png" alt="One Database Comparison Screen" height = "300"/> |
| 72 | + </center> |
| 73 | + Fill out each of the needed fields and click Compare. <br> |
| 74 | + <i>Note: the default port for MYSQL is 3306 and that the development database is the serialized database</i> |
| 75 | + </p> |
| 76 | + </li> |
| 77 | + <li> |
| 78 | + Database Snapshot |
| 79 | + <p>A database snapshot is where a "copy" of the schema structure for the database is written to a serialized file for later use. It stores information such as tables, indexes, views, columns, and other pertinent data for database comparisons.</p> |
| 80 | + <p>When this option is selected in the application it will take you to the following screen: |
| 81 | + <center> |
| 82 | + <img src="UserGuides\images\takeDBSnapshot.png" alt="Database Snapshot Screen" height = "300"/> |
| 83 | + </center> |
| 84 | + Fill out each of the needed fields and click Snapshot. <br> |
| 85 | + <i>Note: the default port for MYSQL is 3306, and this option is for the development database</i> |
| 86 | + </p> |
| 87 | + </li> |
| 88 | + <li> |
| 89 | + Review Last Set of SQL Statements |
| 90 | + <p>This option allows the user to see the last set of SQL statements that were run.</p> |
| 91 | + <p>After selecting this option, you will see something similar to this: |
| 92 | + <center> |
| 93 | + <img src="UserGuides\images\lastSQLSet.png" alt="Last Set of SQL Statments Generated" height = "300"/> |
| 94 | + </center> |
| 95 | + </p> |
| 96 | + </li> |
| 97 | + <li> |
| 98 | + Review Logs |
| 99 | + <p>The review logs contain information such as stack traces for errors that have occured or how long a database comparison or SQL run took.</p> |
| 100 | + <p>After selecting this option, you will see something similar to this: |
| 101 | + <center> |
| 102 | + <img src="UserGuides\images\runLog.png" alt="Run Logs" height = "300"/> |
| 103 | + </center> |
| 104 | + </p> |
| 105 | + </li> |
| 106 | +</ol> |
| 107 | + |
| 108 | +<a href="#table_of_contents">Back to Table of Contents</a> |
| 109 | + |
| 110 | +<h2 id="usage">Usage</h2> |
| 111 | + |
| 112 | +Go to the python folder and run |
| 113 | + |
| 114 | +``` |
| 115 | +python routines.py |
| 116 | +``` |
| 117 | + |
| 118 | +You should see |
| 119 | + |
| 120 | +``` |
| 121 | +Routine Options |
| 122 | +run - makes and runs the JAR file |
| 123 | +push - commits the current repo and pushes it |
| 124 | +debug - runs the current code base for testing |
| 125 | +clean - deletes the test and builds directories |
| 126 | +Enter desired option: |
| 127 | +``` |
34 | 128 |
|
35 | 129 | ### Running |
36 | 130 |
|
37 | | -You can go to the python folder and run `python routines.py`. |
| 131 | +When prompted by the script for a routine to run, type 'run'. |
38 | 132 |
|
39 | | -When prompted by the script for a routine to run type 'run'. |
| 133 | +If there are no errors you will see the following GUI: |
40 | 134 |
|
41 | | -Watch the output. If there is an error check to see what the error was. Otherwise the jar file that was created in the build folder will be executed. |
| 135 | +<center> |
| 136 | + <img src="UserGuides\images\runResult.png" alt="Database Difference Checker Home" height = "300"/> |
| 137 | +</center> |
42 | 138 |
|
43 | 139 | ### Testing |
44 | 140 |
|
45 | | -After modifying any of the Java files in the repository, you can go to the python folder and run `python routines.py`. |
| 141 | +After modifying any of the Java files in the repository, you can go to the python folder and run |
46 | 142 |
|
47 | | -Enter 'debug' when prompted for a routine to run. This will compile all of the current Java files into the test/db_diff_checker_gui2 folder where it will be run if no errors occur. |
| 143 | +``` |
| 144 | +python routines.py |
| 145 | +``` |
48 | 146 |
|
49 | | -## Documentation |
| 147 | +When prompted for the routine to run, enter 'debug'. This will compile all of the current Java files into the test/db_diff_checker_gui folder where it will be run if no errors occur (no JAR file will be created). |
| 148 | + |
| 149 | +<a href="#table_of_contents">Back to Table of Contents</a> |
| 150 | + |
| 151 | +<h2 id="documentation">Documentation</h2> |
50 | 152 |
|
51 | 153 | ### How It Works |
52 | 154 |
|
53 | | -- [V1.0.0](https://github.com/pjkaufman/Java_DiffChecker/tree/master/pdf/DatabaseDifferenceCheckerReport.pdf) |
54 | | -- [V2.0.0](https://github.com/pjkaufman/Java_DiffChecker/tree/master/pdf/DatabaseDifferenceCheckerReportV2.0.0.pdf) |
55 | | -- [V2.0.1](https://github.com/pjkaufman/Java_DiffChecker/tree/master/pdf/DatabaseDifferenceCheckerReportV2.0.1.pdf) |
| 155 | +<ol> |
| 156 | + <li> |
| 157 | + <a href="UserGuides/pdf/DatabaseDifferenceCheckerReport.pdf">V1.0.0</a> |
| 158 | + </li> |
| 159 | + <li> |
| 160 | + <a href="UserGuides/pdf/DatabaseDifferenceCheckerReportV2.0.0.pdf">V2.0.0</a> |
| 161 | + </li> |
| 162 | + <li> |
| 163 | + <a href="UserGuides/pdf/DatabaseDifferenceCheckerReportV2.0.1.pdf">V2.0.1</a> |
| 164 | + </li> |
| 165 | +</ol> |
56 | 166 |
|
57 | | -### Java Documentation |
| 167 | +### Java Documentation/API |
58 | 168 |
|
59 | 169 | Java documentation can be found [here](https://pjkaufman.github.io/Java_DiffChecker/). |
60 | 170 |
|
61 | | -## License |
| 171 | +<a href="#table_of_contents">Back to Table of Contents</a> |
| 172 | + |
| 173 | +<h2 id="license">License</h2> |
| 174 | + |
| 175 | +<a href="LICENSE">MIT</a> |
62 | 176 |
|
63 | | -[MIT](https://github.com/pjkaufman/Java_DiffChecker/blob/master/LICENSE) |
| 177 | +<a href="#table_of_contents">Back to Table of Contents</a> |
0 commit comments