From 4507a3206c65c77823fad6740263a90584f7c294 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 7 Jul 2022 16:18:51 +0200 Subject: [PATCH] add secuence and remove schema for placeholder_log --- .../migrations/versions/3e3a67f62972_placeholder_log.py | 3 ++- .../migrations/versions/aeca9fb50cc6_add_placeholder.py | 2 ++ ereuse_devicehub/parser/models.py | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/migrations/versions/3e3a67f62972_placeholder_log.py b/ereuse_devicehub/migrations/versions/3e3a67f62972_placeholder_log.py index aee0d162..b3850218 100644 --- a/ereuse_devicehub/migrations/versions/3e3a67f62972_placeholder_log.py +++ b/ereuse_devicehub/migrations/versions/3e3a67f62972_placeholder_log.py @@ -56,9 +56,10 @@ def upgrade(): ['common.user.id'], ), sa.PrimaryKeyConstraint('id'), - schema=f'{get_inv()}', ) + op.execute("CREATE SEQUENCE placeholders_log_seq START 1;") def downgrade(): op.drop_table('placeholders_log') + op.execute("DROP SEQUENCE placeholders_log_seq;") diff --git a/ereuse_devicehub/migrations/versions/aeca9fb50cc6_add_placeholder.py b/ereuse_devicehub/migrations/versions/aeca9fb50cc6_add_placeholder.py index d013b64e..878cb6ec 100644 --- a/ereuse_devicehub/migrations/versions/aeca9fb50cc6_add_placeholder.py +++ b/ereuse_devicehub/migrations/versions/aeca9fb50cc6_add_placeholder.py @@ -50,7 +50,9 @@ def upgrade(): sa.PrimaryKeyConstraint('id'), schema=f'{get_inv()}', ) + op.execute("CREATE SEQUENCE placeholder_seq START 1;") def downgrade(): op.drop_table('placeholder', schema=f'{get_inv()}') + op.execute("DROP SEQUENCE placeholder_log_seq;") diff --git a/ereuse_devicehub/parser/models.py b/ereuse_devicehub/parser/models.py index 61d4839d..d8b4b62b 100644 --- a/ereuse_devicehub/parser/models.py +++ b/ereuse_devicehub/parser/models.py @@ -49,7 +49,8 @@ class SnapshotsLog(Thing): class PlaceholdersLog(Thing): """A Placeholder log.""" - id = Column(BigInteger, Sequence('snapshots_log_seq'), primary_key=True) + __table_args__ = {'schema': ''} + id = Column(BigInteger, Sequence('placeholders_log_seq'), primary_key=True) source = Column(CIText(), default='', nullable=True) type = Column(CIText(), default='', nullable=True) severity = Column(SmallInteger, default=Severity.Info, nullable=False)