deckhand.db.sqlalchemy.models module

class deckhand.db.sqlalchemy.models.DeckhandBase[source]

Bases: oslo_db.sqlalchemy.models.ModelBase, oslo_db.sqlalchemy.models.TimestampMixin

Base class for Deckhand Models.

created_at = Column(None, DateTime(), table=None, nullable=False, default=CallableColumnDefault(<function DeckhandBase.<lambda>>))
deleted = Column(None, Boolean(), table=None, nullable=False, default=ScalarElementColumnDefault(False))
deleted_at = Column(None, DateTime(), table=None)
items()[source]

Make the model object behave like a dict.

keys()[source]

Make the model object behave like a dict.

safe_delete(session=None)[source]
save(session=None)[source]

Save this object.

to_dict()[source]

Convert the object into dictionary format.

updated_at = Column(None, DateTime(), table=None, onupdate=CallableColumnDefault(<function DeckhandBase.<lambda>>), default=CallableColumnDefault(<function DeckhandBase.<lambda>>))
values()[source]
deckhand.db.sqlalchemy.models.create_tables(engine)[source]

Creates database tables for all models with the given engine.

This will be done only by tests that do not have their tables set up by Alembic running during the associated helm chart db_sync job.

deckhand.db.sqlalchemy.models.register_models(engine, connection_string)[source]

Register the sqlalchemy tables itno the BASE.metadata

Sets up the database model objects. Does not create the tables in the associated configured database. (see create_tables)

deckhand.db.sqlalchemy.models.unregister_models(engine)[source]

Drop database tables for all models with the given engine.