feat(proxy): rewrite the meta module to support hot spares
This commit is contained in:
parent
9f726731c6
commit
8115966aca
4 changed files with 327 additions and 99 deletions
29
migrations/versions/278bcfb487d3_add_hot_spare_pool.py
Normal file
29
migrations/versions/278bcfb487d3_add_hot_spare_pool.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
"""Add hot spare pool
|
||||
|
||||
Revision ID: 278bcfb487d3
|
||||
Revises: 2d747ffb9928
|
||||
Create Date: 2023-05-30 16:08:37.770371
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
from sqlalchemy.sql import text
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '278bcfb487d3'
|
||||
down_revision = '2d747ffb9928'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# Add SQL here
|
||||
sql = text("""INSERT INTO pool VALUES (
|
||||
-1, 'Hot spares (reserve)', NOW(), NOW(), NULL, 'hotspare',
|
||||
md5(to_char(NOW(), 'YYYY-MM-DD HH24:MI:SS.US')), NULL) ON CONFLICT (id) DO NOTHING;""")
|
||||
op.execute(sql)
|
||||
|
||||
|
||||
def downgrade():
|
||||
# SQL to undo the changes
|
||||
sql = text("""DELETE FROM pool WHERE id = -1;""")
|
||||
op.execute(sql)
|
Loading…
Add table
Add a link
Reference in a new issue