update pocketbase seeding,

This commit is contained in:
louiscklaw
2025-04-22 02:53:49 +08:00
parent 26ef20ffd7
commit 1c3dccd68e
26 changed files with 828 additions and 0 deletions

View 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();
};