Fix coredata SQL queries using new FKs columms
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -77,7 +77,7 @@ SELECT
|
||||
organization_id,
|
||||
document_id,
|
||||
title,
|
||||
owner_id,
|
||||
owner_profile_id,
|
||||
version_number,
|
||||
classification,
|
||||
content,
|
||||
@@ -139,7 +139,7 @@ SELECT
|
||||
organization_id,
|
||||
document_id,
|
||||
title,
|
||||
owner_id,
|
||||
owner_profile_id,
|
||||
version_number,
|
||||
classification,
|
||||
content,
|
||||
@@ -190,7 +190,7 @@ INSERT INTO document_versions (
|
||||
organization_id,
|
||||
document_id,
|
||||
title,
|
||||
owner_id,
|
||||
owner_profile_id,
|
||||
version_number,
|
||||
classification,
|
||||
content,
|
||||
@@ -205,7 +205,7 @@ VALUES (
|
||||
@organization_id,
|
||||
@document_id,
|
||||
@title,
|
||||
@owner_id,
|
||||
@owner_profile_id,
|
||||
@version_number,
|
||||
@classification,
|
||||
@content,
|
||||
@@ -216,19 +216,19 @@ VALUES (
|
||||
)
|
||||
`
|
||||
args := pgx.StrictNamedArgs{
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"id": dv.ID,
|
||||
"organization_id": dv.OrganizationID,
|
||||
"document_id": dv.DocumentID,
|
||||
"title": dv.Title,
|
||||
"owner_id": dv.OwnerID,
|
||||
"version_number": dv.VersionNumber,
|
||||
"classification": dv.Classification,
|
||||
"content": dv.Content,
|
||||
"changelog": dv.Changelog,
|
||||
"status": dv.Status,
|
||||
"created_at": dv.CreatedAt,
|
||||
"updated_at": dv.UpdatedAt,
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"id": dv.ID,
|
||||
"organization_id": dv.OrganizationID,
|
||||
"document_id": dv.DocumentID,
|
||||
"title": dv.Title,
|
||||
"owner_profile_id": dv.OwnerID,
|
||||
"version_number": dv.VersionNumber,
|
||||
"classification": dv.Classification,
|
||||
"content": dv.Content,
|
||||
"changelog": dv.Changelog,
|
||||
"status": dv.Status,
|
||||
"created_at": dv.CreatedAt,
|
||||
"updated_at": dv.UpdatedAt,
|
||||
}
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
@@ -260,7 +260,7 @@ SELECT
|
||||
organization_id,
|
||||
document_id,
|
||||
title,
|
||||
owner_id,
|
||||
owner_profile_id,
|
||||
version_number,
|
||||
classification,
|
||||
content,
|
||||
@@ -313,7 +313,7 @@ SELECT
|
||||
organization_id,
|
||||
document_id,
|
||||
title,
|
||||
owner_id,
|
||||
owner_profile_id,
|
||||
version_number,
|
||||
classification,
|
||||
content,
|
||||
@@ -364,7 +364,7 @@ SELECT
|
||||
organization_id,
|
||||
document_id,
|
||||
title,
|
||||
owner_id,
|
||||
owner_profile_id,
|
||||
version_number,
|
||||
classification,
|
||||
content,
|
||||
@@ -413,7 +413,7 @@ func (dv DocumentVersion) Update(
|
||||
q := `
|
||||
UPDATE document_versions SET
|
||||
title = @title,
|
||||
owner_id = @owner_id,
|
||||
owner_profile_id = @owner_profile_id,
|
||||
changelog = @changelog,
|
||||
status = @status,
|
||||
content = @content,
|
||||
@@ -429,7 +429,7 @@ WHERE %s
|
||||
args := pgx.StrictNamedArgs{
|
||||
"document_version_id": dv.ID,
|
||||
"title": dv.Title,
|
||||
"owner_id": dv.OwnerID,
|
||||
"owner_profile_id": dv.OwnerID,
|
||||
"changelog": dv.Changelog,
|
||||
"status": dv.Status,
|
||||
"content": dv.Content,
|
||||
|
||||
Reference in New Issue
Block a user