Move the Select class before the config classes in db model to avoid potential errors when upgrading the database

This commit is contained in:
Théophile Diot 2024-05-25 14:56:14 +01:00
parent 11154cb43f
commit 03bc5538fd
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -90,6 +90,15 @@ class Settings(Base):
plugin = relationship("Plugins", back_populates="settings")
class Selects(Base):
__tablename__ = "bw_selects"
setting_id = Column(String(256), ForeignKey("bw_settings.id", onupdate="cascade", ondelete="cascade"), primary_key=True)
value = Column(String(256), primary_key=True)
setting = relationship("Settings", back_populates="selects")
class Global_values(Base):
__tablename__ = "bw_global_values"
@ -186,15 +195,6 @@ class Custom_configs(Base):
service = relationship("Services", back_populates="custom_configs")
class Selects(Base):
__tablename__ = "bw_selects"
setting_id = Column(String(256), ForeignKey("bw_settings.id", onupdate="cascade", ondelete="cascade"), primary_key=True)
value = Column(String(256), primary_key=True)
setting = relationship("Settings", back_populates="selects")
class Instances(Base):
__tablename__ = "bw_instances"