diff --git a/ereuse_devicehub/migrations/versions/aeca9fb50cc6_add_placeholder.py b/ereuse_devicehub/migrations/versions/aeca9fb50cc6_add_placeholder.py index d013b64e..9a3b8e25 100644 --- a/ereuse_devicehub/migrations/versions/aeca9fb50cc6_add_placeholder.py +++ b/ereuse_devicehub/migrations/versions/aeca9fb50cc6_add_placeholder.py @@ -48,9 +48,10 @@ def upgrade(): sa.Column('device_id', sa.BigInteger(), nullable=False), sa.ForeignKeyConstraint(['device_id'], [f'{get_inv()}.device.id']), 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.drop_table('placeholder') + op.execute("DROP SEQUENCE placeholder_seq;") diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index 0a6a17e4..0dd308e4 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -827,6 +827,7 @@ class DisplayMixin: class Placeholder(Thing): + __table_args__ = {'schema': ''} id = Column(BigInteger, Sequence('placeholder_seq'), primary_key=True) pallet = Column(Unicode(), nullable=True) phid = Column(Unicode(), nullable=False, default=create_phid)