Compare commits
2 Commits
new-capire
...
cds.deploy
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
adaeb6ab05 | ||
|
|
6e88453dea |
@@ -16,7 +16,8 @@
|
|||||||
"cds": {
|
"cds": {
|
||||||
"requires": {
|
"requires": {
|
||||||
"db": {
|
"db": {
|
||||||
"kind": "sql"
|
"kind": "sqlite",
|
||||||
|
"model": "*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
bookshop/sqlite.db
Normal file
BIN
bookshop/sqlite.db
Normal file
Binary file not shown.
19
bookshop/srv/server.js
Normal file
19
bookshop/srv/server.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
const cds = require ('@sap/cds')
|
||||||
|
|
||||||
|
cds.on('listening', async ()=>{ try { //> just to see the output at the end; will later on be in db service impl
|
||||||
|
console.log ('\nFilling database with initial data...')
|
||||||
|
const m = cds.model.minified() //> we likely should do that by default
|
||||||
|
const tx = cds.tx()
|
||||||
|
tx.run ([ //> this will be replaced by
|
||||||
|
DELETE.from ('sap.capire.bookshop.Authors'),
|
||||||
|
DELETE.from ('sap.capire.bookshop.Books'),
|
||||||
|
DELETE.from ('sap.capire.bookshop.Books.texts'),
|
||||||
|
DELETE.from ('sap.capire.bookshop.Genres'),
|
||||||
|
DELETE.from ('sap.common.Currencies'),
|
||||||
|
DELETE.from ('sap.common.Currencies.texts'),
|
||||||
|
])
|
||||||
|
await cds.deploy(m).to(tx,{ddl:false})
|
||||||
|
await tx.commit()
|
||||||
|
} catch(e) { console.error(e) }})
|
||||||
|
|
||||||
|
module.exports = cds.server
|
||||||
Reference in New Issue
Block a user