x402

Schema Migration Generate (x402)

Generate database migration code from current→desired schema description. Supports Drizzle, Prisma, Knex, and raw SQL.

get/x402/v2/schema-migration-generate

Request

  • Base URL: https://api.strale.io
  • URL: https://api.strale.io/x402/v2/schema-migration-generate
  • Auth: none required

Query parameters

ormstring

drizzle/prisma/knex/raw

current_schemastring
desired_schemastring required

Response

Success

ormstring
migration_upstring
migration_downstring

Example response

{
  "orm": "raw",
  "up_sql": "ALTER TABLE users ADD COLUMN email VARCHAR(255);",
  "down_sql": "ALTER TABLE users DROP COLUMN email;",
  "warnings": [
    "New column 'email' is nullable by default. Existing rows will have NULL values for email.",
    "If email should be unique or NOT NULL, consider adding constraints after migration and populating existing rows.",
    "Application code expecting email field may receive NULL values from existing records."
  ],
  "migration": "ALTER TABLE users ADD COLUMN email VARCHAR(255);",
  "breaking_changes": []
}

Changes

No recorded changes to this operation across all 1 revision of this API.