-
Notifications
You must be signed in to change notification settings - Fork 348
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
feat(persistence): migrations support #2748
Conversation
refactor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice!
sa.Column("id", sa.Integer, primary_key=True), | ||
sa.Column("name", sa.String, nullable=False), | ||
sa.Column("description", sa.String, nullable=True), | ||
# TODO(mikeldking): is timezone=True necessary? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, it doesn't work with sqlite, because it just stores it as strings. I end up having to call isofomat()
manually. Maybe this is useful for other vendors. Ultimately, having a timezone-aware python datetime
should be the expectation.
src/phoenix/db/models.py
Outdated
@@ -51,6 +54,7 @@ class Trace(Base): | |||
project_rowid: Mapped[int] = mapped_column(ForeignKey("projects.id")) | |||
session_id: Mapped[Optional[str]] | |||
trace_id: Mapped[str] | |||
# TODO(mikeldking): why is the start and end time necessary? just filtering? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because there are moments in time where we can have multiple "root" spans (because the ultimate root has not arrived).
Co-authored-by: Roger Yang <80478925+RogerHYang@users.noreply.github.com>
Co-authored-by: Roger Yang <80478925+RogerHYang@users.noreply.github.com>
resolves #2742
This adds runtime migration support via alembic.
NB: Migrations DO NOT work on in memory sqlite so Base.metadata.create_all() is necessary.
Of note that this PR adds naming convention rules as well.