update pocketbase,

This commit is contained in:
louiscklaw
2025-04-18 03:06:06 +08:00
parent d863d6d469
commit 03313dfc65
993 changed files with 71724 additions and 19 deletions

View File

@@ -1,34 +1,36 @@
module.exports = $app => {
module.exports = ($app) => {
let draft_lesson_types = [
['1'.padStart(15, 0), 'Vocabulary', 'vocabulary', 0, 'visible'],
['2'.padStart(15, 0), 'Connectives', 'connectivse', 1, 'visible'],
['3'.padStart(15, 0), 'Testing visible', 'testing', 3, 'visible'],
['4'.padStart(15, 0), 'Testing hidden', 'testing', 3, 'hidden'],
['5'.padStart(15, 0), 'lesson type 5', 'testing', 3, 'hidden'],
['6'.padStart(15, 0), '中文 6', 'testing', 3, 'hidden'],
['7'.padStart(15, 0), 'レッスン7 レッスン7 レッスン7', 'testing', 3, 'hidden'],
["1".padStart(15, 0), "Vocabulary", "vocabulary", 0, "visible"],
["2".padStart(15, 0), "Connectives", "connectives", 1, "visible"],
["3".padStart(15, 0), "Testing visible", "testing", 3, "visible"],
["4".padStart(15, 0), "Testing hidden", "testing", 3, "hidden"],
["5".padStart(15, 0), "lesson type 5", "testing", 3, "hidden"],
["6".padStart(15, 0), "中文 6", "testing", 3, "hidden"],
["7".padStart(15, 0), "レッスン7 レッスン7 レッスン7", "testing", 3, "hidden"],
];
dirtyTruncateTable('LessonsTypes');
dirtyTruncateTable("LessonsTypes");
let lt_collection = $app.findCollectionByNameOrId('LessonsTypes');
let lt_collection = $app.findCollectionByNameOrId("LessonsTypes");
for (let i = 0; i < draft_lesson_types.length; i++) {
let lesson_type = draft_lesson_types[i];
let record = new Record(lt_collection);
record.set('id', lesson_type[0]);
record.set('name', lesson_type[1]);
record.set('type', lesson_type[2]);
record.set('pos', lesson_type[3]);
record.set('visible', lesson_type[4]);
record.set("id", lesson_type[0]);
record.set("name", lesson_type[1]);
record.set("type", lesson_type[2]);
record.set("pos", lesson_type[3]);
record.set("visible", lesson_type[4]);
// record.set("created", new Date(Date.now() - i * 1000 * 60 * 60));
// record.set("updated", new Date(Date.now() - i * 1000 * 60 * 60));
$app.save(record);
}
console.log('seeding done');
console.log("seeding done");
};
const dirtyTruncateTable = COLLECTION_NAME => {
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};`);
const cmd_to_exec = $os.cmd("sqlite3", "/pb_data/data.db", `DELETE from ${COLLECTION_NAME};`);
cmd_to_exec.output();
};

File diff suppressed because it is too large Load Diff

View File

@@ -2581,4 +2581,4 @@
"indexes": [],
"system": false
}
]
]