diff --git a/sql-old.py b/sql-new.py
index b58d89f..a176277 100644
|
old
|
new
|
def _split_statements(content):
|
| 155 | 155 | comment_re = re.compile(r"^((?:'[^']*'|[^'])*?)--.*$") |
| 156 | 156 | statements = [] |
| 157 | 157 | statement = [] |
| | 158 | infunction = False |
| 158 | 159 | for line in content.split("\n"): |
| 159 | 160 | cleaned_line = comment_re.sub(r"\1", line).strip() |
| | 161 | |
| 160 | 162 | if not cleaned_line: |
| 161 | 163 | continue |
| 162 | 164 | statement.append(cleaned_line) |
| 163 | | if cleaned_line.endswith(";"): |
| | 165 | if cleaned_line.startswith("CREATE"): |
| | 166 | infunction=True |
| | 167 | if "LANGUAGE" in cleaned_line: |
| | 168 | infunction=False |
| | 169 | if cleaned_line.endswith(";") and not infunction: |
| 164 | 170 | statements.append(" ".join(statement)) |
| 165 | 171 | statement = [] |
| 166 | 172 | return statements |
| … |
… |
def emit_post_sync_signal(created_models, verbosity, interactive, db):
|
| 214 | 220 | models.signals.post_syncdb.send(sender=app, app=app, |
| 215 | 221 | created_models=created_models, verbosity=verbosity, |
| 216 | 222 | interactive=interactive, db=db) |
| | 223 | |