This repository was archived by the owner on Nov 30, 2025. It is now read-only.
Fix bugs when importing from git repo#41
Open
mgamlem3 wants to merge 5 commits into
Open
Conversation
Owner
|
@mgamlem3 Can you take a peek and see what's conflicting with your merge request? I'm reactivating this project after a long pause. Thanks for your great help! |
This was causing some strange errors when I was running it. Plus if there is no content to add from git, the table doesn’t need to be modified.
The first row of the csv file should be the column names and should be ignored.
Author
|
@stevejenkins it looked like some of the other changes you merged modified the same lines I did. I went ahead and resolved the conflicts while preserving my changes. |
Author
|
Also, this should close issue #40. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR:
DROP TABLEtoDELETE FROMDROP vs DELETE
This addresses issue #40. An explanation can be seen in this comment on the issue. Essentially, dropping the table is more destructive than what is needed when replacing the entries with the data from the csv files saved in git. Using the
DELETEcommand preserves references, triggers, and other important information on the table.Only modify if there is csv content
I was running into issues where the script would crash if there was no content in domainlist.csv and the script tried to import from it. Obviously, if there is no content in the file it doesn't need to be imported so I just added a check to see if there is anything in the file before attempting an import and modifying the table.
Ignore first line of csv when importing
The first line of the csv file should contain the column names from the SQL table. Skipping this line prevents errors and warnings when importing.
Add some semicolons
I was running into some strange issues with the if statements while making changes and adding these semicolons seemed to solve them.