Files
app/backend/fluksio/alembic/versions/c7e2b9f34a15_flavor_table.py
stroblmeandClaude Opus 5 d01a8dad37 Rename Installation to Instance
Follows the portal: the noun is "instance" everywhere the app says it —
UI strings, CLI output, error details, docs and comments. The wire keys
(`instance_id`, `instance_token`) and the hub route this calls move with it.

An existing cloud.json is adopted rather than refused: without the key
alias the dataclass fails to parse, which the caller swallows and reads as
"never enrolled" instead of "reconnect".

`instance_key` on a node type becomes `target_key`. It means the outside
thing a node points at, which is a different sense of the word, and keeping
both would put two meanings of "instance" in one codebase.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015YrQnKV3bnQd4K342y8tKj
2026-08-31 10:12:01 +02:00

43 lines
1.1 KiB
Python

"""flavor
A named amount of machine — cores, cards and memory — so a node can ask for one
by name. Seeded with a few sizes on first start, and editable afterwards: what
"gpu-small" means is a property of the machines an instance has, and those
change.
Revision ID: c7e2b9f34a15
Revises: b3f1a7c50d92
Create Date: 2026-08-27
"""
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
from alembic import op
# revision identifiers, used by Alembic.
revision = "c7e2b9f34a15"
down_revision = "b3f1a7c50d92"
branch_labels = None
depends_on = None
def upgrade():
op.create_table(
"flavor",
sa.Column("name", sqlmodel.sql.sqltypes.AutoString(length=64), nullable=False),
sa.Column("cpus", sa.Integer(), nullable=False),
sa.Column("gpus", sa.Integer(), nullable=False),
sa.Column("ram", sa.Integer(), nullable=False),
sa.Column(
"description",
sqlmodel.sql.sqltypes.AutoString(length=255),
nullable=False,
),
sa.PrimaryKeyConstraint("name"),
)
def downgrade():
op.drop_table("flavor")