# `mix attesto_mcp.gen.session_migration`
[🔗](https://github.com/XukuLLC/attesto_mcp/blob/v1.0.5/lib/mix/tasks/attesto_mcp.gen.session_migration.ex#L5)

Generates an Ecto migration that creates the `attesto_mcp_sessions` table
backing `AttestoMCP.Anubis.SessionStore.Ecto` (a Postgres-backed
`Anubis.Server.Session.Store` adapter).

One row per MCP session, keyed by the client's `Mcp-Session-Id`; `state` is the
serialized Anubis session map (client_info, capabilities, `frame`), persisted
so a client can reconnect after a deploy with its initialized state restored.

## Usage

    mix attesto_mcp.gen.session_migration --repo MyApp.Repo

## Options

  * `--repo` - the Ecto repo the migration is generated for. May be given more
    than once. When omitted the host application's configured repos are used.
  * `--migrations-path` - directory the migration file is written to. Defaults
    to the repo's `priv/<repo>/migrations`.

The generated migration is reversible.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
