Skip to content

Commit 468e342

Browse files
authored
chore: add doc string for init file (#142)
This PR adds a doc string to the `__init__.py` file created for the migrations dir
1 parent 4c4c75b commit 468e342

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

sqlspec/migrations/base.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,15 @@ def _get_init_readme_content(self) -> str:
603603
out-of-order migrations gracefully (e.g., from late-merging branches).
604604
"""
605605

606+
def _get_init_init_content(self) -> str:
607+
"""Get __init__.py content for migration directory initialization.
608+
609+
Returns:
610+
Python module docstring content for the __init__.py file.
611+
"""
612+
return """Migrations.
613+
"""
614+
606615
def init_directory(self, directory: str, package: bool = True) -> None:
607616
"""Initialize migration directory structure.
608617
@@ -618,7 +627,8 @@ def init_directory(self, directory: str, package: bool = True) -> None:
618627
migrations_dir.mkdir(parents=True, exist_ok=True)
619628

620629
if package:
621-
(migrations_dir / "__init__.py").touch()
630+
init = migrations_dir / "__init__.py"
631+
init.write_text(self._get_init_init_content())
622632

623633
readme = migrations_dir / "README.md"
624634
readme.write_text(self._get_init_readme_content())

0 commit comments

Comments
 (0)