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.

fix: migration error

Brad Barbin9034475a1846
diff --git a/packages/database/src/swagger-docs-schema.ts b/packages/database/src/swagger-docs-schema.ts
index f2dc45f080..89d78203ba 100644
--- a/packages/database/src/swagger-docs-schema.ts
+++ b/packages/database/src/swagger-docs-schema.ts
@@ -678,177 +678,6 @@ export default {
tags: ["noQuoteReason"],
},
},
- "/supplierStatus": {
- get: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.supplierStatus.id",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.name",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.companyId",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.createdAt",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.createdBy",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.updatedBy",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.updatedAt",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.customFields",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.tags",
- },
- {
- $ref: "#/parameters/select",
- },
- {
- $ref: "#/parameters/order",
- },
- {
- $ref: "#/parameters/range",
- },
- {
- $ref: "#/parameters/rangeUnit",
- },
- {
- $ref: "#/parameters/offset",
- },
- {
- $ref: "#/parameters/limit",
- },
- {
- $ref: "#/parameters/preferCount",
- },
- ],
- responses: {
- "200": {
- description: "OK",
- schema: {
- items: {
- $ref: "#/definitions/supplierStatus",
- },
- type: "array",
- },
- },
- "206": {
- description: "Partial Content",
- },
- },
- tags: ["supplierStatus"],
- },
- post: {
- parameters: [
- {
- $ref: "#/parameters/body.supplierStatus",
- },
- {
- $ref: "#/parameters/select",
- },
- {
- $ref: "#/parameters/preferPost",
- },
- ],
- responses: {
- "201": {
- description: "Created",
- },
- },
- tags: ["supplierStatus"],
- },
- delete: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.supplierStatus.id",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.name",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.companyId",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.createdAt",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.createdBy",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.updatedBy",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.updatedAt",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.customFields",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.tags",
- },
- {
- $ref: "#/parameters/preferReturn",
- },
- ],
- responses: {
- "204": {
- description: "No Content",
- },
- },
- tags: ["supplierStatus"],
- },
- patch: {
- parameters: [
- {
- $ref: "#/parameters/rowFilter.supplierStatus.id",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.name",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.companyId",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.createdAt",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.createdBy",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.updatedBy",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.updatedAt",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.customFields",
- },
- {
- $ref: "#/parameters/rowFilter.supplierStatus.tags",
- },
- {
- $ref: "#/parameters/body.supplierStatus",
- },
- {
- $ref: "#/parameters/preferReturn",
- },
- ],
- responses: {
- "204": {
- description: "No Content",
- },
- },
- tags: ["supplierStatus"],
- },
- },
"/service": {
get: {
parameters: [
@@ -31522,7 +31351,7 @@ export default {
$ref: "#/parameters/rowFilter.suppliers.supplierTypeId",
},
{
- $ref: "#/parameters/rowFilter.suppliers.supplierStatusId",
+ $ref: "#/parameters/rowFilter.suppliers.status",
},
{
$ref: "#/parameters/rowFilter.suppliers.taxId",
@@ -31584,9 +31413,6 @@ export default {
{
$ref: "#/parameters/rowFilter.suppliers.type",
},
- {
- $ref: "#/parameters/rowFilter.suppliers.status",
- },
{
$ref: "#/parameters/rowFilter.suppliers.orderCount",
},
@@ -56169,9 +55995,6 @@ export default {
{
$ref: "#/parameters/rowFilter.supplier.supplierTypeId",
},
- {
- $ref: "#/parameters/rowFilter.supplier.supplierStatusId",
- },
{
$ref: "#/parameters/rowFilter.supplier.taxId",
},
@@ -56232,6 +56055,9 @@ export default {
{
$ref: "#/parameters/rowFilter.supplier.vatNumber",
},
+ {
+ $ref: "#/parameters/rowFilter.supplier.supplierStatus",
+ },
{
$ref: "#/parameters/select",
},
@@ -56300,9 +56126,6 @@ export default {
{
$ref: "#/parameters/rowFilter.supplier.supplierTypeId",
},
- {
- $ref: "#/parameters/rowFilter.supplier.supplierStatusId",
- },
{
$ref: "#/parameters/rowFilter.supplier.taxId",
},
@@ -56363,6 +56186,9 @@ export default {
{
$ref: "#/parameters/rowFilter.supplier.vatNumber",
},
+ {
+ $ref: "#/parameters/rowFilter.supplier.supplierStatus",
+ },
{
$ref: "#/parameters/preferReturn",
},
@@ -56385,9 +56211,6 @@ export default {
{
$ref: "#/parameters/rowFilter.supplier.supplierTypeId",
},
- {
- $ref: "#/parameters/rowFilter.supplier.supplierStatusId",
- },
{
$ref: "#/parameters/rowFilter.supplier.taxId",
},
@@ -56448,6 +56271,9 @@ export default {
{
$ref: "#/parameters/rowFilter.supplier.vatNumber",
},
+ {
+ $ref: "#/parameters/rowFilter.supplier.supplierStatus",
+ },
{
$ref: "#/parameters/body.supplier",
},
@@ -62814,6 +62640,9 @@ export default {
{
$ref: "#/parameters/rowFilter.companySettings.quoteLineCategoryMarkups",
},
+ {
+ $ref: "#/parameters/rowFilter.companySettings.supplierApproval",
+ },
{
$ref: "#/parameters/select",
},
@@ -62966,6 +62795,9 @@ export default {
{
$ref: "#/parameters/rowFilter.companySettings.quoteLineCategoryMarkups",
},
+ {
+ $ref: "#/parameters/rowFilter.companySettings.supplierApproval",
+ },
{
$ref: "#/parameters/preferReturn",
},
@@ -63072,6 +62904,9 @@ export default {
{
$ref: "#/parameters/rowFilter.companySettings.quoteLineCategoryMarkups",
},
+ {
+ $ref: "#/parameters/rowFilter.companySettings.supplierApproval",
+ },
{
$ref: "#/parameters/body.companySettings",
},
@@ -69821,59 +69656,6 @@ export default {
},
type: "object",
},
- supplierStatus: {
- required: ["id", "name", "companyId", "createdAt", "createdBy"],
- properties: {
- id: {
- default: "public.id('ss'::text)",
- description: "Note:\nThis is a Primary Key.<pk/>",
- format: "text",
- type: "string",
- },
- name: {
- format: "text",
- type: "string",
- },
- companyId: {
- description:
- "Note:\nThis is a Foreign Key to `company.id`.<fk table='company' column='id'/>",
- format: "text",
- type: "string",
- },
- createdAt: {
- default: "now()",
- format: "timestamp with time zone",
- type: "string",
- },
- createdBy: {
- description:
- "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
- format: "text",
- type: "string",
- },
- updatedBy: {
- description:
- "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
- format: "text",
- type: "string",
- },
- updatedAt: {
- format: "timestamp with time zone",
- type: "string",
- },
- customFields: {
- format: "jsonb",
- },
- tags: {
- format: "text[]",
- items: {
- type: "string",
- },
- type: "array",
- },
- },
- type: "object",
- },
service: {
required: [
"id",
@@ -71327,7 +71109,7 @@ export default {
type: "string",
},
documentType: {
- enum: ["purchaseOrder", "qualityDocument"],
+ enum: ["purchaseOrder", "qualityDocument", "supplier"],
format: 'public."approvalDocumentType"',
type: "string",
},
@@ -73431,7 +73213,7 @@ export default {
properties: {
id: {
description:
- "Note:\nThis is a Primary Key.<pk/>\nThis is a Foreign Key to `supplierLocation.id`.<fk table='supplierLocation' column='id'/>",
+ "Note:\nThis is a Foreign Key to `supplierLocation.id`.<fk table='supplierLocation' column='id'/>",
format: "text",
type: "string",
},
@@ -73480,7 +73262,7 @@ export default {
},
supplierLocationId: {
description:
- "Note:\nThis is a Foreign Key to `supplierLocation.id`.<fk table='supplierLocation' column='id'/>",
+ "Note:\nThis is a Primary Key.<pk/>\nThis is a Foreign Key to `supplierLocation.id`.<fk table='supplierLocation' column='id'/>",
format: "text",
type: "string",
},
@@ -84086,10 +83868,9 @@ export default {
format: "text",
type: "string",
},
- supplierStatusId: {
- description:
- "Note:\nThis is a Foreign Key to `supplierStatus.id`.<fk table='supplierStatus' column='id'/>",
- format: "text",
+ status: {
+ enum: ["Active", "Inactive", "Pending", "Rejected"],
+ format: 'public."supplierStatusType"',
type: "string",
},
taxId: {
@@ -84190,10 +83971,6 @@ export default {
format: "text",
type: "string",
},
- status: {
- format: "text",
- type: "string",
- },
orderCount: {
format: "bigint",
type: "integer",
@@ -88650,7 +88427,7 @@ export default {
type: "string",
},
documentType: {
- enum: ["purchaseOrder", "qualityDocument"],
+ enum: ["purchaseOrder", "qualityDocument", "supplier"],
format: 'public."approvalDocumentType"',
type: "string",
},
@@ -96013,12 +95790,6 @@ export default {
format: "text",
type: "string",
},
- supplierStatusId: {
- description:
- "Note:\nThis is a Foreign Key to `supplierStatus.id`.<fk table='supplierStatus' column='id'/>",
- format: "text",
- type: "string",
- },
taxId: {
format: "text",
type: "string",
@@ -96120,6 +95891,11 @@ export default {
format: "text",
type: "string",
},
+ supplierStatus: {
+ enum: ["Active", "Inactive", "Pending", "Rejected"],
+ format: 'public."supplierStatusType"',
+ type: "string",
+ },
},
type: "object",
},
@@ -99275,6 +99051,7 @@ export default {
"includeThumbnailsOnSalesPdfs",
"includeThumbnailsOnPurchasingPdfs",
"jobTravelerIncludeWorkInstructions",
+ "supplierApproval",
],
properties: {
id: {
@@ -99455,6 +99232,11 @@ export default {
quoteLineCategoryMarkups: {
format: "jsonb",
},
+ supplierApproval: {
+ default: false,
+ format: "boolean",
+ type: "boolean",
+ },
},
type: "object",
},
@@ -99544,7 +99326,7 @@ export default {
type: "string",
},
documentType: {
- enum: ["purchaseOrder", "qualityDocument"],
+ enum: ["purchaseOrder", "qualityDocument", "supplier"],
format: 'public."approvalDocumentType"',
type: "string",
},
@@ -100305,69 +100087,6 @@ export default {
in: "query",
type: "string",
},
- "body.supplierStatus": {
- name: "supplierStatus",
- description: "supplierStatus",
- required: false,
- in: "body",
- schema: {
- $ref: "#/definitions/supplierStatus",
- },
- },
- "rowFilter.supplierStatus.id": {
- name: "id",
- required: false,
- in: "query",
- type: "string",
- },
- "rowFilter.supplierStatus.name": {
- name: "name",
- required: false,
- in: "query",
- type: "string",
- },
- "rowFilter.supplierStatus.companyId": {
- name: "companyId",
- required: false,
- in: "query",
- type: "string",
- },
- "rowFilter.supplierStatus.createdAt": {
- name: "createdAt",
- required: false,
- in: "query",
- type: "string",
- },
- "rowFilter.supplierStatus.createdBy": {
- name: "createdBy",
- required: false,
- in: "query",
- type: "string",
- },
- "rowFilter.supplierStatus.updatedBy": {
- name: "updatedBy",
- required: false,
- in: "query",
- type: "string",
- },
- "rowFilter.supplierStatus.updatedAt": {
- name: "updatedAt",
- required: false,
- in: "query",
- type: "string",
- },
- "rowFilter.supplierStatus.customFields": {
- name: "customFields",
- required: false,
- in: "query",
- type: "string",
- },
- "rowFilter.supplierStatus.tags": {
- name: "tags",
- required: false,
- in: "query",
- type: "string",
- },
"body.service": {
name: "service",
description: "service",
@@ -116444,8 +116163,8 @@ export default {
in: "query",
type: "string",
},
- "rowFilter.suppliers.supplierStatusId": {
- name: "supplierStatusId",
+ "rowFilter.suppliers.status": {
+ name: "status",
required: false,
in: "query",
type: "string",
@@ -116570,12 +116289,6 @@ export default {
in: "query",
type: "string",
},
- "rowFilter.suppliers.status": {
- name: "status",
- required: false,
- in: "query",
- type: "string",
- },
"rowFilter.suppliers.orderCount": {
name: "orderCount",
required: false,
@@ -130004,12 +129717,6 @@ export default {
in: "query",
type: "string",
},
- "rowFilter.supplier.supplierStatusId": {
- name: "supplierStatusId",
- required: false,
- in: "query",
- type: "string",
- },
"rowFilter.supplier.taxId": {
name: "taxId",
required: false,
@@ -130130,6 +129837,12 @@ export default {
in: "query",
type: "string",
},
+ "rowFilter.supplier.supplierStatus": {
+ name: "supplierStatus",
+ required: false,
+ in: "query",
+ type: "string",
+ },
"body.stockTransfer": {
name: "stockTransfer",
description: "stockTransfer",
@@ -133787,6 +133500,12 @@ export default {
in: "query",
type: "string",
},
+ "rowFilter.companySettings.supplierApproval": {
+ name: "supplierApproval",
+ required: false,
+ in: "query",
+ type: "string",
+ },
"body.part": {
name: "part",
description: "part",
diff --git a/packages/database/src/types.ts b/packages/database/src/types.ts
index e6034b2a83..ba85549cc8 100644
--- a/packages/database/src/types.ts
+++ b/packages/database/src/types.ts
@@ -33311,48 +33311,6 @@ export type Database = {
},
]
}
- searchIndex_WzwEWaV48VbxPNogD92qWD: {
- Row: {
- createdAt: string
- description: string | null
- entityId: string
- entityType: string
- id: number
- link: string
- metadata: Json | null
- searchVector: unknown
- tags: string[] | null
- title: string
- updatedAt: string | null
- }
- Insert: {
- createdAt?: string
- description?: string | null
- entityId: string
- entityType: string
- id?: number
- link: string
- metadata?: Json | null
- searchVector?: unknown
- tags?: string[] | null
- title: string
- updatedAt?: string | null
- }
- Update: {
- createdAt?: string
- description?: string | null
- entityId?: string
- entityType?: string
- id?: number
- link?: string
- metadata?: Json | null
- searchVector?: unknown
- tags?: string[] | null
- title?: string
- updatedAt?: string | null
- }
- Relationships: []
- }
searchIndexRegistry: {
Row: {
companyId: string
@@ -47740,14 +47698,14 @@ export type Database = {
},
{
foreignKeyName: "partner_id_fkey"
- columns: ["id"]
+ columns: ["supplierLocationId"]
isOneToOne: false
referencedRelation: "supplierLocation"
referencedColumns: ["id"]
},
{
foreignKeyName: "partner_id_fkey"
- columns: ["supplierLocationId"]
+ columns: ["id"]
isOneToOne: false
referencedRelation: "supplierLocation"
referencedColumns: ["id"]
@@ -49144,14 +49102,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"]
@@ -52292,14 +52250,14 @@ export type Database = {
},
{
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"]
@@ -52842,14 +52800,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/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.ts
index 935cf1a066..ba85549cc8 100644
--- a/packages/database/supabase/functions/lib/types.ts
+++ b/packages/database/supabase/functions/lib/types.ts
@@ -33311,48 +33311,6 @@ export type Database = {
},
]
}
- searchIndex_WzwEWaV48VbxPNogD92qWD: {
- Row: {
- createdAt: string
- description: string | null
- entityId: string
- entityType: string
- id: number
- link: string
- metadata: Json | null
- searchVector: unknown
- tags: string[] | null
- title: string
- updatedAt: string | null
- }
- Insert: {
- createdAt?: string
- description?: string | null
- entityId: string
- entityType: string
- id?: number
- link: string
- metadata?: Json | null
- searchVector?: unknown
- tags?: string[] | null
- title: string
- updatedAt?: string | null
- }
- Update: {
- createdAt?: string
- description?: string | null
- entityId?: string
- entityType?: string
- id?: number
- link?: string
- metadata?: Json | null
- searchVector?: unknown
- tags?: string[] | null
- title?: string
- updatedAt?: string | null
- }
- Relationships: []
- }
searchIndexRegistry: {
Row: {
companyId: string
@@ -35625,8 +35583,6 @@ export type Database = {
supplier: {
Row: {
accountManagerId: string | null
- approvalDate: string | null
- approvedBy: string | null
assignee: string | null
companyId: string
createdAt: string
@@ -35655,8 +35611,6 @@ export type Database = {
}
Insert: {
accountManagerId?: string | null
- approvalDate?: string | null
- approvedBy?: string | null
assignee?: string | null
companyId: string
createdAt?: string
@@ -35685,8 +35639,6 @@ export type Database = {
}
Update: {
accountManagerId?: string | null
- approvalDate?: string | null
- approvedBy?: string | null
assignee?: string | null
companyId?: string
createdAt?: string
@@ -35749,41 +35701,6 @@ export type Database = {
referencedRelation: "userDefaults"
referencedColumns: ["userId"]
},
- {
- foreignKeyName: "supplier_approvedBy_fkey"
- columns: ["approvedBy"]
- isOneToOne: false
- referencedRelation: "employees"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "supplier_approvedBy_fkey"
- columns: ["approvedBy"]
- isOneToOne: false
- referencedRelation: "employeesAcrossCompanies"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "supplier_approvedBy_fkey"
- columns: ["approvedBy"]
- isOneToOne: false
- referencedRelation: "employeeSummary"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "supplier_approvedBy_fkey"
- columns: ["approvedBy"]
- isOneToOne: false
- referencedRelation: "user"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "supplier_approvedBy_fkey"
- columns: ["approvedBy"]
- isOneToOne: false
- referencedRelation: "userDefaults"
- referencedColumns: ["userId"]
- },
{
foreignKeyName: "supplier_assignee_fkey"
columns: ["assignee"]
@@ -47781,14 +47698,14 @@ export type Database = {
},
{
foreignKeyName: "partner_id_fkey"
- columns: ["id"]
+ columns: ["supplierLocationId"]
isOneToOne: false
referencedRelation: "supplierLocation"
referencedColumns: ["id"]
},
{
foreignKeyName: "partner_id_fkey"
- columns: ["supplierLocationId"]
+ columns: ["id"]
isOneToOne: false
referencedRelation: "supplierLocation"
referencedColumns: ["id"]
@@ -49185,14 +49102,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"]
@@ -52333,14 +52250,14 @@ export type Database = {
},
{
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"]
@@ -52883,14 +52800,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"]
@@ -55078,8 +54995,6 @@ export type Database = {
suppliers: {
Row: {
accountManagerId: string | null
- approvalDate: string | null
- approvedBy: string | null
assignee: string | null
companyId: string | null
createdAt: string | null
@@ -55144,41 +55059,6 @@ export type Database = {
referencedRelation: "userDefaults"
referencedColumns: ["userId"]
},
- {
- foreignKeyName: "supplier_approvedBy_fkey"
- columns: ["approvedBy"]
- isOneToOne: false
- referencedRelation: "employees"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "supplier_approvedBy_fkey"
- columns: ["approvedBy"]
- isOneToOne: false
- referencedRelation: "employeesAcrossCompanies"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "supplier_approvedBy_fkey"
- columns: ["approvedBy"]
- isOneToOne: false
- referencedRelation: "employeeSummary"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "supplier_approvedBy_fkey"
- columns: ["approvedBy"]
- isOneToOne: false
- referencedRelation: "user"
- referencedColumns: ["id"]
- },
- {
- foreignKeyName: "supplier_approvedBy_fkey"
- columns: ["approvedBy"]
- isOneToOne: false
- referencedRelation: "userDefaults"
- referencedColumns: ["userId"]
- },
{
foreignKeyName: "supplier_assignee_fkey"
columns: ["assignee"]
diff --git a/packages/database/supabase/migrations/20260310005407_supplier-approvals.sql b/packages/database/supabase/migrations/20260310005407_supplier-approvals.sql
index 958945f418..5481930dd8 100644
--- a/packages/database/supabase/migrations/20260310005407_supplier-approvals.sql
+++ b/packages/database/supabase/migrations/20260310005407_supplier-approvals.sql
@@ -1,5 +1,6 @@
ALTER TABLE "companySettings" ADD COLUMN "supplierApproval" BOOLEAN NOT NULL DEFAULT false;
ALTER TYPE "approvalDocumentType" ADD VALUE 'supplier';
+COMMIT;
-- Recreate suppliers view
DROP VIEW IF EXISTS "suppliers";