repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | """add_config_table |
| #2 | |
| #3 | Revision ID: add_config_table |
| #4 | Revises: 0b53c747049a |
| #5 | Create Date: 2023-06-01 10:00:00.000000 |
| #6 | |
| #7 | """ |
| #8 | import uuid |
| #9 | |
| #10 | import sqlalchemy as sa |
| #11 | from alembic import op |
| #12 | |
| #13 | # revision identifiers, used by Alembic. |
| #14 | revision = 'add_config_table' |
| #15 | down_revision = '0b53c747049a' |
| #16 | branch_labels = None |
| #17 | depends_on = None |
| #18 | |
| #19 | |
| #20 | def upgrade(): |
| #21 | # Create configs table if it doesn't exist |
| #22 | op.create_table( |
| #23 | 'configs', |
| #24 | sa.Column('id', sa.UUID(), nullable=False, default=lambda: uuid.uuid4()), |
| #25 | sa.Column('key', sa.String(), nullable=False), |
| #26 | sa.Column('value', sa.JSON(), nullable=False), |
| #27 | sa.Column('created_at', sa.DateTime(), nullable=True), |
| #28 | sa.Column('updated_at', sa.DateTime(), nullable=True), |
| #29 | sa.PrimaryKeyConstraint('id'), |
| #30 | sa.UniqueConstraint('key') |
| #31 | ) |
| #32 | |
| #33 | # Create index for key lookups |
| #34 | op.create_index('idx_configs_key', 'configs', ['key']) |
| #35 | |
| #36 | |
| #37 | def downgrade(): |
| #38 | # Drop the configs table |
| #39 | op.drop_index('idx_configs_key', 'configs') |
| #40 | op.drop_table('configs') |