diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 1ec69bab1c74..93f2d651f792 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -328,8 +328,11 @@ def __declare_last__(cls): cls.table = cls.__table__ -class RepresentById: - id: Mapped[int] +class HasId: + id: Mapped[int] = mapped_column(primary_key=True) + + +class RepresentById(HasId): def __repr__(self): try: @@ -503,11 +506,10 @@ def update(self): self.update_time = now() -class WorkerProcess(Base, UsesCreateAndUpdateTime): +class WorkerProcess(Base, HasId, UsesCreateAndUpdateTime): __tablename__ = "worker_process" __table_args__ = (UniqueConstraint("server_name", "hostname"),) - id: Mapped[int] = mapped_column(primary_key=True) server_name: Mapped[Optional[str]] = mapped_column(String(255), index=True) hostname: Mapped[Optional[str]] = mapped_column(String(255)) pid: Mapped[Optional[int]] @@ -785,7 +787,6 @@ class User(Base, Dictifiable, RepresentById): __tablename__ = "galaxy_user" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) email: Mapped[str] = mapped_column(TrimmedString(255), index=True, unique=True) @@ -1334,7 +1335,6 @@ def __init__(self, user, token=None): class ToolSource(Base, Dictifiable, RepresentById): __tablename__ = "tool_source" - id: Mapped[int] = mapped_column(primary_key=True) hash: Mapped[Optional[str]] = mapped_column(Unicode(255)) source: Mapped[dict] = mapped_column(JSONType) @@ -1344,7 +1344,6 @@ class ToolRequest(Base, Dictifiable, RepresentById): states: TypeAlias = ToolRequestState - id: Mapped[int] = mapped_column(primary_key=True) tool_source_id: Mapped[int] = mapped_column(ForeignKey("tool_source.id"), index=True) history_id: Mapped[Optional[int]] = mapped_column(ForeignKey("history.id"), index=True) request: Mapped[dict] = mapped_column(JSONType) @@ -1358,7 +1357,6 @@ class ToolRequest(Base, Dictifiable, RepresentById): class DynamicTool(Base, Dictifiable, RepresentById): __tablename__ = "dynamic_tool" - id: Mapped[int] = mapped_column(primary_key=True) uuid: Mapped[Optional[Union[UUID, str]]] = mapped_column(UUIDType()) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(index=True, default=now, onupdate=now, nullable=True) @@ -1395,7 +1393,6 @@ def __init__(self, plugin, metric_name, metric_value): class JobMetricText(BaseJobMetric, RepresentById): __tablename__ = "job_metric_text" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[Optional[int]] = mapped_column(ForeignKey("job.id"), index=True) plugin: Mapped[Optional[str]] = mapped_column(Unicode(255)) metric_name: Mapped[Optional[str]] = mapped_column(Unicode(255)) @@ -1405,7 +1402,6 @@ class JobMetricText(BaseJobMetric, RepresentById): class JobMetricNumeric(BaseJobMetric, RepresentById): __tablename__ = "job_metric_numeric" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[Optional[int]] = mapped_column(ForeignKey("job.id"), index=True) plugin: Mapped[Optional[str]] = mapped_column(Unicode(255)) metric_name: Mapped[Optional[str]] = mapped_column(Unicode(255)) @@ -1415,7 +1411,6 @@ class JobMetricNumeric(BaseJobMetric, RepresentById): class TaskMetricText(BaseJobMetric, RepresentById): __tablename__ = "task_metric_text" - id: Mapped[int] = mapped_column(primary_key=True) task_id: Mapped[Optional[int]] = mapped_column(ForeignKey("task.id"), index=True) plugin: Mapped[Optional[str]] = mapped_column(Unicode(255)) metric_name: Mapped[Optional[str]] = mapped_column(Unicode(255)) @@ -1425,7 +1420,6 @@ class TaskMetricText(BaseJobMetric, RepresentById): class TaskMetricNumeric(BaseJobMetric, RepresentById): __tablename__ = "task_metric_numeric" - id: Mapped[int] = mapped_column(primary_key=True) task_id: Mapped[Optional[int]] = mapped_column(ForeignKey("task.id"), index=True) plugin: Mapped[Optional[str]] = mapped_column(Unicode(255)) metric_name: Mapped[Optional[str]] = mapped_column(Unicode(255)) @@ -1446,7 +1440,6 @@ class Job(Base, JobLike, UsesCreateAndUpdateTime, Dictifiable, Serializable): __tablename__ = "job" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, index=True, nullable=True) history_id: Mapped[Optional[int]] = mapped_column(ForeignKey("history.id"), index=True) @@ -2220,7 +2213,6 @@ class Task(Base, JobLike, RepresentById): __tablename__ = "task" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) execution_time: Mapped[Optional[datetime]] update_time: Mapped[Optional[datetime]] = mapped_column(default=now, onupdate=now) @@ -2392,7 +2384,6 @@ def set_prepare_input_files_cmd(self, prepare_input_files_cmd): class JobParameter(Base, RepresentById): __tablename__ = "job_parameter" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[Optional[int]] = mapped_column(ForeignKey("job.id"), index=True) name: Mapped[Optional[str]] = mapped_column(String(255)) value: Mapped[Optional[str]] = mapped_column(TEXT) @@ -2408,7 +2399,6 @@ def copy(self): class JobToInputDatasetAssociation(Base, RepresentById): __tablename__ = "job_to_input_dataset" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[int] = mapped_column(ForeignKey("job.id"), index=True, nullable=True) dataset_id: Mapped[int] = mapped_column(ForeignKey("history_dataset_association.id"), index=True, nullable=True) dataset_version: Mapped[Optional[int]] @@ -2426,7 +2416,6 @@ def __init__(self, name, dataset): class JobToOutputDatasetAssociation(Base, RepresentById): __tablename__ = "job_to_output_dataset" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[int] = mapped_column(ForeignKey("job.id"), index=True, nullable=True) dataset_id: Mapped[int] = mapped_column(ForeignKey("history_dataset_association.id"), index=True, nullable=True) name: Mapped[str] = mapped_column(String(255), nullable=True) @@ -2448,7 +2437,6 @@ def item(self): class JobToInputDatasetCollectionAssociation(Base, RepresentById): __tablename__ = "job_to_input_dataset_collection" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[int] = mapped_column(ForeignKey("job.id"), index=True, nullable=True) dataset_collection_id: Mapped[int] = mapped_column( ForeignKey("history_dataset_collection_association.id"), index=True, nullable=True @@ -2465,7 +2453,6 @@ def __init__(self, name, dataset_collection): class JobToInputDatasetCollectionElementAssociation(Base, RepresentById): __tablename__ = "job_to_input_dataset_collection_element" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[int] = mapped_column(ForeignKey("job.id"), index=True, nullable=True) dataset_collection_element_id: Mapped[int] = mapped_column( ForeignKey("dataset_collection_element.id"), index=True, nullable=True @@ -2484,7 +2471,6 @@ def __init__(self, name, dataset_collection_element): class JobToOutputDatasetCollectionAssociation(Base, RepresentById): __tablename__ = "job_to_output_dataset_collection" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[int] = mapped_column(ForeignKey("job.id"), index=True, nullable=True) dataset_collection_id: Mapped[int] = mapped_column( ForeignKey("history_dataset_collection_association.id"), index=True, nullable=True @@ -2508,7 +2494,6 @@ def item(self): class JobToImplicitOutputDatasetCollectionAssociation(Base, RepresentById): __tablename__ = "job_to_implicit_output_dataset_collection" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[int] = mapped_column(ForeignKey("job.id"), index=True, nullable=True) dataset_collection_id: Mapped[int] = mapped_column(ForeignKey("dataset_collection.id"), index=True, nullable=True) name: Mapped[str] = mapped_column(Unicode(255), nullable=True) @@ -2523,7 +2508,6 @@ def __init__(self, name, dataset_collection): class JobToInputLibraryDatasetAssociation(Base, RepresentById): __tablename__ = "job_to_input_library_dataset" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[int] = mapped_column(ForeignKey("job.id"), index=True, nullable=True) ldda_id: Mapped[int] = mapped_column( ForeignKey("library_dataset_dataset_association.id"), index=True, nullable=True @@ -2541,7 +2525,6 @@ def __init__(self, name, dataset): class JobToOutputLibraryDatasetAssociation(Base, RepresentById): __tablename__ = "job_to_output_library_dataset" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[int] = mapped_column(ForeignKey("job.id"), index=True, nullable=True) ldda_id: Mapped[int] = mapped_column( ForeignKey("library_dataset_dataset_association.id"), index=True, nullable=True @@ -2561,7 +2544,6 @@ def __init__(self, name, dataset): class JobStateHistory(Base, RepresentById): __tablename__ = "job_state_history" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) job_id: Mapped[Optional[int]] = mapped_column(ForeignKey("job.id"), index=True) state: Mapped[Optional[str]] = mapped_column(String(64), index=True) @@ -2576,7 +2558,6 @@ def __init__(self, job): class ImplicitlyCreatedDatasetCollectionInput(Base, RepresentById): __tablename__ = "implicitly_created_dataset_collection_inputs" - id: Mapped[int] = mapped_column(primary_key=True) dataset_collection_id: Mapped[Optional[int]] = mapped_column( ForeignKey("history_dataset_collection_association.id"), index=True ) @@ -2600,7 +2581,6 @@ def __init__(self, name, input_dataset_collection): class ImplicitCollectionJobs(Base, Serializable): __tablename__ = "implicit_collection_jobs" - id: Mapped[int] = mapped_column(primary_key=True) populated_state: Mapped[str] = mapped_column(TrimmedString(64), default="new") jobs: Mapped[List["ImplicitCollectionJobsJobAssociation"]] = relationship(back_populates="implicit_collection_jobs") @@ -2629,7 +2609,6 @@ def _serialize(self, id_encoder, serialization_options): class ImplicitCollectionJobsJobAssociation(Base, RepresentById): __tablename__ = "implicit_collection_jobs_job_association" - id: Mapped[int] = mapped_column(primary_key=True) implicit_collection_jobs_id: Mapped[int] = mapped_column( ForeignKey("implicit_collection_jobs.id"), index=True, nullable=True ) @@ -2644,7 +2623,6 @@ class ImplicitCollectionJobsJobAssociation(Base, RepresentById): class PostJobAction(Base, RepresentById): __tablename__ = "post_job_action" - id: Mapped[int] = mapped_column(primary_key=True) workflow_step_id: Mapped[Optional[int]] = mapped_column(ForeignKey("workflow_step.id"), index=True) action_type: Mapped[str] = mapped_column(String(255)) output_name: Mapped[Optional[str]] = mapped_column(String(255)) @@ -2677,7 +2655,6 @@ def action_arguments(self, value: Dict[str, Any]): class PostJobActionAssociation(Base, RepresentById): __tablename__ = "post_job_action_association" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[int] = mapped_column(ForeignKey("job.id"), index=True) post_job_action_id: Mapped[int] = mapped_column(ForeignKey("post_job_action.id"), index=True) post_job_action: Mapped["PostJobAction"] = relationship() @@ -2697,7 +2674,6 @@ def __init__(self, pja, job=None, job_id=None): class JobExternalOutputMetadata(Base, RepresentById): __tablename__ = "job_external_output_metadata" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[Optional[int]] = mapped_column(ForeignKey("job.id"), index=True) history_dataset_association_id: Mapped[Optional[int]] = mapped_column( ForeignKey("history_dataset_association.id"), index=True @@ -2758,7 +2734,6 @@ def __eq__(self, other): class JobExportHistoryArchive(Base, RepresentById): __tablename__ = "job_export_history_archive" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[Optional[int]] = mapped_column(ForeignKey("job.id"), index=True) history_id: Mapped[Optional[int]] = mapped_column(ForeignKey("history.id"), index=True) dataset_id: Mapped[Optional[int]] = mapped_column(ForeignKey("dataset.id"), index=True) @@ -2846,7 +2821,6 @@ def to_dict(self): class JobImportHistoryArchive(Base, RepresentById): __tablename__ = "job_import_history_archive" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[Optional[int]] = mapped_column(ForeignKey("job.id"), index=True) history_id: Mapped[Optional[int]] = mapped_column(ForeignKey("history.id"), index=True) archive_dir: Mapped[Optional[str]] = mapped_column(TEXT) @@ -2858,7 +2832,6 @@ class StoreExportAssociation(Base, RepresentById): __tablename__ = "store_export_association" __table_args__ = (Index("ix_store_export_object", "object_id", "object_type"),) - id: Mapped[int] = mapped_column(primary_key=True) task_uuid: Mapped[Optional[Union[UUID, str]]] = mapped_column(UUIDType(), index=True, unique=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) object_type: Mapped[Optional[str]] = mapped_column(TrimmedString(32)) @@ -2869,7 +2842,6 @@ class StoreExportAssociation(Base, RepresentById): class JobContainerAssociation(Base, RepresentById): __tablename__ = "job_container_association" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[int] = mapped_column(ForeignKey("job.id"), index=True, nullable=True) container_type: Mapped[Optional[str]] = mapped_column(TEXT) container_name: Mapped[Optional[str]] = mapped_column(TEXT) @@ -2888,7 +2860,6 @@ def __init__(self, **kwd): class InteractiveToolEntryPoint(Base, Dictifiable, RepresentById): __tablename__ = "interactivetool_entry_point" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[Optional[int]] = mapped_column(ForeignKey("job.id"), index=True) name: Mapped[Optional[str]] = mapped_column(TEXT) token: Mapped[Optional[str]] = mapped_column(TEXT) @@ -2963,7 +2934,6 @@ def output_datasets_ids(self): class GenomeIndexToolData(Base, RepresentById): # TODO: params arg is lost __tablename__ = "genome_index_tool_data" - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[Optional[int]] = mapped_column(ForeignKey("job.id"), index=True) dataset_id: Mapped[Optional[int]] = mapped_column(ForeignKey("dataset.id"), index=True) fasta_path: Mapped[Optional[str]] = mapped_column(String(255)) @@ -2980,7 +2950,6 @@ class ChatExchange(Base, RepresentById): __tablename__ = "chat_exchange" - id: Mapped[int] = mapped_column(primary_key=True) user_id: Mapped[int] = mapped_column(ForeignKey("galaxy_user.id"), index=True, nullable=False) job_id: Mapped[Optional[int]] = mapped_column(ForeignKey("job.id"), index=True, nullable=True) @@ -3001,7 +2970,6 @@ def add_message(self, message): class ChatExchangeMessage(Base, RepresentById): __tablename__ = "chat_exchange_message" - id: Mapped[int] = mapped_column(primary_key=True) chat_exchange_id: Mapped[int] = mapped_column(ForeignKey("chat_exchange.id"), index=True) create_time: Mapped[datetime] = mapped_column(default=now) message: Mapped[str] = mapped_column(Text) @@ -3016,7 +2984,6 @@ def __init__(self, message, feedback=None): class Group(Base, Dictifiable, RepresentById): __tablename__ = "galaxy_group" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) name: Mapped[Optional[str]] = mapped_column(String(255), index=True, unique=True) @@ -3037,7 +3004,6 @@ class UserGroupAssociation(Base, RepresentById): __tablename__ = "user_group_association" __table_args__ = (UniqueConstraint("user_id", "group_id"),) - id: Mapped[int] = mapped_column(primary_key=True) user_id: Mapped[int] = mapped_column(ForeignKey("galaxy_user.id"), index=True) group_id: Mapped[int] = mapped_column(ForeignKey("galaxy_group.id"), index=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) @@ -3054,7 +3020,6 @@ def __init__(self, user, group): class Notification(Base, Dictifiable, RepresentById): __tablename__ = "notification" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) publication_time: Mapped[Optional[datetime]] = mapped_column( @@ -3096,7 +3061,6 @@ def __init__(self, source: str, category: str, variant: str, content): class UserNotificationAssociation(Base, RepresentById): __tablename__ = "user_notification_association" - id: Mapped[int] = mapped_column(primary_key=True) user_id: Mapped[int] = mapped_column(ForeignKey("galaxy_user.id"), index=True, nullable=True) notification_id: Mapped[int] = mapped_column(ForeignKey("notification.id"), index=True, nullable=True) seen_time: Mapped[Optional[datetime]] @@ -3163,7 +3127,7 @@ class History(Base, HasTags, Dictifiable, UsesAnnotations, HasName, Serializable __tablename__ = "history" __table_args__ = (Index("ix_history_slug", "slug", mysql_length=200),) - id: Mapped[int] = mapped_column(primary_key=True) + id: Mapped[int] = mapped_column(primary_key=True) # duplicated intentionally due to update_time column_property create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) _update_time: Mapped[datetime] = mapped_column( "update_time", DateTime, index=True, default=now, onupdate=now, nullable=True @@ -3749,7 +3713,6 @@ class UserShareAssociation(RepresentById): class HistoryUserShareAssociation(Base, UserShareAssociation): __tablename__ = "history_user_share_association" - id: Mapped[int] = mapped_column(primary_key=True) history_id: Mapped[int] = mapped_column(ForeignKey("history.id"), index=True, nullable=True) user_id: Mapped[int] = mapped_column(ForeignKey("galaxy_user.id"), index=True, nullable=True) user: Mapped["User"] = relationship() @@ -3760,7 +3723,6 @@ class UserRoleAssociation(Base, RepresentById): __tablename__ = "user_role_association" __table_args__ = (UniqueConstraint("user_id", "role_id"),) - id: Mapped[int] = mapped_column(primary_key=True) user_id: Mapped[int] = mapped_column(ForeignKey("galaxy_user.id"), index=True) role_id: Mapped[int] = mapped_column(ForeignKey("role.id"), index=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) @@ -3779,7 +3741,6 @@ class GroupRoleAssociation(Base, RepresentById): __tablename__ = "group_role_association" __table_args__ = (UniqueConstraint("group_id", "role_id"),) - id: Mapped[int] = mapped_column(primary_key=True) group_id: Mapped[int] = mapped_column(ForeignKey("galaxy_group.id"), index=True) role_id: Mapped[int] = mapped_column(ForeignKey("role.id"), index=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) @@ -3796,7 +3757,6 @@ def __init__(self, group, role): class Role(Base, Dictifiable, RepresentById): __tablename__ = "role" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) _name: Mapped[str] = mapped_column("name", String(255), index=True) @@ -3848,7 +3808,6 @@ class UserQuotaSourceUsage(Base, Dictifiable, RepresentById): dict_element_visible_keys = ["disk_usage", "quota_source_label"] - id: Mapped[int] = mapped_column(primary_key=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) quota_source_label: Mapped[Optional[str]] = mapped_column(String(32), index=True) # user had an index on disk_usage - does that make any sense? -John @@ -3859,7 +3818,6 @@ class UserQuotaSourceUsage(Base, Dictifiable, RepresentById): class UserQuotaAssociation(Base, Dictifiable, RepresentById): __tablename__ = "user_quota_association" - id: Mapped[int] = mapped_column(primary_key=True) user_id: Mapped[int] = mapped_column(ForeignKey("galaxy_user.id"), index=True, nullable=True) quota_id: Mapped[int] = mapped_column(ForeignKey("quota.id"), index=True, nullable=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) @@ -3878,7 +3836,6 @@ def __init__(self, user, quota): class GroupQuotaAssociation(Base, Dictifiable, RepresentById): __tablename__ = "group_quota_association" - id: Mapped[int] = mapped_column(primary_key=True) group_id: Mapped[int] = mapped_column(ForeignKey("galaxy_group.id"), index=True, nullable=True) quota_id: Mapped[int] = mapped_column(ForeignKey("quota.id"), index=True, nullable=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) @@ -3898,7 +3855,6 @@ class Quota(Base, Dictifiable, RepresentById): __tablename__ = "quota" __table_args__ = (Index("ix_quota_quota_source_label", "quota_source_label"),) - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) name: Mapped[Optional[str]] = mapped_column(String(255), index=True, unique=True) @@ -3960,7 +3916,6 @@ def display_amount(self): class DefaultQuotaAssociation(Base, Dictifiable, RepresentById): __tablename__ = "default_quota_association" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) type: Mapped[Optional[str]] = mapped_column(String(32)) @@ -3983,7 +3938,6 @@ def __init__(self, type, quota): class DatasetPermissions(Base, RepresentById): __tablename__ = "dataset_permissions" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) action: Mapped[Optional[str]] = mapped_column(TEXT) @@ -4005,7 +3959,6 @@ def __init__(self, action, dataset, role=None, role_id=None): class LibraryPermissions(Base, RepresentById): __tablename__ = "library_permissions" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) action: Mapped[Optional[str]] = mapped_column(TEXT) @@ -4027,7 +3980,6 @@ def __init__(self, action, library_item, role): class LibraryFolderPermissions(Base, RepresentById): __tablename__ = "library_folder_permissions" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) action: Mapped[Optional[str]] = mapped_column(TEXT) @@ -4049,7 +4001,6 @@ def __init__(self, action, library_item, role): class LibraryDatasetPermissions(Base, RepresentById): __tablename__ = "library_dataset_permissions" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) action: Mapped[Optional[str]] = mapped_column(TEXT) @@ -4071,7 +4022,6 @@ def __init__(self, action, library_item, role): class LibraryDatasetDatasetAssociationPermissions(Base, RepresentById): __tablename__ = "library_dataset_dataset_association_permissions" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) action: Mapped[Optional[str]] = mapped_column(TEXT) @@ -4097,7 +4047,6 @@ def __init__(self, action, library_item, role): class DefaultUserPermissions(Base, RepresentById): __tablename__ = "default_user_permissions" - id: Mapped[int] = mapped_column(primary_key=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) action: Mapped[Optional[str]] = mapped_column(TEXT) role_id: Mapped[Optional[int]] = mapped_column(ForeignKey("role.id"), index=True) @@ -4114,7 +4063,6 @@ def __init__(self, user, action, role): class DefaultHistoryPermissions(Base, RepresentById): __tablename__ = "default_history_permissions" - id: Mapped[int] = mapped_column(primary_key=True) history_id: Mapped[Optional[int]] = mapped_column(ForeignKey("history.id"), index=True) action: Mapped[Optional[str]] = mapped_column(TEXT) role_id: Mapped[Optional[int]] = mapped_column(ForeignKey("role.id"), index=True) @@ -4143,7 +4091,6 @@ class Dataset(Base, StorableObject, Serializable): __tablename__ = "dataset" __table_args__ = (UniqueConstraint("uuid", name="uq_uuid_column"),) - id: Mapped[int] = mapped_column(primary_key=True) job_id: Mapped[Optional[int]] = mapped_column(ForeignKey("job.id"), index=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(index=True, default=now, onupdate=now, nullable=True) @@ -4521,7 +4468,6 @@ def to_int(n) -> Optional[int]: class DatasetSource(Base, Dictifiable, Serializable): __tablename__ = "dataset_source" - id: Mapped[int] = mapped_column(primary_key=True) dataset_id: Mapped[Optional[int]] = mapped_column(ForeignKey("dataset.id"), index=True) source_uri: Mapped[Optional[str]] = mapped_column(TEXT) extra_files_path: Mapped[Optional[str]] = mapped_column(TEXT) @@ -4569,7 +4515,6 @@ def hash_func_name(self) -> HashFunctionNameEnum: class DatasetSourceHash(Base, Serializable, HasHashFunctionName): __tablename__ = "dataset_source_hash" - id: Mapped[int] = mapped_column(primary_key=True) dataset_source_id: Mapped[Optional[int]] = mapped_column(ForeignKey("dataset_source.id"), index=True) hash_function: Mapped[Optional[str]] = mapped_column(TEXT) hash_value: Mapped[Optional[str]] = mapped_column(TEXT) @@ -4594,7 +4539,6 @@ def copy(self) -> "DatasetSourceHash": class DatasetHash(Base, Dictifiable, Serializable, HasHashFunctionName): __tablename__ = "dataset_hash" - id: Mapped[int] = mapped_column(primary_key=True) dataset_id: Mapped[Optional[int]] = mapped_column(ForeignKey("dataset.id"), index=True) hash_function: Mapped[Optional[str]] = mapped_column(TEXT) hash_value: Mapped[Optional[str]] = mapped_column(TEXT) @@ -5666,10 +5610,9 @@ def type_id(cls): return (type_coerce(cls.content_type, Unicode) + "-" + type_coerce(cls.id, Unicode)).label("type_id") -class HistoryDatasetAssociationHistory(Base): +class HistoryDatasetAssociationHistory(Base, HasId): __tablename__ = "history_dataset_association_history" - id: Mapped[int] = mapped_column(primary_key=True) history_dataset_association_id: Mapped[Optional[int]] = mapped_column( ForeignKey("history_dataset_association.id"), index=True ) @@ -5705,7 +5648,6 @@ def __init__( class HistoryDatasetAssociationDisplayAtAuthorization(Base, RepresentById): __tablename__ = "history_dataset_association_display_at_authorization" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(index=True, default=now, onupdate=now, nullable=True) history_dataset_association_id: Mapped[Optional[int]] = mapped_column( @@ -5725,7 +5667,6 @@ def __init__(self, hda=None, user=None, site=None): class HistoryDatasetAssociationSubset(Base, RepresentById): __tablename__ = "history_dataset_association_subset" - id: Mapped[int] = mapped_column(primary_key=True) history_dataset_association_id: Mapped[Optional[int]] = mapped_column( ForeignKey("history_dataset_association.id"), index=True ) @@ -5755,7 +5696,6 @@ def __init__(self, hda, subset, location): class Library(Base, Dictifiable, HasName, Serializable): __tablename__ = "library" - id: Mapped[int] = mapped_column(primary_key=True) root_folder_id: Mapped[Optional[int]] = mapped_column(ForeignKey("library_folder.id"), index=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) @@ -5833,7 +5773,6 @@ class LibraryFolder(Base, Dictifiable, HasName, Serializable): __tablename__ = "library_folder" __table_args__ = (Index("ix_library_folder_name", "name", mysql_length=200),) - id: Mapped[int] = mapped_column(primary_key=True) parent_id: Mapped[Optional[int]] = mapped_column(ForeignKey("library_folder.id"), index=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) @@ -5850,7 +5789,9 @@ class LibraryFolder(Base, Dictifiable, HasName, Serializable): order_by=asc(name), back_populates="parent", ) - parent: Mapped[Optional["LibraryFolder"]] = relationship(back_populates="folders", remote_side=[id]) + parent: Mapped[Optional["LibraryFolder"]] = relationship( + back_populates="folders", remote_side=lambda: LibraryFolder.id + ) active_folders: Mapped[List["LibraryFolder"]] = relationship( primaryjoin=("and_(LibraryFolder.parent_id == LibraryFolder.id, not_(LibraryFolder.deleted))"), @@ -5970,7 +5911,6 @@ def parent_library(self): class LibraryDataset(Base, Serializable): __tablename__ = "library_dataset" - id: Mapped[int] = mapped_column(primary_key=True) # current version of dataset, if null, there is not a current version selected library_dataset_dataset_association_id: Mapped[Optional[int]] = mapped_column( ForeignKey( @@ -5991,10 +5931,12 @@ class LibraryDataset(Base, Serializable): purged: Mapped[Optional[bool]] = mapped_column(index=True, default=False) folder: Mapped[Optional["LibraryFolder"]] = relationship() library_dataset_dataset_association = relationship( - "LibraryDatasetDatasetAssociation", foreign_keys=library_dataset_dataset_association_id, post_update=True + "LibraryDatasetDatasetAssociation", + foreign_keys=library_dataset_dataset_association_id, + post_update=True, ) expired_datasets: Mapped[List["LibraryDatasetDatasetAssociation"]] = relationship( - foreign_keys=[id, library_dataset_dataset_association_id], + foreign_keys=lambda: [LibraryDataset.id, LibraryDataset.library_dataset_dataset_association_id], primaryjoin=( "and_(LibraryDataset.id == LibraryDatasetDatasetAssociation.library_dataset_id, \ not_(LibraryDataset.library_dataset_dataset_association_id == LibraryDatasetDatasetAssociation.id))" @@ -6273,7 +6215,6 @@ def update_parent_folder_update_times(self): class ExtendedMetadata(Base, RepresentById): __tablename__ = "extended_metadata" - id: Mapped[int] = mapped_column(primary_key=True) data: Mapped[Optional[bytes]] = mapped_column(MutableJSONType) children: Mapped[List["ExtendedMetadataIndex"]] = relationship(back_populates="extended_metadata") @@ -6284,7 +6225,6 @@ def __init__(self, data): class ExtendedMetadataIndex(Base, RepresentById): __tablename__ = "extended_metadata_index" - id: Mapped[int] = mapped_column(primary_key=True) extended_metadata_id: Mapped[Optional[int]] = mapped_column( ForeignKey("extended_metadata.id", onupdate="CASCADE", ondelete="CASCADE"), index=True ) @@ -6301,7 +6241,6 @@ def __init__(self, extended_metadata, path, value): class LibraryInfoAssociation(Base, RepresentById): __tablename__ = "library_info_association" - id: Mapped[int] = mapped_column(primary_key=True) library_id: Mapped[Optional[int]] = mapped_column(ForeignKey("library.id"), index=True) form_definition_id: Mapped[Optional[int]] = mapped_column(ForeignKey("form_definition.id"), index=True) form_values_id: Mapped[Optional[int]] = mapped_column(ForeignKey("form_values.id"), index=True) @@ -6333,7 +6272,6 @@ def __init__(self, library, form_definition, info, inheritable=False): class LibraryFolderInfoAssociation(Base, RepresentById): __tablename__ = "library_folder_info_association" - id: Mapped[int] = mapped_column(primary_key=True) library_folder_id: Mapped[Optional[int]] = mapped_column(ForeignKey("library_folder.id"), index=True) form_definition_id: Mapped[Optional[int]] = mapped_column(ForeignKey("form_definition.id"), index=True) form_values_id: Mapped[Optional[int]] = mapped_column(ForeignKey("form_values.id"), index=True) @@ -6363,7 +6301,6 @@ def __init__(self, folder, form_definition, info, inheritable=False): class LibraryDatasetDatasetInfoAssociation(Base, RepresentById): __tablename__ = "library_dataset_dataset_info_association" - id: Mapped[int] = mapped_column(primary_key=True) library_dataset_dataset_association_id: Mapped[Optional[int]] = mapped_column( ForeignKey("library_dataset_dataset_association.id"), index=True ) @@ -6401,7 +6338,6 @@ def inheritable(self): class ImplicitlyConvertedDatasetAssociation(Base, Serializable): __tablename__ = "implicitly_converted_dataset_association" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) hda_id: Mapped[Optional[int]] = mapped_column(ForeignKey("history_dataset_association.id"), index=True) @@ -6509,7 +6445,6 @@ def produce_filter(self, table): class DatasetCollection(Base, Dictifiable, UsesAnnotations, Serializable): __tablename__ = "dataset_collection" - id: Mapped[int] = mapped_column(primary_key=True) collection_type: Mapped[str] = mapped_column(Unicode(255)) populated_state: Mapped[str] = mapped_column(TrimmedString(64), default="ok") populated_state_message: Mapped[Optional[str]] = mapped_column(TEXT) @@ -6985,7 +6920,6 @@ class HistoryDatasetCollectionAssociation( __tablename__ = "history_dataset_collection_association" - id: Mapped[int] = mapped_column(primary_key=True) collection_id: Mapped[Optional[int]] = mapped_column(ForeignKey("dataset_collection.id"), index=True) history_id: Mapped[Optional[int]] = mapped_column(ForeignKey("history.id"), index=True) name: Mapped[Optional[str]] = mapped_column(TrimmedString(255)) @@ -7008,8 +6942,9 @@ class HistoryDatasetCollectionAssociation( copied_from_history_dataset_collection_association = relationship( "HistoryDatasetCollectionAssociation", - primaryjoin=copied_from_history_dataset_collection_association_id == id, - remote_side=[id], + primaryjoin=lambda: HistoryDatasetCollectionAssociation.copied_from_history_dataset_collection_association_id + == HistoryDatasetCollectionAssociation.id, + remote_side=lambda: HistoryDatasetCollectionAssociation.id, uselist=False, ) implicit_input_collections: Mapped[List["ImplicitlyCreatedDatasetCollectionInput"]] = relationship( @@ -7369,7 +7304,6 @@ class LibraryDatasetCollectionAssociation(Base, DatasetCollectionInstance, Repre __tablename__ = "library_dataset_collection_association" - id: Mapped[int] = mapped_column(primary_key=True) collection_id: Mapped[Optional[int]] = mapped_column(ForeignKey("dataset_collection.id"), index=True) folder_id: Mapped[Optional[int]] = mapped_column(ForeignKey("library_folder.id"), index=True) name: Mapped[Optional[str]] = mapped_column(TrimmedString(255)) @@ -7410,7 +7344,6 @@ class DatasetCollectionElement(Base, Dictifiable, Serializable): __tablename__ = "dataset_collection_element" - id: Mapped[int] = mapped_column(primary_key=True) # Parent collection id describing what collection this element belongs to. dataset_collection_id: Mapped[int] = mapped_column(ForeignKey("dataset_collection.id"), index=True) # Child defined by this association - HDA, LDDA, or another dataset association... @@ -7601,7 +7534,6 @@ def _serialize(self, id_encoder, serialization_options): class Event(Base, RepresentById): __tablename__ = "event" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) history_id: Mapped[Optional[int]] = mapped_column(ForeignKey("history.id"), index=True) @@ -7618,7 +7550,6 @@ class Event(Base, RepresentById): class GalaxySession(Base, RepresentById): __tablename__ = "galaxy_session" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) @@ -7664,7 +7595,6 @@ def set_disk_usage(self, bytes): class GalaxySessionToHistoryAssociation(Base, RepresentById): __tablename__ = "galaxy_session_to_history" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) session_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_session.id"), index=True) history_id: Mapped[Optional[int]] = mapped_column(ForeignKey("history.id"), index=True) @@ -7690,7 +7620,6 @@ class StoredWorkflow(Base, HasTags, Dictifiable, RepresentById, UsesCreateAndUpd __tablename__ = "stored_workflow" __table_args__ = (Index("ix_stored_workflow_slug", "slug", mysql_length=200),) - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, index=True, nullable=True) user_id: Mapped[int] = mapped_column(ForeignKey("galaxy_user.id"), index=True) @@ -7872,7 +7801,6 @@ class Workflow(Base, Dictifiable, RepresentById): __tablename__ = "workflow" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) # workflows will belong to either a stored workflow or a parent/nesting workflow. @@ -8072,7 +8000,6 @@ class WorkflowStep(Base, RepresentById, UsesCreateAndUpdateTime): __tablename__ = "workflow_step" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) workflow_id: Mapped[int] = mapped_column(ForeignKey("workflow.id"), index=True) @@ -8405,7 +8332,6 @@ class WorkflowStepInput(Base, RepresentById): ), ) - id: Mapped[int] = mapped_column(primary_key=True) workflow_step_id: Mapped[Optional[int]] = mapped_column(ForeignKey("workflow_step.id"), index=True) name: Mapped[Optional[str]] = mapped_column(TEXT) merge_type: Mapped[Optional[str]] = mapped_column(TEXT) @@ -8446,7 +8372,6 @@ def copy(self, copied_step): class WorkflowStepConnection(Base, RepresentById): __tablename__ = "workflow_step_connection" - id: Mapped[int] = mapped_column(primary_key=True) output_step_id: Mapped[Optional[int]] = mapped_column(ForeignKey("workflow_step.id"), index=True) input_step_input_id: Mapped[Optional[int]] = mapped_column(ForeignKey("workflow_step_input.id"), index=True) output_name: Mapped[Optional[str]] = mapped_column(TEXT) @@ -8502,7 +8427,6 @@ def copy(self): class WorkflowOutput(Base, Serializable): __tablename__ = "workflow_output" - id: Mapped[int] = mapped_column(primary_key=True) workflow_step_id: Mapped[int] = mapped_column(ForeignKey("workflow_step.id"), index=True) output_name: Mapped[Optional[str]] = mapped_column(String(255)) label: Mapped[Optional[str]] = mapped_column(Unicode(255)) @@ -8542,7 +8466,6 @@ class WorkflowComment(Base, RepresentById): __tablename__ = "workflow_comment" - id: Mapped[int] = mapped_column(primary_key=True) order_index: Mapped[Optional[int]] workflow_id: Mapped[int] = mapped_column(ForeignKey("workflow.id"), index=True) position: Mapped[Optional[bytes]] = mapped_column(MutableJSONType) @@ -8566,7 +8489,7 @@ class WorkflowComment(Base, RepresentById): parent_comment: Mapped[Optional["WorkflowComment"]] = relationship( primaryjoin=(lambda: WorkflowComment.id == WorkflowComment.parent_comment_id), back_populates="child_comments", - remote_side=[id], + remote_side=lambda: WorkflowComment.id, ) child_comments: Mapped[List["WorkflowComment"]] = relationship( @@ -8621,7 +8544,6 @@ def copy(self): class StoredWorkflowUserShareAssociation(Base, UserShareAssociation): __tablename__ = "stored_workflow_user_share_connection" - id: Mapped[int] = mapped_column(primary_key=True) stored_workflow_id: Mapped[int] = mapped_column(ForeignKey("stored_workflow.id"), index=True, nullable=True) user_id: Mapped[int] = mapped_column(ForeignKey("galaxy_user.id"), index=True, nullable=True) user: Mapped[User] = relationship() @@ -8631,7 +8553,6 @@ class StoredWorkflowUserShareAssociation(Base, UserShareAssociation): class StoredWorkflowMenuEntry(Base, RepresentById): __tablename__ = "stored_workflow_menu_entry" - id: Mapped[int] = mapped_column(primary_key=True) stored_workflow_id: Mapped[Optional[int]] = mapped_column(ForeignKey("stored_workflow.id"), index=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) order_index: Mapped[Optional[int]] @@ -8662,7 +8583,6 @@ class InputToMaterialize: class WorkflowInvocation(Base, UsesCreateAndUpdateTime, Dictifiable, Serializable): __tablename__ = "workflow_invocation" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, index=True, nullable=True) workflow_id: Mapped[int] = mapped_column(ForeignKey("workflow.id"), index=True) @@ -9262,7 +9182,6 @@ def log_str(self): class WorkflowInvocationToSubworkflowInvocationAssociation(Base, Dictifiable, RepresentById): __tablename__ = "workflow_invocation_to_subworkflow_invocation_association" - id: Mapped[int] = mapped_column(primary_key=True) workflow_invocation_id: Mapped[Optional[int]] = mapped_column( ForeignKey("workflow_invocation.id", name="fk_wfi_swi_wfi"), index=True ) @@ -9294,7 +9213,6 @@ class WorkflowInvocationToSubworkflowInvocationAssociation(Base, Dictifiable, Re class WorkflowInvocationMessage(Base, Dictifiable, Serializable): __tablename__ = "workflow_invocation_message" - id: Mapped[int] = mapped_column(primary_key=True) workflow_invocation_id: Mapped[int] = mapped_column(ForeignKey("workflow_invocation.id"), index=True) reason: Mapped[Optional[str]] = mapped_column(String(32)) details: Mapped[Optional[str]] = mapped_column(TrimmedString(255)) @@ -9369,7 +9287,6 @@ def is_split_configuration(self): class WorkflowInvocationStep(Base, Dictifiable, Serializable): __tablename__ = "workflow_invocation_step" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) workflow_invocation_id: Mapped[int] = mapped_column(ForeignKey("workflow_invocation.id"), index=True) @@ -9575,7 +9492,6 @@ class WorkflowRequestInputParameter(Base, Dictifiable, Serializable): __tablename__ = "workflow_request_input_parameters" - id: Mapped[int] = mapped_column(primary_key=True) workflow_invocation_id: Mapped[Optional[int]] = mapped_column( ForeignKey("workflow_invocation.id", onupdate="CASCADE", ondelete="CASCADE"), index=True ) @@ -9605,7 +9521,6 @@ class WorkflowRequestStepState(Base, Dictifiable, Serializable): __tablename__ = "workflow_request_step_states" - id: Mapped[int] = mapped_column(primary_key=True) workflow_invocation_id: Mapped[Optional[int]] = mapped_column( ForeignKey("workflow_invocation.id", onupdate="CASCADE", ondelete="CASCADE"), index=True ) @@ -9628,7 +9543,6 @@ class WorkflowRequestToInputDatasetAssociation(Base, Dictifiable, Serializable): __tablename__ = "workflow_request_to_input_dataset" - id: Mapped[int] = mapped_column(primary_key=True) name: Mapped[Optional[str]] = mapped_column(String(255)) workflow_invocation_id: Mapped[Optional[int]] = mapped_column(ForeignKey("workflow_invocation.id"), index=True) workflow_step_id: Mapped[Optional[int]] = mapped_column(ForeignKey("workflow_step.id")) @@ -9657,7 +9571,6 @@ class WorkflowRequestToInputDatasetCollectionAssociation(Base, Dictifiable, Seri __tablename__ = "workflow_request_to_input_collection_dataset" - id: Mapped[int] = mapped_column(primary_key=True) name: Mapped[Optional[str]] = mapped_column(String(255)) workflow_invocation_id: Mapped[Optional[int]] = mapped_column(ForeignKey("workflow_invocation.id"), index=True) workflow_step_id: Mapped[Optional[int]] = mapped_column(ForeignKey("workflow_step.id")) @@ -9689,7 +9602,6 @@ class WorkflowRequestInputStepParameter(Base, Dictifiable, Serializable): __tablename__ = "workflow_request_input_step_parameter" - id: Mapped[int] = mapped_column(primary_key=True) workflow_invocation_id: Mapped[Optional[int]] = mapped_column(ForeignKey("workflow_invocation.id"), index=True) workflow_step_id: Mapped[Optional[int]] = mapped_column(ForeignKey("workflow_step.id")) parameter_value: Mapped[Optional[bytes]] = mapped_column(MutableJSONType) @@ -9712,7 +9624,6 @@ class WorkflowInvocationOutputDatasetAssociation(Base, Dictifiable, Serializable __tablename__ = "workflow_invocation_output_dataset_association" - id: Mapped[int] = mapped_column(primary_key=True) workflow_invocation_id: Mapped[Optional[int]] = mapped_column(ForeignKey("workflow_invocation.id"), index=True) workflow_step_id: Mapped[Optional[int]] = mapped_column(ForeignKey("workflow_step.id"), index=True) dataset_id: Mapped[Optional[int]] = mapped_column(ForeignKey("history_dataset_association.id"), index=True) @@ -9738,7 +9649,6 @@ class WorkflowInvocationOutputDatasetCollectionAssociation(Base, Dictifiable, Se __tablename__ = "workflow_invocation_output_dataset_collection_association" - id: Mapped[int] = mapped_column(primary_key=True) workflow_invocation_id: Mapped[Optional[int]] = mapped_column( ForeignKey("workflow_invocation.id", name="fk_wiodca_wii"), index=True ) @@ -9777,7 +9687,6 @@ class WorkflowInvocationOutputValue(Base, Dictifiable, Serializable): __tablename__ = "workflow_invocation_output_value" - id: Mapped[int] = mapped_column(primary_key=True) workflow_invocation_id: Mapped[Optional[int]] = mapped_column(ForeignKey("workflow_invocation.id"), index=True) workflow_step_id: Mapped[Optional[int]] = mapped_column(ForeignKey("workflow_step.id")) workflow_output_id: Mapped[Optional[int]] = mapped_column(ForeignKey("workflow_output.id"), index=True) @@ -9815,7 +9724,6 @@ class WorkflowInvocationStepOutputDatasetAssociation(Base, Dictifiable, Represen __tablename__ = "workflow_invocation_step_output_dataset_association" - id: Mapped[int] = mapped_column(primary_key=True) workflow_invocation_step_id: Mapped[Optional[int]] = mapped_column( ForeignKey("workflow_invocation_step.id"), index=True ) @@ -9834,7 +9742,6 @@ class WorkflowInvocationStepOutputDatasetCollectionAssociation(Base, Dictifiable __tablename__ = "workflow_invocation_step_output_dataset_collection_association" - id: Mapped[int] = mapped_column(primary_key=True) workflow_invocation_step_id: Mapped[Optional[int]] = mapped_column( ForeignKey("workflow_invocation_step.id", name="fk_wisodca_wisi"), index=True ) @@ -9857,7 +9764,6 @@ class WorkflowInvocationStepOutputDatasetCollectionAssociation(Base, Dictifiable class MetadataFile(Base, StorableObject, Serializable): __tablename__ = "metadata_file" - id: Mapped[int] = mapped_column(primary_key=True) name: Mapped[Optional[str]] = mapped_column(TEXT) hda_id: Mapped[Optional[int]] = mapped_column(ForeignKey("history_dataset_association.id"), index=True) lda_id: Mapped[Optional[int]] = mapped_column(ForeignKey("library_dataset_dataset_association.id"), index=True) @@ -9941,7 +9847,6 @@ def _serialize(self, id_encoder, serialization_options): class FormDefinition(Base, Dictifiable, RepresentById): __tablename__ = "form_definition" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[Optional[datetime]] = mapped_column(default=now) update_time: Mapped[Optional[datetime]] = mapped_column(default=now, onupdate=now) name: Mapped[str] = mapped_column(TrimmedString(255)) @@ -10012,7 +9917,6 @@ def grid_fields(self, grid_index): class FormDefinitionCurrent(Base, RepresentById): __tablename__ = "form_definition_current" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) latest_form_id: Mapped[Optional[int]] = mapped_column(ForeignKey("form_definition.id"), index=True) @@ -10034,7 +9938,6 @@ def __init__(self, form_definition=None): class FormValues(Base, RepresentById): __tablename__ = "form_values" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) form_definition_id: Mapped[Optional[int]] = mapped_column(ForeignKey("form_definition.id"), index=True) @@ -10051,7 +9954,6 @@ def __init__(self, form_def=None, content=None): class UserAddress(Base, RepresentById): __tablename__ = "user_address" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) @@ -10088,7 +9990,6 @@ def to_dict(self, trans): class PSAAssociation(Base, AssociationMixin, RepresentById): __tablename__ = "psa_association" - id: Mapped[int] = mapped_column(primary_key=True) server_url: Mapped[Optional[str]] = mapped_column(VARCHAR(255)) handle: Mapped[Optional[str]] = mapped_column(VARCHAR(255)) secret: Mapped[Optional[str]] = mapped_column(VARCHAR(255)) @@ -10152,7 +10053,6 @@ class PSACode(Base, CodeMixin, RepresentById): __tablename__ = "psa_code" __table_args__ = (UniqueConstraint("code", "email"),) - id: Mapped[int] = mapped_column(primary_key=True) email: Mapped[Optional[str]] = mapped_column(VARCHAR(200)) code: Mapped[Optional[str]] = mapped_column(VARCHAR(32)) @@ -10180,7 +10080,6 @@ def get_code(cls, code): class PSANonce(Base, NonceMixin, RepresentById): __tablename__ = "psa_nonce" - id: Mapped[int] = mapped_column(primary_key=True) server_url: Mapped[Optional[str]] = mapped_column(VARCHAR(255)) timestamp: Mapped[Optional[int]] salt: Mapped[Optional[str]] = mapped_column(VARCHAR(40)) @@ -10218,7 +10117,6 @@ def use(cls, server_url, timestamp, salt): class PSAPartial(Base, PartialMixin, RepresentById): __tablename__ = "psa_partial" - id: Mapped[int] = mapped_column(primary_key=True) token: Mapped[Optional[str]] = mapped_column(VARCHAR(32)) data: Mapped[Optional[str]] = mapped_column(TEXT) next_step: Mapped[Optional[int]] @@ -10262,7 +10160,6 @@ class UserAuthnzToken(Base, UserMixin, RepresentById): __tablename__ = "oidc_user_authnz_tokens" __table_args__ = (UniqueConstraint("provider", "uid"),) - id: Mapped[int] = mapped_column(primary_key=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) uid: Mapped[Optional[str]] = mapped_column(VARCHAR(255)) provider: Mapped[Optional[str]] = mapped_column(VARCHAR(32)) @@ -10425,7 +10322,6 @@ class CustosAuthnzToken(Base, RepresentById): UniqueConstraint("external_user_id", "provider"), ) - id: Mapped[int] = mapped_column(primary_key=True) user_id: Mapped[int] = mapped_column(ForeignKey("galaxy_user.id"), nullable=True) external_user_id: Mapped[Optional[str]] = mapped_column(String(255)) provider: Mapped[Optional[str]] = mapped_column(String(255)) @@ -10441,7 +10337,6 @@ class Page(Base, HasTags, Dictifiable, RepresentById, UsesCreateAndUpdateTime): __tablename__ = "page" __table_args__ = (Index("ix_page_slug", "slug", mysql_length=200),) - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) user_id: Mapped[int] = mapped_column(ForeignKey("galaxy_user.id"), index=True) @@ -10521,7 +10416,6 @@ def email_hash(self): class PageRevision(Base, Dictifiable, RepresentById): __tablename__ = "page_revision" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) page_id: Mapped[int] = mapped_column(ForeignKey("page.id"), index=True) @@ -10545,7 +10439,6 @@ def to_dict(self, view="element"): class PageUserShareAssociation(Base, UserShareAssociation): __tablename__ = "page_user_share_association" - id: Mapped[int] = mapped_column(primary_key=True) page_id: Mapped[int] = mapped_column(ForeignKey("page.id"), index=True, nullable=True) user_id: Mapped[int] = mapped_column(ForeignKey("galaxy_user.id"), index=True, nullable=True) user: Mapped[User] = relationship() @@ -10559,7 +10452,6 @@ class Visualization(Base, HasTags, Dictifiable, RepresentById, UsesCreateAndUpda Index("ix_visualization_slug", "slug", mysql_length=200), ) - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) user_id: Mapped[int] = mapped_column(ForeignKey("galaxy_user.id"), index=True) @@ -10667,7 +10559,6 @@ class VisualizationRevision(Base, RepresentById): __tablename__ = "visualization_revision" __table_args__ = (Index("ix_visualization_revision_dbkey", "dbkey", mysql_length=200),) - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) visualization_id: Mapped[int] = mapped_column(ForeignKey("visualization.id"), index=True) @@ -10694,7 +10585,6 @@ def copy(self, visualization=None): class VisualizationUserShareAssociation(Base, UserShareAssociation): __tablename__ = "visualization_user_share_association" - id: Mapped[int] = mapped_column(primary_key=True) visualization_id: Mapped[int] = mapped_column(ForeignKey("visualization.id"), index=True, nullable=True) user_id: Mapped[int] = mapped_column(ForeignKey("galaxy_user.id"), index=True, nullable=True) user: Mapped[User] = relationship() @@ -10705,12 +10595,11 @@ class Tag(Base, RepresentById): __tablename__ = "tag" __table_args__ = (UniqueConstraint("name"),) - id: Mapped[int] = mapped_column(primary_key=True) type: Mapped[Optional[int]] parent_id: Mapped[Optional[int]] = mapped_column(ForeignKey("tag.id")) name: Mapped[Optional[str]] = mapped_column(TrimmedString(255)) children: Mapped[List["Tag"]] = relationship(back_populates="parent") - parent: Mapped[Optional["Tag"]] = relationship(back_populates="children", remote_side=[id]) + parent: Mapped[Optional["Tag"]] = relationship(back_populates="children", remote_side=lambda: Tag.id) def __str__(self): return f"Tag(id={self.id}, type={self.type or -1}, parent_id={self.parent_id}, name={self.name})" @@ -10740,7 +10629,6 @@ def copy(self, cls=None): class HistoryTagAssociation(Base, ItemTagAssociation, RepresentById): __tablename__ = "history_tag_association" - id: Mapped[int] = mapped_column(primary_key=True) history_id: Mapped[int] = mapped_column(ForeignKey("history.id"), index=True, nullable=True) tag_id: Mapped[int] = mapped_column(ForeignKey("tag.id"), index=True, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) @@ -10754,7 +10642,6 @@ class HistoryTagAssociation(Base, ItemTagAssociation, RepresentById): class HistoryDatasetAssociationTagAssociation(Base, ItemTagAssociation, RepresentById): __tablename__ = "history_dataset_association_tag_association" - id: Mapped[int] = mapped_column(primary_key=True) history_dataset_association_id: Mapped[int] = mapped_column( ForeignKey("history_dataset_association.id"), index=True, nullable=True ) @@ -10770,7 +10657,6 @@ class HistoryDatasetAssociationTagAssociation(Base, ItemTagAssociation, Represen class LibraryDatasetDatasetAssociationTagAssociation(Base, ItemTagAssociation, RepresentById): __tablename__ = "library_dataset_dataset_association_tag_association" - id: Mapped[int] = mapped_column(primary_key=True) library_dataset_dataset_association_id: Mapped[int] = mapped_column( ForeignKey("library_dataset_dataset_association.id"), index=True, nullable=True ) @@ -10788,7 +10674,6 @@ class LibraryDatasetDatasetAssociationTagAssociation(Base, ItemTagAssociation, R class PageTagAssociation(Base, ItemTagAssociation, RepresentById): __tablename__ = "page_tag_association" - id: Mapped[int] = mapped_column(primary_key=True) page_id: Mapped[int] = mapped_column(ForeignKey("page.id"), index=True, nullable=True) tag_id: Mapped[int] = mapped_column(ForeignKey("tag.id"), index=True, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) @@ -10802,7 +10687,6 @@ class PageTagAssociation(Base, ItemTagAssociation, RepresentById): class WorkflowStepTagAssociation(Base, ItemTagAssociation, RepresentById): __tablename__ = "workflow_step_tag_association" - id: Mapped[int] = mapped_column(primary_key=True) workflow_step_id: Mapped[int] = mapped_column(ForeignKey("workflow_step.id"), index=True, nullable=True) tag_id: Mapped[int] = mapped_column(ForeignKey("tag.id"), index=True, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) @@ -10816,7 +10700,6 @@ class WorkflowStepTagAssociation(Base, ItemTagAssociation, RepresentById): class StoredWorkflowTagAssociation(Base, ItemTagAssociation, RepresentById): __tablename__ = "stored_workflow_tag_association" - id: Mapped[int] = mapped_column(primary_key=True) stored_workflow_id: Mapped[int] = mapped_column(ForeignKey("stored_workflow.id"), index=True, nullable=True) tag_id: Mapped[int] = mapped_column(ForeignKey("tag.id"), index=True, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) @@ -10830,7 +10713,6 @@ class StoredWorkflowTagAssociation(Base, ItemTagAssociation, RepresentById): class VisualizationTagAssociation(Base, ItemTagAssociation, RepresentById): __tablename__ = "visualization_tag_association" - id: Mapped[int] = mapped_column(primary_key=True) visualization_id: Mapped[int] = mapped_column(ForeignKey("visualization.id"), index=True, nullable=True) tag_id: Mapped[int] = mapped_column(ForeignKey("tag.id"), index=True, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) @@ -10844,7 +10726,6 @@ class VisualizationTagAssociation(Base, ItemTagAssociation, RepresentById): class HistoryDatasetCollectionTagAssociation(Base, ItemTagAssociation, RepresentById): __tablename__ = "history_dataset_collection_tag_association" - id: Mapped[int] = mapped_column(primary_key=True) history_dataset_collection_id: Mapped[int] = mapped_column( ForeignKey("history_dataset_collection_association.id"), index=True, nullable=True ) @@ -10860,7 +10741,6 @@ class HistoryDatasetCollectionTagAssociation(Base, ItemTagAssociation, Represent class LibraryDatasetCollectionTagAssociation(Base, ItemTagAssociation, RepresentById): __tablename__ = "library_dataset_collection_tag_association" - id: Mapped[int] = mapped_column(primary_key=True) library_dataset_collection_id: Mapped[int] = mapped_column( ForeignKey("library_dataset_collection_association.id"), index=True, nullable=True ) @@ -10876,7 +10756,6 @@ class LibraryDatasetCollectionTagAssociation(Base, ItemTagAssociation, Represent class ToolTagAssociation(Base, ItemTagAssociation, RepresentById): __tablename__ = "tool_tag_association" - id: Mapped[int] = mapped_column(primary_key=True) tool_id: Mapped[str] = mapped_column(TrimmedString(255), index=True, nullable=True) tag_id: Mapped[int] = mapped_column(ForeignKey("tag.id"), index=True, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) @@ -10891,7 +10770,6 @@ class HistoryAnnotationAssociation(Base, RepresentById): __tablename__ = "history_annotation_association" __table_args__ = (Index("ix_history_anno_assoc_annotation", "annotation", mysql_length=200),) - id: Mapped[int] = mapped_column(primary_key=True) history_id: Mapped[int] = mapped_column(ForeignKey("history.id"), index=True, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) annotation: Mapped[str] = mapped_column(TEXT, nullable=True) @@ -10903,7 +10781,6 @@ class HistoryDatasetAssociationAnnotationAssociation(Base, RepresentById): __tablename__ = "history_dataset_association_annotation_association" __table_args__ = (Index("ix_history_dataset_anno_assoc_annotation", "annotation", mysql_length=200),) - id: Mapped[int] = mapped_column(primary_key=True) history_dataset_association_id: Mapped[int] = mapped_column( ForeignKey("history_dataset_association.id"), index=True, nullable=True ) @@ -10917,7 +10794,6 @@ class StoredWorkflowAnnotationAssociation(Base, RepresentById): __tablename__ = "stored_workflow_annotation_association" __table_args__ = (Index("ix_stored_workflow_ann_assoc_annotation", "annotation", mysql_length=200),) - id: Mapped[int] = mapped_column(primary_key=True) stored_workflow_id: Mapped[int] = mapped_column(ForeignKey("stored_workflow.id"), index=True, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) annotation: Mapped[str] = mapped_column(TEXT, nullable=True) @@ -10929,7 +10805,6 @@ class WorkflowStepAnnotationAssociation(Base, RepresentById): __tablename__ = "workflow_step_annotation_association" __table_args__ = (Index("ix_workflow_step_ann_assoc_annotation", "annotation", mysql_length=200),) - id: Mapped[int] = mapped_column(primary_key=True) workflow_step_id: Mapped[int] = mapped_column(ForeignKey("workflow_step.id"), index=True, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) annotation: Mapped[str] = mapped_column(TEXT, nullable=True) @@ -10941,7 +10816,6 @@ class PageAnnotationAssociation(Base, RepresentById): __tablename__ = "page_annotation_association" __table_args__ = (Index("ix_page_annotation_association_annotation", "annotation", mysql_length=200),) - id: Mapped[int] = mapped_column(primary_key=True) page_id: Mapped[int] = mapped_column(ForeignKey("page.id"), index=True, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) annotation: Mapped[str] = mapped_column(TEXT, nullable=True) @@ -10953,7 +10827,6 @@ class VisualizationAnnotationAssociation(Base, RepresentById): __tablename__ = "visualization_annotation_association" __table_args__ = (Index("ix_visualization_annotation_association_annotation", "annotation", mysql_length=200),) - id: Mapped[int] = mapped_column(primary_key=True) visualization_id: Mapped[int] = mapped_column(ForeignKey("visualization.id"), index=True, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) annotation: Mapped[str] = mapped_column(TEXT, nullable=True) @@ -10964,7 +10837,6 @@ class VisualizationAnnotationAssociation(Base, RepresentById): class HistoryDatasetCollectionAssociationAnnotationAssociation(Base, RepresentById): __tablename__ = "history_dataset_collection_annotation_association" - id: Mapped[int] = mapped_column(primary_key=True) history_dataset_collection_id: Mapped[int] = mapped_column( ForeignKey("history_dataset_collection_association.id"), index=True, nullable=True ) @@ -10979,7 +10851,6 @@ class HistoryDatasetCollectionAssociationAnnotationAssociation(Base, RepresentBy class LibraryDatasetCollectionAnnotationAssociation(Base, RepresentById): __tablename__ = "library_dataset_collection_annotation_association" - id: Mapped[int] = mapped_column(primary_key=True) library_dataset_collection_id: Mapped[int] = mapped_column( ForeignKey("library_dataset_collection_association.id"), index=True, nullable=True ) @@ -10995,7 +10866,7 @@ class Vault(Base): key: Mapped[str] = mapped_column(Text, primary_key=True) parent_key: Mapped[Optional[str]] = mapped_column(Text, ForeignKey(key), index=True) children: Mapped[List["Vault"]] = relationship(back_populates="parent") - parent: Mapped[Optional["Vault"]] = relationship(back_populates="children", remote_side=[key]) + parent: Mapped[Optional["Vault"]] = relationship(back_populates="children", remote_side=lambda: Vault.key) value: Mapped[Optional[str]] = mapped_column(Text) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(default=now, onupdate=now, nullable=True) @@ -11018,7 +10889,6 @@ def _set_item(self, item): class HistoryRatingAssociation(ItemRatingAssociation, RepresentById): __tablename__ = "history_rating_association" - id: Mapped[int] = mapped_column(primary_key=True) history_id: Mapped[int] = mapped_column(ForeignKey("history.id"), index=True, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) rating: Mapped[int] = mapped_column(index=True, nullable=True) @@ -11033,7 +10903,6 @@ def _set_item(self, history): class HistoryDatasetAssociationRatingAssociation(ItemRatingAssociation, RepresentById): __tablename__ = "history_dataset_association_rating_association" - id: Mapped[int] = mapped_column(primary_key=True) history_dataset_association_id: Mapped[int] = mapped_column( ForeignKey("history_dataset_association.id"), index=True, nullable=True ) @@ -11050,7 +10919,6 @@ def _set_item(self, history_dataset_association): class StoredWorkflowRatingAssociation(ItemRatingAssociation, RepresentById): __tablename__ = "stored_workflow_rating_association" - id: Mapped[int] = mapped_column(primary_key=True) stored_workflow_id: Mapped[int] = mapped_column(ForeignKey("stored_workflow.id"), index=True, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) rating: Mapped[int] = mapped_column(index=True, nullable=True) @@ -11065,7 +10933,6 @@ def _set_item(self, stored_workflow): class PageRatingAssociation(ItemRatingAssociation, RepresentById): __tablename__ = "page_rating_association" - id: Mapped[int] = mapped_column(primary_key=True) page_id: Mapped[int] = mapped_column(ForeignKey("page.id"), index=True, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) rating: Mapped[int] = mapped_column(index=True, nullable=True) @@ -11080,7 +10947,6 @@ def _set_item(self, page): class VisualizationRatingAssociation(ItemRatingAssociation, RepresentById): __tablename__ = "visualization_rating_association" - id: Mapped[int] = mapped_column(primary_key=True) visualization_id: Mapped[int] = mapped_column(ForeignKey("visualization.id"), index=True, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) rating: Mapped[int] = mapped_column(index=True, nullable=True) @@ -11095,7 +10961,6 @@ def _set_item(self, visualization): class HistoryDatasetCollectionRatingAssociation(ItemRatingAssociation, RepresentById): __tablename__ = "history_dataset_collection_rating_association" - id: Mapped[int] = mapped_column(primary_key=True) history_dataset_collection_id: Mapped[int] = mapped_column( ForeignKey("history_dataset_collection_association.id"), index=True, nullable=True ) @@ -11112,7 +10977,6 @@ def _set_item(self, dataset_collection): class LibraryDatasetCollectionRatingAssociation(ItemRatingAssociation, RepresentById): __tablename__ = "library_dataset_collection_rating_association" - id: Mapped[int] = mapped_column(primary_key=True) library_dataset_collection_id: Mapped[int] = mapped_column( ForeignKey("library_dataset_collection_association.id"), index=True, nullable=True ) @@ -11130,7 +10994,6 @@ def _set_item(self, dataset_collection): class DataManagerHistoryAssociation(Base, RepresentById): __tablename__ = "data_manager_history_association" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(index=True, default=now, onupdate=now, nullable=True) history_id: Mapped[Optional[int]] = mapped_column(ForeignKey("history.id"), index=True) @@ -11143,7 +11006,6 @@ class DataManagerJobAssociation(Base, RepresentById): __tablename__ = "data_manager_job_association" __table_args__ = (Index("ix_data_manager_job_association_data_manager_id", "data_manager_id", mysql_length=200),) - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[datetime] = mapped_column(index=True, default=now, onupdate=now, nullable=True) job_id: Mapped[Optional[int]] = mapped_column(ForeignKey("job.id"), index=True) @@ -11154,7 +11016,6 @@ class DataManagerJobAssociation(Base, RepresentById): class UserPreference(Base, RepresentById): __tablename__ = "user_preference" - id: Mapped[int] = mapped_column(primary_key=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) name: Mapped[Optional[str]] = mapped_column(Unicode(255), index=True) value: Mapped[Optional[str]] = mapped_column(Text) @@ -11229,7 +11090,6 @@ class UserObjectStore(Base, HasConfigTemplate): __tablename__ = "user_object_store" secret_config_type = "object_store_config" - id: Mapped[int] = mapped_column(Integer, primary_key=True) user_id: Mapped[Optional[int]] = mapped_column(Integer, ForeignKey("galaxy_user.id"), index=True) uuid: Mapped[Union[UUID, str]] = mapped_column(UUIDType(), index=True) create_time: Mapped[datetime] = mapped_column(DateTime, default=now) @@ -11297,7 +11157,6 @@ class UserFileSource(Base, HasConfigTemplate): __tablename__ = "user_file_source" secret_config_type = "file_source_config" - id: Mapped[int] = mapped_column(primary_key=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) uuid: Mapped[Union[UUID, str]] = mapped_column(UUIDType(), index=True) create_time: Mapped[datetime] = mapped_column(default=now) @@ -11367,10 +11226,9 @@ def file_source_configuration( # TODO: add link from tool_request to this -class ToolLandingRequest(Base): +class ToolLandingRequest(Base, HasId): __tablename__ = "tool_landing_request" - id: Mapped[int] = mapped_column(primary_key=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) update_time: Mapped[Optional[datetime]] = mapped_column(index=True, default=now, onupdate=now, nullable=True) @@ -11385,10 +11243,9 @@ class ToolLandingRequest(Base): # TODO: add link from workflow_invocation to this -class WorkflowLandingRequest(Base): +class WorkflowLandingRequest(Base, HasId): __tablename__ = "workflow_landing_request" - id: Mapped[int] = mapped_column(primary_key=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) workflow_id: Mapped[Optional[int]] = mapped_column(ForeignKey("stored_workflow.id"), nullable=True) stored_workflow_id: Mapped[Optional[int]] = mapped_column(ForeignKey("workflow.id"), nullable=True) @@ -11410,7 +11267,6 @@ class WorkflowLandingRequest(Base): class UserAction(Base, RepresentById): __tablename__ = "user_action" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) session_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_session.id"), index=True) @@ -11423,7 +11279,6 @@ class UserAction(Base, RepresentById): class APIKeys(Base, RepresentById): __tablename__ = "api_keys" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("galaxy_user.id"), index=True) key: Mapped[Optional[str]] = mapped_column(TrimmedString(32), index=True, unique=True) @@ -11458,81 +11313,72 @@ def _prepare_metadata_for_serialization(id_encoder, serialization_options, metad # however making them models keeps things simple and consistent. -class CleanupEvent(Base): +class CleanupEvent(Base, HasId): __tablename__ = "cleanup_event" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) message: Mapped[Optional[str]] = mapped_column(TrimmedString(1024)) -class CleanupEventDatasetAssociation(Base): +class CleanupEventDatasetAssociation(Base, HasId): __tablename__ = "cleanup_event_dataset_association" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) cleanup_event_id: Mapped[int] = mapped_column(ForeignKey("cleanup_event.id"), index=True, nullable=True) dataset_id: Mapped[int] = mapped_column(ForeignKey("dataset.id"), index=True, nullable=True) -class CleanupEventMetadataFileAssociation(Base): +class CleanupEventMetadataFileAssociation(Base, HasId): __tablename__ = "cleanup_event_metadata_file_association" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) cleanup_event_id: Mapped[int] = mapped_column(ForeignKey("cleanup_event.id"), index=True, nullable=True) metadata_file_id: Mapped[int] = mapped_column(ForeignKey("metadata_file.id"), index=True, nullable=True) -class CleanupEventHistoryAssociation(Base): +class CleanupEventHistoryAssociation(Base, HasId): __tablename__ = "cleanup_event_history_association" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) cleanup_event_id: Mapped[int] = mapped_column(ForeignKey("cleanup_event.id"), index=True, nullable=True) history_id: Mapped[int] = mapped_column(ForeignKey("history.id"), index=True, nullable=True) -class CleanupEventHistoryDatasetAssociationAssociation(Base): +class CleanupEventHistoryDatasetAssociationAssociation(Base, HasId): __tablename__ = "cleanup_event_hda_association" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) cleanup_event_id: Mapped[int] = mapped_column(ForeignKey("cleanup_event.id"), index=True, nullable=True) hda_id: Mapped[int] = mapped_column(ForeignKey("history_dataset_association.id"), index=True, nullable=True) -class CleanupEventLibraryAssociation(Base): +class CleanupEventLibraryAssociation(Base, HasId): __tablename__ = "cleanup_event_library_association" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) cleanup_event_id: Mapped[int] = mapped_column(ForeignKey("cleanup_event.id"), index=True, nullable=True) library_id: Mapped[int] = mapped_column(ForeignKey("library.id"), index=True, nullable=True) -class CleanupEventLibraryFolderAssociation(Base): +class CleanupEventLibraryFolderAssociation(Base, HasId): __tablename__ = "cleanup_event_library_folder_association" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) cleanup_event_id: Mapped[int] = mapped_column(ForeignKey("cleanup_event.id"), index=True, nullable=True) library_folder_id: Mapped[int] = mapped_column(ForeignKey("library_folder.id"), index=True, nullable=True) -class CleanupEventLibraryDatasetAssociation(Base): +class CleanupEventLibraryDatasetAssociation(Base, HasId): __tablename__ = "cleanup_event_library_dataset_association" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) cleanup_event_id: Mapped[int] = mapped_column(ForeignKey("cleanup_event.id"), index=True, nullable=True) library_dataset_id: Mapped[int] = mapped_column(ForeignKey("library_dataset.id"), index=True, nullable=True) -class CleanupEventLibraryDatasetDatasetAssociationAssociation(Base): +class CleanupEventLibraryDatasetDatasetAssociationAssociation(Base, HasId): __tablename__ = "cleanup_event_ldda_association" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) cleanup_event_id: Mapped[int] = mapped_column(ForeignKey("cleanup_event.id"), index=True, nullable=True) ldda_id: Mapped[int] = mapped_column( @@ -11540,10 +11386,9 @@ class CleanupEventLibraryDatasetDatasetAssociationAssociation(Base): ) -class CleanupEventImplicitlyConvertedDatasetAssociationAssociation(Base): +class CleanupEventImplicitlyConvertedDatasetAssociationAssociation(Base, HasId): __tablename__ = "cleanup_event_icda_association" - id: Mapped[int] = mapped_column(primary_key=True) create_time: Mapped[datetime] = mapped_column(default=now, nullable=True) cleanup_event_id: Mapped[int] = mapped_column(ForeignKey("cleanup_event.id"), index=True, nullable=True) icda_id: Mapped[int] = mapped_column( @@ -11680,7 +11525,7 @@ def __repr__(self): HistoryDatasetAssociation.table.c.copied_from_history_dataset_association_id == HistoryDatasetAssociation.table.c.id ), - remote_side=[HistoryDatasetAssociation.table.c.id], + remote_side=lambda: HistoryDatasetAssociation.table.c.id, uselist=False, back_populates="copied_to_history_dataset_associations", ), @@ -11771,7 +11616,7 @@ def __repr__(self): LibraryDatasetDatasetAssociation.table.c.copied_from_library_dataset_dataset_association_id == LibraryDatasetDatasetAssociation.table.c.id ), - remote_side=[LibraryDatasetDatasetAssociation.table.c.id], + remote_side=lambda: LibraryDatasetDatasetAssociation.table.c.id, uselist=False, back_populates="copied_to_library_dataset_dataset_associations", ),