diff --git a/README.md b/README.md index 260d389..9fc0c2d 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,13 @@ Or check out some examples: ## Django -Create a migration to enable the extension +Create an empty migration file + +```python +python manage.py makemigrations --name enable_pgvector --empty +``` + +Add a migration in that file to enable the extension ```python from pgvector.django import VectorExtension @@ -57,7 +63,14 @@ class Migration(migrations.Migration): ] ``` -Add a vector field to your model +Migrate + +```sh +python3 manage.py makemigrations +python3 manage.py migrate +``` + +Add a vector field in the models.py ```python from pgvector.django import VectorField @@ -68,6 +81,13 @@ class Item(models.Model): Also supports `HalfVectorField`, `BitField`, and `SparseVectorField` +Migrate + +```sh +python3 manage.py makemigrations +python3 manage.py migrate +``` + Insert a vector ```python