Skip to content

Chore/postgres#77

Merged
srijanpatel merged 18 commits intomainfrom
chore/postgres
Jan 6, 2025
Merged

Chore/postgres#77
srijanpatel merged 18 commits intomainfrom
chore/postgres

Conversation

@srijanpatel
Copy link
Copy Markdown
Collaborator

@srijanpatel srijanpatel commented Jan 6, 2025

Important

Switch from SQLite to PostgreSQL, update models and configurations, and enhance Docker setup for PostgreSQL support.

  • Database Transition:
    • Switch from SQLite to PostgreSQL in .env.example, alembic.ini, and database.py.
    • Update DATABASE_URL construction in database.py to use PostgreSQL environment variables.
  • Model Changes:
    • Change workflow_version_id from int to str in workflow_run.py, run_schemas.py, and runSchemas.ts.
    • Add unique=True to id fields in models like dataset_model.py, eval_run_model.py, and others.
    • Add autoincrement="auto" to _intid fields in models like eval_run_model.py, output_file_model.py, and others.
  • Docker and Deployment:
    • Add PostgreSQL service to docker-compose.yml and docker-compose.prod.yml.
    • Update entrypoint.sh to run alembic upgrade head on startup.
  • Miscellaneous:
    • Add psycopg2-binary to requirements.txt for PostgreSQL support.
    • Remove unused alembic/.gitignore file.
    • Add generate_migrations.sh script for automating Alembic migrations.

This description was created by Ellipsis for 087f536. It will automatically update as commits are pushed.

…oving redundant checks and directly upgrading the database schema before starting the server.
@srijanpatel
Copy link
Copy Markdown
Collaborator Author

@ellipsis-dev review this

Copy link
Copy Markdown
Contributor

@ellipsis-dev ellipsis-dev Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to 0edbfd9 in 20 seconds

More details
  • Looked at 672 lines of code in 20 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. backend/app/schemas/run_schemas.py:18
  • Draft comment:
    The change from workflow_version_id: int to workflow_version_id: str aligns with the change in the database model where workflow_version_id is now a string. This ensures consistency between the database model and the API schema.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The change from workflow_version_id: int to workflow_version_id: str in the RunResponseSchema aligns with the change in the database model where workflow_version_id is now a string. This ensures consistency between the database model and the API schema.
2. frontend/src/types/api_types/runSchemas.ts:14
  • Draft comment:
    The change from workflow_version_id: number to workflow_version_id: string aligns with the change in the database model where workflow_version_id is now a string. This ensures consistency between the database model and the API schema.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The change from workflow_version_id: int to workflow_version_id: str in the RunResponse interface aligns with the change in the database model where workflow_version_id is now a string. This ensures consistency between the database model and the API schema.
3. backend/app/api/workflow_run.py:37
  • Draft comment:
    The change from workflow_version_id: int to workflow_version_id: str aligns with the change in the database model where workflow_version_id is now a string. This ensures consistency between the database model and the API schema.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The change from workflow_version_id: int to workflow_version_id: str in the create_run_model function aligns with the change in the database model where workflow_version_id is now a string. This ensures consistency between the database model and the API schema.
4. backend/app/models/run_model.py:36
  • Draft comment:
    The change from workflow_version_id: int to workflow_version_id: str aligns with the change in the database model where workflow_version_id is now a string. This ensures consistency between the database model and the API schema.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The change from workflow_version_id: int to workflow_version_id: str in the RunModel class aligns with the change in the database model where workflow_version_id is now a string. This ensures consistency between the database model and the API schema.

Workflow ID: wflow_gAJcwaie6MB47lax


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@srijanpatel srijanpatel marked this pull request as ready for review January 6, 2025 01:47
Copy link
Copy Markdown
Contributor

@ellipsis-dev ellipsis-dev Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 087f536 in 11 seconds

More details
  • Looked at 23 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. README.md:72
  • Draft comment:
    Ensure that the .env file is correctly configured with the necessary PostgreSQL environment variables before starting the services.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The README.md file has been updated to reflect the switch from SQLite to PostgreSQL. The changes are consistent with the PR description and the intent to use PostgreSQL as the default database. The instructions for setting up the database have been updated accordingly.

Workflow ID: wflow_SG7X6MycHazTw2nb


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@srijanpatel srijanpatel merged commit b4d68ad into main Jan 6, 2025
@srijanpatel srijanpatel deleted the chore/postgres branch January 7, 2025 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant