Migration Execution [deprecated]
https://{your-workspace-slug}.{region}.xata.sh/db/db_branch_name/migrations/execute
This endpoint is called in the style of an RPC (Remote Procedure Call) when a migration is to be executed against a specific database.
Expected Parameters
Name | Description | In | Required | Schema |
---|---|---|---|---|
db_branch_name | The DBBranchName matches the pattern `{db_name}:{branch_name}`. | path | ✅ | string |
Migrate Branch [Deprecated]
POSThttps://{your-workspace-slug}.{region}.xata.sh/db/db_branch_name/migrations/execute
Apply a migration plan to the branch
Request Body Type Definition
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
type ExecuteBranchMigrationPlan = { version: number; migration: BranchMigration; }; type BranchMigration = { id?: string; parentID?: string; status: string; title?: string; lastGitRevision?: string; localChanges: boolean; createdAt?: DateTime; newTables?: { [key: string]: Table; }; removedTables?: string[]; tableMigrations?: { [key: string]: TableMigration; }; newTableOrder: string[]; renamedTables?: TableRename[]; }; /** * @format date-time */ type DateTime = string; type Table = { id?: string; name: TableName; columns: Column[]; revLinks?: RevLink[]; }; type TableMigration = { newColumns?: { [key: string]: Column; }; removedColumns?: string[]; modifiedColumns?: ColumnMigration[]; newColumnOrder: string[]; }; /** * @example {"newName":"newName","oldName":"oldName"} */ type TableRename = { /* * @minLength 1 */ newName: string; /* * @minLength 1 */ oldName: string; }; /** * @maxLength 255 * @minLength 1 * @pattern [a-zA-Z0-9_\-~]+ */ type TableName = string; type Column = { name: string; type: "bool" | "int" | "float" | "string" | "text" | "email" | "multiple" | "link" | "object" | "datetime" | "vector" | "file[]" | "file"; link?: ColumnLink; vector?: ColumnVector; notNull?: boolean; defaultValue?: string; unique?: boolean; columns?: Column[]; }; type RevLink = { linkID: string; table: string; }; type ColumnMigration = { old: Column; ["new"]: Column; }; type ColumnLink = { table: string; }; type ColumnVector = { /* * @maximum 10000 * @minimum 2 */ dimension: number; };
Status Code | Description | Example Response/Type Definition |
---|---|---|
200 | Schema migration response with ID and migration status. |
|
400 | Bad Request |
|
401 | Authentication Error |
|
404 | Example response |
|
5XX | Unexpected Error |