Last active
March 14, 2016 12:41
-
-
Save pcote/2fe2178765fddef9e067 to your computer and use it in GitHub Desktop.
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
| # set up the connection to an account that has delete permissions. | |
| root_pw = parser["myapplication"]["root_password"] | |
| ct_string = "mysql+pymysql://root:{}@localhost/mydatabase".format(root_pw) | |
| eng = create_engine(ct_string) | |
| conn = eng.connect() | |
| # clear the learning resources | |
| query_string = """delete from resources where id in ( | |
| select resource_id from resource_deletions)""" | |
| conn.execute(query_string) | |
| # clear the deletion queue for resources | |
| query_string = "delete from resource_deletions" | |
| conn.execute(query_string) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment