-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ChildEntities): Fix qualifying column on discriminated joined ent…
…ities
- Loading branch information
Showing
7 changed files
with
135 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
tests/resources/app/models/revagency/TripPlannerReservationComponent.cfc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
component | ||
extends ="quick.models.BaseEntity" | ||
table ="trip_planner_reservation_component" | ||
discriminatorColumn="type" | ||
accessors ="true" | ||
{ | ||
|
||
property name="id" column="componentID"; | ||
property name="reservationId" column="reservationID"; | ||
property name="tripComponentId" column="tripComponentID"; | ||
property name="type" column="type"; | ||
property | ||
name ="isActive" | ||
column="isActive" | ||
type ="boolean" | ||
casts ="BooleanCast@quick"; | ||
property | ||
name ="createdDate" | ||
column="createdDate" | ||
type ="date"; | ||
property | ||
name ="createdByAgentId" | ||
column="createdByAgentId" | ||
hint ="if the record was created by an agent, the agent identifier, otherwise null"; | ||
property | ||
name ="createdByMemberId" | ||
column="createdByMemberId" | ||
hint ="if the record was created by a member, the member identifier, otherwise null"; | ||
property | ||
name ="modifiedDate" | ||
column="modifiedDate" | ||
type ="date"; | ||
property | ||
name ="modifiedByAgentId" | ||
column="modifiedByAgentId" | ||
hint ="the agent identifier of the last agent to modify this record the record - not necessarily the most recent modification"; | ||
property | ||
name ="modifiedByMemberId" | ||
column="modifiedByMemberId" | ||
hint ="the member identifier of the last member to modify this record the record - not necessarily the most recent modification"; | ||
property | ||
name ="lastModifiedBy" | ||
column="lastModifiedBy" | ||
hint ="was the last person to modify this record"; | ||
|
||
variables._discriminators = [ "TripPlannerReservationComponentCruise" ]; | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
tests/resources/app/models/revagency/TripPlannerReservationComponentCruise.cfc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
component | ||
extends ="TripPlannerReservationComponent" | ||
table ="trip_planner_reservation_component_cruise" | ||
joinColumn ="reservationComponentID" | ||
discriminatorValue="cruise" | ||
accessors ="true" | ||
{ | ||
|
||
property name="id" column="cruiseComponentID"; | ||
property name="reservationComponentID" column="componentID"; | ||
property name="confirmationNumber" column="confirmationNumber"; | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
tests/resources/database/migrations/2024_09_24_114812_create_trip_components_table.cfc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
component { | ||
|
||
function up( schema, qb ) { | ||
schema.create( "trip_planner_reservation_component", function( table ) { | ||
table.unsignedInteger( "componentID" ); | ||
table.unsignedInteger( "reservationID" ); | ||
table.unsignedInteger( "tripComponentID" ); | ||
table.string( "type" ); | ||
table.bit( "isActive" ); | ||
table.datetime( "createdDate" ).withCurrent(); | ||
table.unsignedInteger( "createdByAgentId" ).nullable(); | ||
table.unsignedInteger( "createdByMemberId" ).nullable(); | ||
table.datetime( "modifiedDate" ).withCurrent(); | ||
table.unsignedInteger( "modifiedByAgentId" ).nullable(); | ||
table.unsignedInteger( "modifiedByMemberId" ).nullable(); | ||
table.unsignedInteger( "lastModifiedBy" ).nullable(); | ||
} ); | ||
|
||
qb.newQuery() | ||
.table( "trip_planner_reservation_component" ) | ||
.insert( [ | ||
{ | ||
"componentID" : 4, | ||
"reservationID" : 5, | ||
"tripComponentID" : 2, | ||
"type" : "cruise", | ||
"isActive" : 1, | ||
"createdDate" : now(), | ||
"modifiedDate" : now() | ||
} | ||
] ); | ||
} | ||
|
||
function down( schema, qb ) { | ||
schema.drop( "trip_planner_reservation_component" ); | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
...s/resources/database/migrations/2024_09_24_115820_create_trip_components_cruise_table.cfc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
component { | ||
|
||
function up( schema, qb ) { | ||
schema.create( "trip_planner_reservation_component_cruise", function( table ) { | ||
table.unsignedInteger( "cruiseComponentID" ); | ||
table.unsignedInteger( "componentID" ); | ||
table.string( "confirmationNumber" ); | ||
} ); | ||
|
||
qb.newQuery() | ||
.table( "trip_planner_reservation_component_cruise" ) | ||
.insert( [ | ||
{ | ||
"cruiseComponentID" : 11, | ||
"componentID" : 4, | ||
"confirmationNumber" : "ABC123" | ||
} | ||
] ); | ||
} | ||
|
||
function down( schema, qb ) { | ||
schema.drop( "trip_planner_reservation_component_cruise" ); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters