update pocketbase schema,
This commit is contained in:
15
002_source/pocketbase/pb_hooks/seed/000_seed_t1.js
Normal file
15
002_source/pocketbase/pb_hooks/seed/000_seed_t1.js
Normal file
@@ -0,0 +1,15 @@
|
||||
module.exports = $app => {
|
||||
const ASSETS_DIR = '/pb_hooks/assets';
|
||||
const getAsset = name => $filesystem.fileFromPath(ASSETS_DIR + '/' + name);
|
||||
|
||||
for (let i = 0; i < 3; i++) {
|
||||
let t1_collection = $app.findCollectionByNameOrId('t1');
|
||||
|
||||
let record = new Record(t1_collection);
|
||||
record.set('hello', 'world');
|
||||
let test_png = getAsset('1.png');
|
||||
record.set('test_file', test_png);
|
||||
|
||||
$app.save(record);
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user