diff --git a/schema/versions/57c38b5f012e_capabilities_init.py b/schema/versions/57c38b5f012e_capabilities_init.py index 05ea0aab865876f807e993b0b72c9aec225c5176..bd8ddb4bb606e7379557574745ec07b9316d4768 100644 --- a/schema/versions/57c38b5f012e_capabilities_init.py +++ b/schema/versions/57c38b5f012e_capabilities_init.py @@ -22,7 +22,7 @@ def upgrade(): sa.Column("capability_name", sa.String, primary_key=True), sa.Column("capability_steps", sa.String), sa.Column("max_jobs", sa.Integer), - sa.Column("enabled", sa.Boolean, server_default="True"), + sa.Column("enabled", sa.Boolean, default=True, server_default="true"), ) op.create_table( diff --git a/services/capability/test/test_capability_placeholder.py b/services/capability/test/test_capability_placeholder.py deleted file mode 100644 index 45b2bd089d5d69dd346e1e7fcbbda1e32c415b67..0000000000000000000000000000000000000000 --- a/services/capability/test/test_capability_placeholder.py +++ /dev/null @@ -1,2 +0,0 @@ -def test_placeholder(): - pass \ No newline at end of file diff --git a/shared/workspaces/workspaces/capability/schema.py b/shared/workspaces/workspaces/capability/schema.py index 2f2c33865b5af05b45eca4dbbb731a62f65d7248..0905ffb1048c3dce8023d401da71a9dfd05af67f 100644 --- a/shared/workspaces/workspaces/capability/schema.py +++ b/shared/workspaces/workspaces/capability/schema.py @@ -54,7 +54,7 @@ class Capability(Base, CapabilityIF): name = sa.Column("capability_name", sa.String, primary_key=True) steps = sa.Column("capability_steps", sa.String) max_jobs = sa.Column("max_jobs", sa.Integer) - enabled = sa.Column("enabled", sa.Boolean, default=True) + enabled = sa.Column("enabled", sa.Boolean, default=True, server_default="true") requests = relationship("CapabilityRequest", back_populates="capability") @classmethod @@ -82,6 +82,8 @@ class Capability(Base, CapabilityIF): self.name = json_dict["name"] self.max_jobs = json_dict["max_jobs"] self.steps = json_dict["steps"] + self.enabled = json_dict.get("enabled", True) + return self @staticmethod @@ -119,11 +121,12 @@ class Capability(Base, CapabilityIF): "name": self.name, "max_jobs": self.max_jobs, "steps": str(self.steps), + "enabled": self.enabled, } def __str__(self): return ( - f"Capability object with name {self.name} and max simultaneous jobs of {self.max_jobs}" + f"Capability: {self.name}, max concurrent jobs of {self.max_jobs}" f"\nSequence: {self.steps}" )