Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply @cds.collate : false to keys #785

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
24 changes: 12 additions & 12 deletions db/master-data.cds
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,24 @@ namespace sap.fe.cap.travel;
@cds.autoexpose @readonly
aspect MasterData {}


entity Airline : MasterData {
key AirlineID : String(3);
key AirlineID : String(3) @cds.collate : false;
Name : String(40);
CurrencyCode : Currency;
AirlinePicURL : String @UI : {IsImageURL : true};

};

entity Airport : MasterData {
key AirportID : String(3);
key AirportID : String(3) @cds.collate : false;
Name : String(40);
City : String(40);
CountryCode : Country;
};


entity Supplement : managed, MasterData {
key SupplementID : String(10);
key SupplementID : String(10) @cds.collate : false;
Price : Decimal(16, 3);
Type : Association to SupplementType;
Description : localized String(1024);
Expand All @@ -35,9 +34,9 @@ entity Flight : MasterData {
// when cuid is added, the to_Airline & to_Connection can be made managed association,
// furthermore the AirlineID and ConnectionID can be removed,
// they will be replaced by the generate FKs for to_Airline & to_Connection
key AirlineID : String(3);
key AirlineID : String(3) @cds.collate : false;
vmikhailenko marked this conversation as resolved.
Show resolved Hide resolved
key FlightDate : Date;
key ConnectionID : String(4);
key ConnectionID : String(4) @cds.collate : false;
vmikhailenko marked this conversation as resolved.
Show resolved Hide resolved
vmikhailenko marked this conversation as resolved.
Show resolved Hide resolved

Price : Decimal(16, 3);
CurrencyCode : Currency;
Expand All @@ -55,8 +54,8 @@ entity FlightConnection : MasterData {
// once the TODO in Flight is done, similar change can be applied here
// to_Airline can be managed association and AirlineID can be removed
// and will be replaced with the generated FK
key ConnectionID : String(4);
key AirlineID : String(3);
key ConnectionID : String(4) @cds.collate : false;
key AirlineID : String(3) @cds.collate : false;
DepartureAirport : Association to Airport;
DestinationAirport : Association to Airport;
DepartureTime : Time;
Expand All @@ -71,25 +70,25 @@ entity FlightConnection : MasterData {
// showcasing unique constrains ??
// @assert.unique.email: [EMailAddress]
entity Passenger : managed, MasterData {
key CustomerID : String(6);
key CustomerID : String(6) @cds.collate : false;
FirstName : String(40);
LastName : String(40);
Title : String(10);
Street : String(60);
PostalCode : String(10);
City : String(40);
CountryCode : Country;
CountryCode : Country @cds.collate : false;
vmikhailenko marked this conversation as resolved.
Show resolved Hide resolved
PhoneNumber : String(30);
EMailAddress : String(256);
};

entity TravelAgency : MasterData {
key AgencyID : String(6);
key AgencyID : String(6) @cds.collate : false;
Name : String(80);
Street : String(60);
PostalCode : String(10);
City : String(40);
CountryCode : Country;
CountryCode : Country @cds.collate : false;
vmikhailenko marked this conversation as resolved.
Show resolved Hide resolved
PhoneNumber : String(30);
EMailAddress : String(256);
WebAddress : String(256);
Expand All @@ -101,6 +100,7 @@ entity TravelAgency : MasterData {
//

entity SupplementType : sap.common.CodeList {
@cds.collate: false
key code : String(2) enum {
Beverage = 'BV';
Meal = 'ML';
Expand Down
4 changes: 3 additions & 1 deletion db/schema.cds
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ entity Booking : managed {
key BookingUUID : UUID;
BookingID : Integer @Core.Computed;
BookingDate : Date;
ConnectionID : String(4);
ConnectionID : String(4) @cds.collate : false;
FlightDate : Date;
FlightPrice : Decimal(16, 3);
CurrencyCode : Currency;
Expand Down Expand Up @@ -71,6 +71,7 @@ entity BookingSupplement : managed {
//

entity BookingStatus : CodeList {
@cds.collate: false
vmikhailenko marked this conversation as resolved.
Show resolved Hide resolved
key code : String(1) enum {
New = 'N';
Booked = 'B';
Expand All @@ -79,6 +80,7 @@ entity BookingStatus : CodeList {
};

entity TravelStatus : CodeList {
@cds.collate: false
key code : String(1) enum {
Open = 'O';
Accepted = 'A';
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<!-- DEPENDENCIES VERSION -->
<jdk.version>17</jdk.version>
<cds.services.version>2.2.0</cds.services.version>
<cds.services.version>2.3.0</cds.services.version>

<cdsdk.version>^7</cdsdk.version>
</properties>
Expand Down
Loading