Skip to content

Commit

Permalink
DOC - Add alembic example for postgres in docker (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Karetnikov authored Oct 16, 2023
1 parent ccbb298 commit 88fbf62
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions conda-store-server/conda_store_server/alembic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
script_location = {alembic_dir}
sqlalchemy.url = {db_url}

# script_location = alembic
# sqlalchemy.url = postgresql+psycopg2://postgres:password@localhost:5432/conda-store

# template used to generate migration files
# file_template = %%(rev)s_%%(slug)s

Expand Down
6 changes: 6 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,12 @@ The procedure to modify the database is the following :
- First, modify [the ORM Model](https://github.com/conda-incubator/conda-store/blob/main/conda-store-server/conda_store_server/orm.py) according to the changes you want to make
- edit the file `conda-store-server/alembic.ini` and replace the value for entry `sqlalchemy.url` to match the connection URL of your database.

For example (when postgres was started via docker-compose):
```
script_location = alembic
sqlalchemy.url = postgresql+psycopg2://postgres:password@localhost:5432/conda-store
```

- in your command line, run the following :

```sh
Expand Down

0 comments on commit 88fbf62

Please sign in to comment.