diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index ad82733e9744..515bcffb28e4 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -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) diff --git a/lib/galaxy/model/migrations/alembic/versions_gxy/8067ed6a55e7_create_chatgxy_table.py b/lib/galaxy/model/migrations/alembic/versions_gxy/8067ed6a55e7_create_chatgxy_table.py new file mode 100644 index 000000000000..3305be910e34 --- /dev/null +++ b/lib/galaxy/model/migrations/alembic/versions_gxy/8067ed6a55e7_create_chatgxy_table.py @@ -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)