Created
January 30, 2019 07:34
-
-
Save NMelis/993331ef22a3285755410083f1c4993f to your computer and use it in GitHub Desktop.
clear data base
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
def clear_data(db): | |
meta = db.metadata | |
for table in reversed(meta.sorted_tables): | |
print(table) | |
session.execute(table.delete()) | |
session.commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment