Skip to content

Commit

Permalink
fix(sql): Add length to machine_id field for mysql compatibility (cro…
Browse files Browse the repository at this point in the history
  • Loading branch information
julienloizelet committed Feb 29, 2024
1 parent b62e704 commit 334eae8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,7 @@ src/cscapi/_version.py
*.db

#vscode
.vscode
.vscode

#ddev
.ddev
5 changes: 3 additions & 2 deletions src/cscapi/sql_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
ForeignKey,
Integer,
TEXT,
String,
create_engine,
delete,
update,
Expand Down Expand Up @@ -50,7 +51,7 @@ class MachineDBModel(Base):
__tablename__ = "machine_models"

id = Column(Integer, primary_key=True, autoincrement=True)
machine_id = Column(TEXT, unique=True)
machine_id = Column(String(256), unique=True)
token = Column(TEXT)
password = Column(TEXT)
scenarios = Column(TEXT)
Expand Down Expand Up @@ -109,7 +110,7 @@ class SignalDBModel(Base):

alert_id = Column(Integer, primary_key=True, autoincrement=True)
created_at = Column(TEXT)
machine_id = Column(TEXT)
machine_id = Column(String(256))
scenario_version = Column(TEXT, nullable=True)
message = Column(TEXT, nullable=True)
uuid = Column(TEXT)
Expand Down

0 comments on commit 334eae8

Please sign in to comment.