update schema and seed,

This commit is contained in:
louiscklaw
2025-04-22 12:13:33 +08:00
parent e8ded0cb30
commit 0fa277c50e
3 changed files with 183 additions and 23 deletions

View File

@@ -6,15 +6,15 @@ module.exports = ($app) => {
const cat_id_technology = "3".padStart(15, 0);
const getId = (id) => id.padStart(15, 0);
let row_array = [
[getId("1") ,"news (LP)" ,getAsset("ci_news.jpg") ,1 ,{} ,"visible" ,"news" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("2") ,"sports (LP)" ,getAsset("ci_sports.jpg") ,2 ,{} ,"visible" ,"sports" ,getAsset("mouse.mp3") ,cat_id_technology] ,
[getId("3") ,"technology (LP)" ,getAsset("ci_technology.jpg") ,3 ,{} ,"visible" ,"technology" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("4") ,"art (LP)" ,getAsset("ci_art.jpg") ,4 ,{} ,"visible" ,"art" ,getAsset("mouse.mp3") ,cat_id_technology] ,
[getId("5") ,"basic (LP)" ,getAsset("ci_basic.jpg") ,5 ,{} ,"visible" ,"basic" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("6") ,"nature (LP)" ,getAsset("ci_nature.jpg") ,6 ,{} ,"visible" ,"nature" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("7") ,"workplace (LP)" ,getAsset("ci_workplace.jpg") ,7 ,{} ,"visible" ,"workplace" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("8") ,"workplace (LP)" ,getAsset("ci_workplace.jpg") ,8 ,{} ,"visible" ,"workplace" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("99") ,"test hidden (LP)" ,getAsset("ci_workplace.jpg") ,9 ,{} ,"hidden" ,"test" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("1") ,"news (LP)" ,getAsset("ci_news.jpg") ,1 ,{} ,"visible" ,"news" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("2") ,"sports (LP)" ,getAsset("ci_sports.jpg") ,2 ,{} ,"visible" ,"sports" ,getAsset("mouse.mp3") ,cat_id_technology] ,
[getId("3") ,"technology (LP)" ,getAsset("ci_technology.jpg") ,3 ,{} ,"visible" ,"technology" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("4") ,"art (LP)" ,getAsset("ci_art.jpg") ,4 ,{} ,"visible" ,"art" ,getAsset("mouse.mp3") ,cat_id_technology] ,
[getId("5") ,"basic (LP)" ,getAsset("ci_basic.jpg") ,5 ,{} ,"visible" ,"basic" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("6") ,"nature (LP)" ,getAsset("ci_nature.jpg") ,6 ,{} ,"visible" ,"nature" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("7") ,"workplace (LP)" ,getAsset("ci_workplace.jpg") ,7 ,{} ,"visible" ,"workplace" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("8") ,"workplace (LP)" ,getAsset("ci_workplace.jpg") ,8 ,{} ,"visible" ,"workplace" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("99") ,"test hidden (LP)" ,getAsset("ci_workplace.jpg") ,9 ,{} ,"hidden" ,"test" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
];
dirtyTruncateTable("QuizLPQuestions");

View File

@@ -3,17 +3,18 @@ module.exports = ($app) => {
const getAsset = (name) => $filesystem.fileFromPath(ASSETS_DIR + "/" + name);
const id_v = "1".padStart(15, 0); //id_vocabulary
const id_c = "2".padStart(15, 0); //id_connectives
const cat_id_technology = "3".padStart(15, 0);
const getId = (id) => id.padStart(15, 0);
let row_array = [
[getId("1"), "news (MF)", getAsset("ci_news.jpg"), 1, {}, "visible"],
[getId("2"), "sports (MF)", getAsset("ci_sports.jpg"), 2, {}, "visible"],
[getId("3"), "technology (MF)", getAsset("ci_technology.jpg"), 3, {}, "visible"],
[getId("4"), "art (MF)", getAsset("ci_art.jpg"), 4, {}, "visible"],
[getId("5"), "basic (MF)", getAsset("ci_basic.jpg"), 5, {}, "visible"],
[getId("6"), "nature (MF)", getAsset("ci_nature.jpg"), 6, {}, "visible"],
[getId("7"), "workplace (MF)", getAsset("ci_workplace.jpg"), 7, {}, "visible"],
[getId("8"), "workplace (MF)", getAsset("ci_workplace.jpg"), 8, {}, "visible"],
[getId("99"), "test hidden (MF)", getAsset("ci_workplace.jpg"), 9, {}, "hidden"],
[getId("1") ,"news (MF)" ,getAsset("ci_news.jpg") ,1 ,{} ,"visible" ,"news" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("2") ,"sports (MF)" ,getAsset("ci_sports.jpg") ,2 ,{} ,"visible" ,"sports" ,getAsset("mouse.mp3") ,cat_id_technology] ,
[getId("3") ,"technology (MF)" ,getAsset("ci_technology.jpg") ,3 ,{} ,"visible" ,"technology" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("4") ,"art (MF)" ,getAsset("ci_art.jpg") ,4 ,{} ,"visible" ,"art" ,getAsset("mouse.mp3") ,cat_id_technology] ,
[getId("5") ,"basic (MF)" ,getAsset("ci_basic.jpg") ,5 ,{} ,"visible" ,"basic" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("6") ,"nature (MF)" ,getAsset("ci_nature.jpg") ,6 ,{} ,"visible" ,"nature" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("7") ,"workplace (MF)" ,getAsset("ci_workplace.jpg") ,7 ,{} ,"visible" ,"workplace" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("8") ,"workplace (MF)" ,getAsset("ci_workplace.jpg") ,8 ,{} ,"visible" ,"workplace" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
[getId("99") ,"test hidden (MF)" ,getAsset("ci_workplace.jpg") ,9 ,{} ,"hidden" ,"test" ,getAsset("keyboard.mp3") ,cat_id_technology] ,
];
dirtyTruncateTable("QuizMFQuestions");
@@ -29,6 +30,9 @@ module.exports = ($app) => {
record.set("pos", lesson_type[3]);
record.set("init_answer", lesson_type[4]);
record.set("visible", lesson_type[5]);
record.set("word", lesson_type[6]);
record.set("sound", lesson_type[7]);
record.set("cat_id", lesson_type[7]);
$app.save(record);
}

View File

@@ -1370,6 +1370,45 @@
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2560465762",
"max": 0,
"min": 0,
"name": "slug",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1156222427",
"max": 0,
"min": 0,
"name": "remarks",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"convertURLs": false,
"hidden": false,
"id": "editor1843675174",
"maxSize": 0,
"name": "description",
"presentable": false,
"required": false,
"system": false,
"type": "editor"
}
],
"indexes": [],
@@ -1459,6 +1498,109 @@
"presentable": false,
"system": false,
"type": "autodate"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1125157303",
"max": 0,
"min": 0,
"name": "cat_name",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "file2034676914",
"maxSelect": 1,
"maxSize": 0,
"mimeTypes": [],
"name": "cat_image",
"presentable": false,
"protected": false,
"required": false,
"system": false,
"thumbs": [],
"type": "file"
},
{
"hidden": false,
"id": "number2161764012",
"max": null,
"min": null,
"name": "pos",
"onlyInt": false,
"presentable": false,
"required": false,
"system": false,
"type": "number"
},
{
"hidden": false,
"id": "json3915970527",
"maxSize": 0,
"name": "init_answer",
"presentable": false,
"required": false,
"system": false,
"type": "json"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2058414169",
"max": 0,
"min": 0,
"name": "visible",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2560465762",
"max": 0,
"min": 0,
"name": "slug",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1156222427",
"max": 0,
"min": 0,
"name": "remarks",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"convertURLs": false,
"hidden": false,
"id": "editor1843675174",
"maxSize": 0,
"name": "description",
"presentable": false,
"required": false,
"system": false,
"type": "editor"
}
],
"indexes": [],
@@ -1646,6 +1788,20 @@
"presentable": false,
"system": false,
"type": "autodate"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2058414169",
"max": 0,
"min": 0,
"name": "visible",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}
],
"indexes": [],
@@ -1831,11 +1987,11 @@
},
{
"id": "pbc_1305841361",
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"listRule": "",
"viewRule": "",
"createRule": "",
"updateRule": "",
"deleteRule": "",
"name": "UserMetas",
"type": "base",
"fields": [