Skip to content

Commit

Permalink
specify cascade insert
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Oct 25, 2024
1 parent f900292 commit 6d32997
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion shared/entities/base-data.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ export class BaseData extends BaseEntity {
@OneToOne(
"EmissionFactors",
(emissionFactors: EmissionFactors) => emissionFactors.baseData,
{
cascade: ["insert"],
},
)
@JoinColumn({
name: "emission_factors",
Expand All @@ -282,14 +285,19 @@ export class BaseData extends BaseEntity {
"BaselineReassessment",
(baselineReassessment: BaselineReassessment) =>
baselineReassessment.baseData,
{
cascade: ["insert"],
},
)
@JoinColumn({
name: "baseline_reassessment",
referencedColumnName: "id",
})
baselineReassessment: BaselineReassessment;

@OneToOne("MRV", (mrv: MRV) => mrv.baseData)
@OneToOne("MRV", (mrv: MRV) => mrv.baseData, {
cascade: ["insert"],
})
@JoinColumn({
name: "mrv",
referencedColumnName: "id",
Expand All @@ -300,6 +308,9 @@ export class BaseData extends BaseEntity {
"BlueCarbonProjectPlanning",
(blueCarbonProjectPlanning: BlueCarbonProjectPlanning) =>
blueCarbonProjectPlanning.baseData,
{
cascade: ["insert"],
},
)
@JoinColumn({
name: "blue_carbon_project_planning",
Expand All @@ -311,6 +322,9 @@ export class BaseData extends BaseEntity {
"LongTermProjectOperating",
(longTermProjectOperating: LongTermProjectOperating) =>
longTermProjectOperating.baseData,
{
cascade: ["insert"],
},
)
@JoinColumn({
name: "long_term_project_operating",
Expand All @@ -321,6 +335,9 @@ export class BaseData extends BaseEntity {
@OneToOne(
"SequestrationRate",
(sequestrationRate: SequestrationRate) => sequestrationRate.baseData,
{
cascade: ["insert"],
},
)
@JoinColumn({
name: "sequestration_rate",
Expand Down

0 comments on commit 6d32997

Please sign in to comment.