Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,18 @@ jobs:

if [ "${ENVIRONMENT}" = "dev" ]; then
echo "Dev environment — pushing schema directly (db:push)"
bun run db:push --force
# `--force` only suppresses the data-loss confirm, not drizzle's
# rename-vs-drop prompt, which fires (and crashes, no TTY) when a
# diff both adds and drops tables/columns at once. Turn that opaque
# crash into an actionable failure instead of a bare stack trace.
push_output="$(bun run db:push --force 2>&1)" && push_status=0 || push_status=$?
echo "$push_output"
if [ "$push_status" -ne 0 ]; then
if printf '%s' "$push_output" | grep -q 'Interactive prompts require a TTY'; then
echo "::error title=Dev schema push needs manual reconciliation::drizzle-kit push hit an interactive rename/drop prompt that CI cannot answer. The dev DB has drifted from schema.ts: it still holds table(s)/column(s) the schema no longer declares while the schema also adds new ones, so drizzle cannot tell a rename from a drop+create. Fix: drop the stale objects on the dev DB to match schema.ts — the same DROPs the latest versioned migration already applied to staging/prod (grep packages/db/migrations for the most recent DROP TABLE / DROP COLUMN) — then re-run this workflow. --force cannot bypass this prompt."
fi
exit "$push_status"
fi
else
echo "Applying versioned migrations (db:migrate)"
bun run ./scripts/migrate.ts
Expand Down
25 changes: 23 additions & 2 deletions apps/sim/lib/copilot/generated/tool-catalog-v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3870,6 +3870,22 @@ export const UserTable: ToolCatalogEntry = {
type: 'object',
description: 'Arguments for the operation',
properties: {
after: {
type: 'object',
description:
"Keyset cursor for query_rows: pass the nextCursor object ({ orderKey, id }) from the previous page's response to fetch the next page on the default row order. Cannot be combined with sort; takes precedence over offset.",
properties: {
id: {
type: 'string',
description: 'id of the last row of the previous page (from nextCursor).',
},
orderKey: {
type: 'string',
description: 'orderKey of the last row of the previous page (from nextCursor).',
},
},
required: ['orderKey', 'id'],
},
autoRun: {
type: 'boolean',
description:
Expand Down Expand Up @@ -3958,7 +3974,8 @@ export const UserTable: ToolCatalogEntry = {
},
limit: {
type: 'number',
description: 'Maximum rows to return or affect (optional, default 100)',
description:
'Maximum rows to return or affect (optional; default 100, max 1000). For delete_rows_by_filter, omitting it lets matches above 1000 run as a background job.',
},
mapping: {
type: 'object',
Expand Down Expand Up @@ -4011,7 +4028,8 @@ export const UserTable: ToolCatalogEntry = {
},
offset: {
type: 'number',
description: 'Number of rows to skip (optional for query_rows, default 0)',
description:
'Number of rows to skip (optional for query_rows, default 0). For paging past more than a few pages, prefer the after cursor — offset re-scans every prior row.',
},
outputColumnNames: {
type: 'object',
Expand Down Expand Up @@ -4148,6 +4166,7 @@ export const UserTable: ToolCatalogEntry = {
'import_file',
'get',
'get_schema',
'get_job',
'delete',
'rename',
'insert_row',
Expand Down Expand Up @@ -4527,6 +4546,7 @@ export const UserTableOperation = {
importFile: 'import_file',
get: 'get',
getSchema: 'get_schema',
getJob: 'get_job',
delete: 'delete',
rename: 'rename',
insertRow: 'insert_row',
Expand Down Expand Up @@ -4563,6 +4583,7 @@ export const UserTableOperationValues = [
UserTableOperation.importFile,
UserTableOperation.get,
UserTableOperation.getSchema,
UserTableOperation.getJob,
UserTableOperation.delete,
UserTableOperation.rename,
UserTableOperation.insertRow,
Expand Down
23 changes: 21 additions & 2 deletions apps/sim/lib/copilot/generated/tool-schemas-v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3590,6 +3590,22 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
type: 'object',
description: 'Arguments for the operation',
properties: {
after: {
type: 'object',
description:
"Keyset cursor for query_rows: pass the nextCursor object ({ orderKey, id }) from the previous page's response to fetch the next page on the default row order. Cannot be combined with sort; takes precedence over offset.",
properties: {
id: {
type: 'string',
description: 'id of the last row of the previous page (from nextCursor).',
},
orderKey: {
type: 'string',
description: 'orderKey of the last row of the previous page (from nextCursor).',
},
},
required: ['orderKey', 'id'],
},
autoRun: {
type: 'boolean',
description:
Expand Down Expand Up @@ -3686,7 +3702,8 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
},
limit: {
type: 'number',
description: 'Maximum rows to return or affect (optional, default 100)',
description:
'Maximum rows to return or affect (optional; default 100, max 1000). For delete_rows_by_filter, omitting it lets matches above 1000 run as a background job.',
},
mapping: {
type: 'object',
Expand Down Expand Up @@ -3745,7 +3762,8 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
},
offset: {
type: 'number',
description: 'Number of rows to skip (optional for query_rows, default 0)',
description:
'Number of rows to skip (optional for query_rows, default 0). For paging past more than a few pages, prefer the after cursor — offset re-scans every prior row.',
},
outputColumnNames: {
type: 'object',
Expand Down Expand Up @@ -3894,6 +3912,7 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
'import_file',
'get',
'get_schema',
'get_job',
'delete',
'rename',
'insert_row',
Expand Down
Loading
Loading