mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 12:15:20 +01:00
Merge pull request #5384 from wy65701436/update-migrator-aj
Update migrator for admin job
This commit is contained in:
commit
0f7eab38b7
@ -281,4 +281,19 @@ class SchemaMigrations(Base):
|
||||
__tablename__ = 'schema_migrations'
|
||||
|
||||
version = sa.Column(sa.BigInteger, primary_key=True)
|
||||
dirty = sa.Column(sa.Boolean, nullable=False)
|
||||
dirty = sa.Column(sa.Boolean, nullable=False)
|
||||
|
||||
class AdminJob(Base):
|
||||
__tablename__ = 'admin_job'
|
||||
|
||||
id = sa.Column(sa.Integer, primary_key=True)
|
||||
job_name = sa.Column(sa.String(64), nullable=False)
|
||||
job_kind = sa.Column(sa.String(64), nullable=False)
|
||||
cron_str = sa.Column(sa.String(256))
|
||||
status = sa.Column(sa.String(64), nullable=False)
|
||||
job_uuid = sa.Column(sa.String(64))
|
||||
deleted = sa.Column(sa.Boolean, nullable=False, server_default='false')
|
||||
creation_time = sa.Column(sa.TIMESTAMP, server_default=sa.text("'now'::timestamp"))
|
||||
update_time = sa.Column(sa.TIMESTAMP, server_default=sa.text("'now'::timestamp"))
|
||||
|
||||
__table_args__ = (sa.Index('status', "job_uuid"),)
|
@ -45,6 +45,10 @@ def upgrade():
|
||||
SchemaMigrations.__table__.create(bind)
|
||||
session.add(SchemaMigrations(version=1, dirty=False))
|
||||
|
||||
## Add table admin_job
|
||||
AdminJob.__table__.create(bind)
|
||||
op.execute('CREATE TRIGGER admin_job_update_time_at_modtime BEFORE UPDATE ON admin_job FOR EACH ROW EXECUTE PROCEDURE update_update_time_at_column();')
|
||||
|
||||
session.commit()
|
||||
|
||||
def downgrade():
|
||||
|
Loading…
Reference in New Issue
Block a user