Create a table in the project's database
database_table_createCreate one ordinary table in the public schema of a Dev or Prod database, as the migration role with the same access as migration tables, so a row-change watch can attach later. Each column has a lower-case name, a type (text, integer, bigint, boolean, numeric, double precision, timestamptz, date, uuid or jsonb) and optional nullable, identity (integer or bigint only) and default (now for timestamptz, uuid for uuid); at most 64 columns, 8 primary-key columns and 100 tables per database. An identical repeat answers created: false; a table of the same name with another definition is refused with database_table_conflict. Tables created this way are not in the repository's migration files: record them in project notes and add a migration when the source should reproduce the database. Requires confirmed: true and an idempotency key. Refused with project_budget_exceeded while the Stop budget is reached. If the selected environment has no database, follow database_not_set_up.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"table": "orders",
"columns": [
{
"name": "id",
"type": "bigint",
"identity": true,
"nullable": false
},
{
"name": "total",
"type": "numeric"
}
],
"environment": "dev",
"primary_key": [
"id"
]
},
"name": "database_table_create"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Name of the new table in the public schema. Lower-case, not a PostgreSQL reserved word and not starting with pg_. | |
| columns | Yes | Columns in the order written. Names are unique, and at most one column is an identity column. | |
| confirmed | Yes | ||
| project_id | Yes | Project identifier. | |
| environment | Yes | ||
| primary_key | No | Columns of the primary key, each one of the table's columns. Identity and primary key columns are NOT NULL; omitted when the table has no primary key. | |
| idempotency_key | Yes | Identifies one mutation and its canonical request payload. |