Skip to content

Commit

Permalink
adding migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
tcollins2011 committed Oct 29, 2024
1 parent db9349b commit a8b15e8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11543,7 +11543,7 @@ class ChatGXYResponses(Base):
__tablename__ = "chatgxy_responses"

id: Mapped[int] = mapped_column(primary_key=True)
job_id: Mapped[Optional[int]] = mapped_column(ForeignKey("job.id"), index=True)
job_id: Mapped[Optional[int]] = mapped_column(ForeignKey("job.id"), nullable=True)
response: Mapped[str] = mapped_column(TEXT, nullable=True)
feedback: Mapped[int] = mapped_column(Integer, nullable=True)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"""create chatGXY table
Revision ID: 8067ed6a55e7
Revises: a99a5b52ccb8
Create Date: 2024-10-29 16:59:31.185936
"""

from sqlalchemy import (
Column,
ForeignKey,
Integer,
Text,
)

from galaxy.model.migrations.util import (
create_table,
drop_table,
)

# revision identifiers, used by Alembic.
revision = '8067ed6a55e7'
down_revision = 'a99a5b52ccb8'
branch_labels = None
depends_on = None

table_name= "chatgxy_responses"

def upgrade():
create_table(
table_name,
Column('id', Integer, primary_key=True),
Column('user_id', Integer, ForeignKey('job.id'), nullable=True),
Column('response', Text, nullable=False),
Column('feedback', Integer, nullable=True),
)


def downgrade():
drop_table(table_name)

0 comments on commit a8b15e8

Please sign in to comment.