Skip to content

Commit

Permalink
Merge branch 'master' into nkelly-gh-47
Browse files Browse the repository at this point in the history
  • Loading branch information
nickatnight authored Oct 26, 2024
2 parents 9f7b9bc + fee79f7 commit 15749a2
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cookiecutter-fastapi-backend"
version = "0.4.0"
version = "0.4.1"
description = "Cookiecutter template to build and deploy fastapi backends..batteries included"
authors = ["nickatnight <nickkelly.858@gmail.com>"]
readme = "README.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
- name: Clean-up
if: always()
run: |
docker-compose -f ops/docker-compose.test.yml down -v
docker compose -f ops/docker-compose.test.yml down -v
20 changes: 20 additions & 0 deletions {{ cookiecutter.project_slug }}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,27 @@

## Backend local development, additional details

Initialize first migration (project must be up with docker compose up and contain no 'version' files)
```shell
$ make alembic-init
```

Create new migration file
```shell
$ docker compose exec {{ cookiecutter.backend_container_name }} alembic revision --autogenerate -m "some cool comment"
```

Apply migrations
```shell
$ make alembic-migrate
```

### Migrations
Every migration after that, you can create new migrations and apply them with
```console
$ make alembic-make-migrations "cool comment dude"
$ make alembic-migrate
```

### General workflow
See the [Makefile](/Makefile) to view available commands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ lint.ignore = [
ignore-words-list = 'selectin,'

[tool.coverage.report]
fail_under = 55
fail_under = 20

[tool.coverage.run]
omit = ['*tests/*']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

def create_init_data() -> None:
with SessionLocal() as session:
# Add initial data here eg session.add(Model(field=value))
session.add()
session.add()

Expand Down

0 comments on commit 15749a2

Please sign in to comment.