Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install and configure Alembic #23

Closed
mackcooper1408 opened this issue Sep 14, 2024 · 0 comments
Closed

Install and configure Alembic #23

mackcooper1408 opened this issue Sep 14, 2024 · 0 comments

Comments

@mackcooper1408
Copy link
Collaborator

mackcooper1408 commented Sep 14, 2024

This is blocked by #22 , so please don't start this until that's complete!

Context

This task is to make the initial installation and configuration for alembic.

We will be using Alembic to automatically track and manage database migrations (see the general Alembic docs for more info on the tool). The idea here is that we can make changes to the SQLAlchemy models - and corresponding Pydantic schemas - then use the Alembic CLI tool to automatically generate a migration file that will build out the PostgreSQL tables and fields and all the wonderful relational magic that we want.

At this point, there should be no models.py or schema.py (pydantic schemas matching the SQLAlchemy models) files yet, so this task will be to add these files just to get us going, but the content will just be dummy data that we'll delete and replace with our real models later.

Definition of Done

  1. Alembic is installed and the alembic directory and files are created and configured to work with SQLAlchemy and a local database
  2. One migration has been run and committed with a sample/dummy set of tables to confirm that the link is working correctly

Engineering Details

I found this simple guide that I think will be great for getting this up and running. At this point, we should already have the database.py file created, so you can pick the guide up at the point where we begin writing model and schema code.

  • see this guide for a reminder on generating Alembic migrations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

4 participants