update pocketbase seeding,
This commit is contained in:
14
002_source/pocketbase/pb_hooks/seed/004_clean_users.js
Normal file
14
002_source/pocketbase/pb_hooks/seed/004_clean_users.js
Normal file
@@ -0,0 +1,14 @@
|
||||
module.exports = ($app) => {
|
||||
console.log("004 clean user table start");
|
||||
|
||||
dirtyTruncateTable("Users");
|
||||
dirtyTruncateTable("UserMetas");
|
||||
|
||||
console.log("004 clean user table done");
|
||||
};
|
||||
|
||||
const dirtyTruncateTable = (COLLECTION_NAME) => {
|
||||
console.log(`perform dirty method to truncate table "${COLLECTION_NAME}"`);
|
||||
const cmd_to_exec = $os.cmd("sqlite3", "/pb_data/data.db", `DELETE from ${COLLECTION_NAME};`);
|
||||
cmd_to_exec.output();
|
||||
};
|
Reference in New Issue
Block a user