Skip to content

Commit

Permalink
add note about overrides in migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
xoudini committed Nov 28, 2024
1 parent 0d0d655 commit c44abc9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,28 @@ which must inherit from `postcar.Migration`.
A minimal migration file might look as follows:

```python
import typing as t
import postcar


class Migration(postcar.Migration):
@t.override
def get_forward(self) -> str:
return """
create extension pg_trgm;
"""

@t.override
def get_rollback(self) -> str:
return """
drop extension pg_trgm;
"""
```

> [!NOTE]
> It's highly recommended to use the `override` decorator,
> to catch any potential issues during type checking.
### CLI

The package comes with a minimal CLI.
Expand Down

0 comments on commit c44abc9

Please sign in to comment.