Moving lifetime + age to where it is used

Signed-off-by: Daniel <daniel.hutzel@sap.com>
This commit is contained in:
Daniel
2021-11-24 19:30:47 +01:00
committed by Daniel Hutzel
parent 33380c0792
commit 19b680ab3d
6 changed files with 13 additions and 20 deletions

10
fiori/db/sqlite/index.cds Normal file
View File

@@ -0,0 +1,10 @@
//
// Add Author.age and .lifetime with a DB-specific function
//
using { AdminService } from '@capire/bookshop';
extend projection AdminService.Authors with {
strftime('%Y',dateOfDeath)-strftime('%Y',dateOfBirth) as age: Integer,
strftime('%Y',dateOfBirth) || ' ' || strftime('%Y',dateOfDeath) as lifetime : String
}