Rename owner by approver
Document owner does not make sense it's more an document approver. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
committed by
Sacha Al Himdani
parent
891d607602
commit
3d8c7c4dd6
@@ -32,7 +32,7 @@ type (
|
||||
Document struct {
|
||||
ID gid.GID `db:"id"`
|
||||
OrganizationID gid.GID `db:"organization_id"`
|
||||
OwnerID gid.GID `db:"owner_profile_id"`
|
||||
ApproverID gid.GID `db:"approver_profile_id"`
|
||||
Title string `db:"title"`
|
||||
DocumentType DocumentType `db:"document_type"`
|
||||
Classification DocumentClassification `db:"classification"`
|
||||
@@ -83,7 +83,7 @@ func (p *Document) LoadByID(
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
owner_profile_id,
|
||||
approver_profile_id,
|
||||
title,
|
||||
document_type,
|
||||
classification,
|
||||
@@ -135,7 +135,7 @@ func (p *Document) LoadByIDWithFilter(
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
owner_profile_id,
|
||||
approver_profile_id,
|
||||
title,
|
||||
document_type,
|
||||
classification,
|
||||
@@ -188,7 +188,7 @@ func (p *Documents) LoadByIDs(
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
owner_profile_id,
|
||||
approver_profile_id,
|
||||
title,
|
||||
document_type,
|
||||
classification,
|
||||
@@ -270,7 +270,7 @@ func (p *Documents) LoadByOrganizationID(
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
owner_profile_id,
|
||||
approver_profile_id,
|
||||
title,
|
||||
document_type,
|
||||
classification,
|
||||
@@ -321,7 +321,7 @@ func (p *Documents) LoadAllByOrganizationID(
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
owner_profile_id,
|
||||
approver_profile_id,
|
||||
title,
|
||||
document_type,
|
||||
classification,
|
||||
@@ -371,7 +371,7 @@ INSERT INTO
|
||||
tenant_id,
|
||||
id,
|
||||
organization_id,
|
||||
owner_profile_id,
|
||||
approver_profile_id,
|
||||
title,
|
||||
document_type,
|
||||
classification,
|
||||
@@ -384,7 +384,7 @@ VALUES (
|
||||
@tenant_id,
|
||||
@document_id,
|
||||
@organization_id,
|
||||
@owner_profile_id,
|
||||
@approver_profile_id,
|
||||
@title,
|
||||
@document_type,
|
||||
@classification,
|
||||
@@ -399,7 +399,7 @@ VALUES (
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"document_id": p.ID,
|
||||
"organization_id": p.OrganizationID,
|
||||
"owner_profile_id": p.OwnerID,
|
||||
"approver_profile_id": p.ApproverID,
|
||||
"title": p.Title,
|
||||
"document_type": p.DocumentType,
|
||||
"classification": p.Classification,
|
||||
@@ -460,7 +460,7 @@ UPDATE
|
||||
SET
|
||||
title = @title,
|
||||
current_published_version = @current_published_version,
|
||||
owner_profile_id = @owner_profile_id,
|
||||
approver_profile_id = @approver_profile_id,
|
||||
document_type = @document_type,
|
||||
classification = @classification,
|
||||
trust_center_visibility = @trust_center_visibility,
|
||||
@@ -477,7 +477,7 @@ WHERE
|
||||
"updated_at": time.Now(),
|
||||
"title": p.Title,
|
||||
"current_published_version": p.CurrentPublishedVersion,
|
||||
"owner_profile_id": p.OwnerID,
|
||||
"approver_profile_id": p.ApproverID,
|
||||
"document_type": p.DocumentType,
|
||||
"classification": p.Classification,
|
||||
"trust_center_visibility": p.TrustCenterVisibility,
|
||||
@@ -548,7 +548,7 @@ WITH scoped_documents AS (
|
||||
SELECT
|
||||
scoped_documents.id,
|
||||
scoped_documents.organization_id,
|
||||
scoped_documents.owner_profile_id,
|
||||
scoped_documents.approver_profile_id,
|
||||
scoped_documents.title,
|
||||
scoped_documents.document_type,
|
||||
scoped_documents.classification,
|
||||
@@ -638,7 +638,7 @@ WITH scoped_documents AS (
|
||||
SELECT
|
||||
scoped_documents.id,
|
||||
scoped_documents.organization_id,
|
||||
scoped_documents.owner_profile_id,
|
||||
scoped_documents.approver_profile_id,
|
||||
scoped_documents.title,
|
||||
scoped_documents.document_type,
|
||||
scoped_documents.classification,
|
||||
|
||||
@@ -34,7 +34,7 @@ type (
|
||||
OrganizationID gid.GID `db:"organization_id"`
|
||||
DocumentID gid.GID `db:"document_id"`
|
||||
Title string `db:"title"`
|
||||
OwnerID gid.GID `db:"owner_profile_id"`
|
||||
ApproverID gid.GID `db:"approver_profile_id"`
|
||||
VersionNumber int `db:"version_number"`
|
||||
Classification DocumentClassification `db:"classification"`
|
||||
Content string `db:"content"`
|
||||
@@ -77,7 +77,7 @@ SELECT
|
||||
organization_id,
|
||||
document_id,
|
||||
title,
|
||||
owner_profile_id,
|
||||
approver_profile_id,
|
||||
version_number,
|
||||
classification,
|
||||
content,
|
||||
@@ -139,7 +139,7 @@ SELECT
|
||||
organization_id,
|
||||
document_id,
|
||||
title,
|
||||
owner_profile_id,
|
||||
approver_profile_id,
|
||||
version_number,
|
||||
classification,
|
||||
content,
|
||||
@@ -190,7 +190,7 @@ INSERT INTO document_versions (
|
||||
organization_id,
|
||||
document_id,
|
||||
title,
|
||||
owner_profile_id,
|
||||
approver_profile_id,
|
||||
version_number,
|
||||
classification,
|
||||
content,
|
||||
@@ -205,7 +205,7 @@ VALUES (
|
||||
@organization_id,
|
||||
@document_id,
|
||||
@title,
|
||||
@owner_profile_id,
|
||||
@approver_profile_id,
|
||||
@version_number,
|
||||
@classification,
|
||||
@content,
|
||||
@@ -221,7 +221,7 @@ VALUES (
|
||||
"organization_id": dv.OrganizationID,
|
||||
"document_id": dv.DocumentID,
|
||||
"title": dv.Title,
|
||||
"owner_profile_id": dv.OwnerID,
|
||||
"approver_profile_id": dv.ApproverID,
|
||||
"version_number": dv.VersionNumber,
|
||||
"classification": dv.Classification,
|
||||
"content": dv.Content,
|
||||
@@ -260,7 +260,7 @@ SELECT
|
||||
organization_id,
|
||||
document_id,
|
||||
title,
|
||||
owner_profile_id,
|
||||
approver_profile_id,
|
||||
version_number,
|
||||
classification,
|
||||
content,
|
||||
@@ -313,7 +313,7 @@ SELECT
|
||||
organization_id,
|
||||
document_id,
|
||||
title,
|
||||
owner_profile_id,
|
||||
approver_profile_id,
|
||||
version_number,
|
||||
classification,
|
||||
content,
|
||||
@@ -364,7 +364,7 @@ SELECT
|
||||
organization_id,
|
||||
document_id,
|
||||
title,
|
||||
owner_profile_id,
|
||||
approver_profile_id,
|
||||
version_number,
|
||||
classification,
|
||||
content,
|
||||
@@ -413,7 +413,7 @@ func (dv DocumentVersion) Update(
|
||||
q := `
|
||||
UPDATE document_versions SET
|
||||
title = @title,
|
||||
owner_profile_id = @owner_profile_id,
|
||||
approver_profile_id = @approver_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_profile_id": dv.OwnerID,
|
||||
"approver_profile_id": dv.ApproverID,
|
||||
"changelog": dv.Changelog,
|
||||
"status": dv.Status,
|
||||
"content": dv.Content,
|
||||
|
||||
5
pkg/coredata/migrations/20260212T120000Z.sql
Normal file
5
pkg/coredata/migrations/20260212T120000Z.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
-- Rename owner_profile_id to approver_profile_id on documents table
|
||||
ALTER TABLE documents RENAME COLUMN owner_profile_id TO approver_profile_id;
|
||||
|
||||
-- Rename owner_profile_id to approver_profile_id on document_versions table
|
||||
ALTER TABLE document_versions RENAME COLUMN owner_profile_id TO approver_profile_id;
|
||||
Reference in New Issue
Block a user