...
|
...
|
@@ -35,10 +35,10 @@ func (repository *UpChainRepository) Save(upChain *domain.UpChain) (*domain.UpCh |
|
|
"up_chain_status",
|
|
|
"created_at",
|
|
|
}
|
|
|
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
|
|
|
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
|
|
|
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlbuilder.RemoveSqlFields(sqlBuildFields, "up_chain_id"))
|
|
|
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlbuilder.RemoveSqlFields(sqlBuildFields, "up_chain_id"))
|
|
|
returningFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
|
|
|
updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "upChain_id")
|
|
|
updateFields := sqlbuilder.RemoveSqlFields(sqlBuildFields, "up_chain_id")
|
|
|
updateFieldsSnippet := sqlbuilder.SqlUpdateFieldsSnippet(updateFields)
|
|
|
tx := repository.transactionContext.PgTx
|
|
|
if upChain.Identify() == nil {
|
...
|
...
|
@@ -59,8 +59,8 @@ func (repository *UpChainRepository) Save(upChain *domain.UpChain) (*domain.UpCh |
|
|
&upChain.UpChainStatus,
|
|
|
&upChain.CreatedAt,
|
|
|
),
|
|
|
fmt.Sprintf("INSERT INTO up_chains (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
|
|
|
upChain.UpChainId,
|
|
|
fmt.Sprintf("INSERT INTO business.up_chain (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
|
|
|
//upChain.UpChainId,
|
|
|
upChain.Source,
|
|
|
upChain.PrimaryId,
|
|
|
upChain.IssueId,
|
...
|
...
|
@@ -83,7 +83,7 @@ func (repository *UpChainRepository) Save(upChain *domain.UpChain) (*domain.UpCh |
|
|
&upChain.UpChainStatus,
|
|
|
&upChain.CreatedAt,
|
|
|
),
|
|
|
fmt.Sprintf("UPDATE up_chains SET %s WHERE up_chain_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
|
|
|
fmt.Sprintf("UPDATE business.up_chain SET %s WHERE up_chain_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
|
|
|
upChain.Source,
|
|
|
upChain.PrimaryId,
|
|
|
upChain.IssueId,
|
...
|
...
|
|