Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

Add batchSize to event subscriptions

Sidwebworksbda96d8e72cf
diff --git a/packages/database/src/event.ts b/packages/database/src/event.ts
index e18f3939c7..28fad30db9 100644
--- a/packages/database/src/event.ts
+++ b/packages/database/src/event.ts
@@ -74,8 +74,6 @@ export const CreateSubscriptionSchema = z.object({
config: z.record(z.any()).default({}),
// Database-level filtering (e.g. { status: "paid" })
filter: z.record(z.any()).default({}),
- // Optimization: specific batch size for PGMQ
- batchSize: z.number().int().positive().default(50),
// Defaults to true
active: z.boolean().default(true)
});
@@ -102,7 +100,6 @@ export async function createEventSystemSubscription(
filter: params.filter,
handlerType: params.type,
config: params.config,
- batchSize: params.batchSize,
active: params.active
})
.onConflict((oc) =>
@@ -111,7 +108,6 @@ export async function createEventSystemSubscription(
filter: params.filter,
handlerType: params.type,
config: params.config,
- batchSize: params.batchSize,
active: params.active
})
)
diff --git a/packages/database/src/swagger-docs-schema.ts b/packages/database/src/swagger-docs-schema.ts
index 2659ba5f78..3cfb25bb53 100644
--- a/packages/database/src/swagger-docs-schema.ts
+++ b/packages/database/src/swagger-docs-schema.ts
@@ -23916,9 +23916,6 @@ export default {
{
$ref: "#/parameters/rowFilter.eventSystemSubscription.config",
},
- {
- $ref: "#/parameters/rowFilter.eventSystemSubscription.batchSize",
- },
{
$ref: "#/parameters/rowFilter.eventSystemSubscription.active",
},
@@ -24008,9 +24005,6 @@ export default {
{
$ref: "#/parameters/rowFilter.eventSystemSubscription.config",
},
- {
- $ref: "#/parameters/rowFilter.eventSystemSubscription.batchSize",
- },
{
$ref: "#/parameters/rowFilter.eventSystemSubscription.active",
},
@@ -24054,9 +24048,6 @@ export default {
{
$ref: "#/parameters/rowFilter.eventSystemSubscription.config",
},
- {
- $ref: "#/parameters/rowFilter.eventSystemSubscription.batchSize",
- },
{
$ref: "#/parameters/rowFilter.eventSystemSubscription.active",
},
@@ -78456,11 +78447,6 @@ export default {
config: {
format: "jsonb",
},
- batchSize: {
- default: 50,
- format: "integer",
- type: "integer",
- },
active: {
default: true,
format: "boolean",
@@ -109925,12 +109911,6 @@ export default {
in: "query",
type: "string",
},
- "rowFilter.eventSystemSubscription.batchSize": {
- name: "batchSize",
- required: false,
- in: "query",
- type: "string",
- },
"rowFilter.eventSystemSubscription.active": {
name: "active",
required: false,
diff --git a/packages/database/src/types.ts b/packages/database/src/types.ts
index 352fa20e85..05119d8c1b 100644
--- a/packages/database/src/types.ts
+++ b/packages/database/src/types.ts
@@ -7076,7 +7076,6 @@ export type Database = {
eventSystemSubscription: {
Row: {
active: boolean | null
- batchSize: number | null
companyId: string
config: Json
createdAt: string | null
@@ -7089,7 +7088,6 @@ export type Database = {
}
Insert: {
active?: boolean | null
- batchSize?: number | null
companyId: string
config?: Json
createdAt?: string | null
@@ -7102,7 +7100,6 @@ export type Database = {
}
Update: {
active?: boolean | null
- batchSize?: number | null
companyId?: string
config?: Json
createdAt?: string | null
diff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.ts
index 352fa20e85..8d0b9e6a8f 100644
--- a/packages/database/supabase/functions/lib/types.ts
+++ b/packages/database/supabase/functions/lib/types.ts
@@ -7076,7 +7076,6 @@ export type Database = {
eventSystemSubscription: {
Row: {
active: boolean | null
- batchSize: number | null
companyId: string
config: Json
createdAt: string | null
@@ -7089,7 +7088,6 @@ export type Database = {
}
Insert: {
active?: boolean | null
- batchSize?: number | null
companyId: string
config?: Json
createdAt?: string | null
@@ -7102,7 +7100,6 @@ export type Database = {
}
Update: {
active?: boolean | null
- batchSize?: number | null
companyId?: string
config?: Json
createdAt?: string | null
@@ -48754,14 +48751,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["supplierCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["supplierCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
@@ -51885,14 +51882,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["invoiceCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["invoiceCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
@@ -52435,14 +52432,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["paymentCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["paymentCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
diff --git a/packages/database/supabase/migrations/20260204070000_remove-event-system-batch-size.sql b/packages/database/supabase/migrations/20260204070000_remove-event-system-batch-size.sql
new file mode 100644
index 0000000000..e10737c210
--- /dev/null
+++ b/packages/database/supabase/migrations/20260204070000_remove-event-system-batch-size.sql
@@ -0,0 +1,4 @@
+-- Remove unused batchSize column from eventSystemSubscription
+-- This field was never actually used in the event processing logic
+
+ALTER TABLE "eventSystemSubscription" DROP COLUMN IF EXISTS "batchSize";