Skip to content

Commit c72f086

Browse files
ftsartekJordan Russell
andauthored
chore: update python migration template format to use triple quotes for (#356)
multiline statement The Python default migration template uses double quotes for the upgrade statement, which is multiline and therefore invalid syntax. This replaces the start and end quotes with triple quotes instead. Co-authored-by: Jordan Russell <jordan.russell@sitehost.co.nz>
1 parent d0c147c commit c72f086

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sqlspec/migrations/templates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,12 @@ def _normalize_newlines(lines: "list[str]") -> "list[str]":
221221
body=(
222222
"def up(context: object | None = None) -> str | Iterable[str]:\n"
223223
' """Apply the migration (upgrade)."""\n'
224-
' return "\n'
224+
' return """\n'
225225
" CREATE TABLE example (\n"
226226
" id INTEGER PRIMARY KEY,\n"
227227
" name TEXT NOT NULL\n"
228228
" );\n"
229-
' "\n\n'
229+
' """\n\n'
230230
"def down(context: object | None = None) -> str | Iterable[str]:\n"
231231
' """Reverse the migration."""\n'
232232
' return "DROP TABLE example;"'

0 commit comments

Comments
 (0)