initialize project with basic structure and dependencies

This commit is contained in:
ImBenji 2026-04-28 00:53:34 +01:00
parent 8d550ebf54
commit 01a0dff53e
19 changed files with 41 additions and 1404 deletions

View file

@ -3,13 +3,50 @@ CREATE TABLE `courses` (
`title` text NOT NULL, `title` text NOT NULL,
`subject` text NOT NULL, `subject` text NOT NULL,
`status` text DEFAULT 'processing' NOT NULL, `status` text DEFAULT 'processing' NOT NULL,
`stage` text,
`cost_ai` real DEFAULT 0,
`cost_audio` real DEFAULT 0,
`audit_report` text,
`audit_score` integer,
`organisation` text,
`created_at` text DEFAULT (datetime('now')) NOT NULL `created_at` text DEFAULT (datetime('now')) NOT NULL
); );
--> statement-breakpoint --> statement-breakpoint
CREATE TABLE `uploads` (
`id` text PRIMARY KEY NOT NULL,
`course_id` text NOT NULL,
`filename` text NOT NULL,
`type` text NOT NULL,
`stored_path` text NOT NULL,
`extracted_text` text,
`created_at` text DEFAULT (datetime('now')) NOT NULL,
FOREIGN KEY (`course_id`) REFERENCES `courses`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `topics` (
`id` text PRIMARY KEY NOT NULL,
`course_id` text NOT NULL,
`title` text NOT NULL,
`description` text NOT NULL,
`order` integer NOT NULL,
`prerequisite_topic_ids` text DEFAULT '[]' NOT NULL,
`difficulty` integer DEFAULT 1 NOT NULL,
`relevant_files` text,
`status` text DEFAULT 'pending' NOT NULL,
FOREIGN KEY (`course_id`) REFERENCES `courses`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `lessons` ( CREATE TABLE `lessons` (
`id` text PRIMARY KEY NOT NULL, `id` text PRIMARY KEY NOT NULL,
`topic_id` text NOT NULL, `topic_id` text NOT NULL,
`content` text NOT NULL, `content` text NOT NULL,
`tts_provider` text,
`cost_ai` real DEFAULT 0,
`cost_audio` real DEFAULT 0,
`cost_branch_ai` real DEFAULT 0,
`cost_branch_audio` real DEFAULT 0,
`cost_total` real DEFAULT 0,
`branch_status` text DEFAULT 'pending' NOT NULL,
`created_at` text DEFAULT (datetime('now')) NOT NULL, `created_at` text DEFAULT (datetime('now')) NOT NULL,
FOREIGN KEY (`topic_id`) REFERENCES `topics`(`id`) ON UPDATE no action ON DELETE no action FOREIGN KEY (`topic_id`) REFERENCES `topics`(`id`) ON UPDATE no action ON DELETE no action
); );
@ -25,33 +62,14 @@ CREATE TABLE `quiz_questions` (
FOREIGN KEY (`topic_id`) REFERENCES `topics`(`id`) ON UPDATE no action ON DELETE no action FOREIGN KEY (`topic_id`) REFERENCES `topics`(`id`) ON UPDATE no action ON DELETE no action
); );
--> statement-breakpoint --> statement-breakpoint
CREATE TABLE `topics` (
`id` text PRIMARY KEY NOT NULL,
`course_id` text NOT NULL,
`title` text NOT NULL,
`description` text NOT NULL,
`order` integer NOT NULL,
`prerequisite_topic_ids` text DEFAULT '[]' NOT NULL,
`difficulty` integer DEFAULT 1 NOT NULL,
FOREIGN KEY (`course_id`) REFERENCES `courses`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `uploads` (
`id` text PRIMARY KEY NOT NULL,
`course_id` text NOT NULL,
`filename` text NOT NULL,
`type` text NOT NULL,
`stored_path` text NOT NULL,
`created_at` text DEFAULT (datetime('now')) NOT NULL,
FOREIGN KEY (`course_id`) REFERENCES `courses`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `user_progress` ( CREATE TABLE `user_progress` (
`id` text PRIMARY KEY NOT NULL, `id` text PRIMARY KEY NOT NULL,
`course_id` text NOT NULL, `course_id` text NOT NULL,
`topic_id` text NOT NULL, `topic_id` text NOT NULL,
`lesson_complete` integer DEFAULT false NOT NULL, `lesson_complete` integer DEFAULT false NOT NULL,
`quiz_score` integer, `quiz_score` integer,
`took_branches` integer DEFAULT false NOT NULL,
`branch_count` integer DEFAULT 0 NOT NULL,
`updated_at` text DEFAULT (datetime('now')) NOT NULL, `updated_at` text DEFAULT (datetime('now')) NOT NULL,
FOREIGN KEY (`course_id`) REFERENCES `courses`(`id`) ON UPDATE no action ON DELETE no action, FOREIGN KEY (`course_id`) REFERENCES `courses`(`id`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`topic_id`) REFERENCES `topics`(`id`) ON UPDATE no action ON DELETE no action FOREIGN KEY (`topic_id`) REFERENCES `topics`(`id`) ON UPDATE no action ON DELETE no action

View file

@ -1 +0,0 @@
ALTER TABLE `uploads` ADD `extracted_text` text;

View file

@ -1 +0,0 @@
ALTER TABLE `courses` ADD `stage` text;

View file

@ -1 +0,0 @@
ALTER TABLE `lessons` ADD `audio_path` text;

View file

@ -1 +0,0 @@
ALTER TABLE `lessons` ADD `audio_chunks` text;

View file

@ -1 +0,0 @@
ALTER TABLE `courses` ADD `cost_ai` real DEFAULT 0;

View file

@ -1 +0,0 @@
ALTER TABLE `courses` ADD `cost_audio` real DEFAULT 0;

View file

@ -1 +0,0 @@
ALTER TABLE user_progress ADD COLUMN took_branches INTEGER NOT NULL DEFAULT 0;

View file

@ -1 +0,0 @@
ALTER TABLE user_progress ADD COLUMN branch_count INTEGER NOT NULL DEFAULT 0;

View file

@ -1 +0,0 @@
ALTER TABLE courses ADD COLUMN audit_report TEXT;

View file

@ -1 +0,0 @@
ALTER TABLE courses ADD COLUMN audit_score INTEGER;

View file

@ -1 +0,0 @@
ALTER TABLE `lessons` ADD `tts_provider` text;

View file

@ -1 +0,0 @@
ALTER TABLE `courses` ADD `organisation` text;

View file

@ -1 +0,0 @@
ALTER TABLE `topics` ADD `relevant_files` text;

View file

@ -1,7 +0,0 @@
ALTER TABLE `topics` ADD `status` text DEFAULT 'pending' NOT NULL;
ALTER TABLE `lessons` ADD `cost_ai` real DEFAULT 0;
ALTER TABLE `lessons` ADD `cost_audio` real DEFAULT 0;
ALTER TABLE `lessons` ADD `cost_branch_ai` real DEFAULT 0;
ALTER TABLE `lessons` ADD `cost_branch_audio` real DEFAULT 0;
ALTER TABLE `lessons` ADD `cost_total` real DEFAULT 0;
ALTER TABLE `lessons` ADD `branch_status` text DEFAULT 'pending' NOT NULL;

View file

@ -1,414 +0,0 @@
{
"version": "6",
"dialect": "sqlite",
"id": "42b7d448-5f22-45aa-850d-dde77533d699",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"courses": {
"name": "courses",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"subject": {
"name": "subject",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'processing'"
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(datetime('now'))"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"lessons": {
"name": "lessons",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"topic_id": {
"name": "topic_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"content": {
"name": "content",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(datetime('now'))"
}
},
"indexes": {},
"foreignKeys": {
"lessons_topic_id_topics_id_fk": {
"name": "lessons_topic_id_topics_id_fk",
"tableFrom": "lessons",
"tableTo": "topics",
"columnsFrom": [
"topic_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"quiz_questions": {
"name": "quiz_questions",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"topic_id": {
"name": "topic_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"question": {
"name": "question",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"options": {
"name": "options",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"answer": {
"name": "answer",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"explanation": {
"name": "explanation",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"quiz_questions_topic_id_topics_id_fk": {
"name": "quiz_questions_topic_id_topics_id_fk",
"tableFrom": "quiz_questions",
"tableTo": "topics",
"columnsFrom": [
"topic_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"topics": {
"name": "topics",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"course_id": {
"name": "course_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"order": {
"name": "order",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"prerequisite_topic_ids": {
"name": "prerequisite_topic_ids",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'[]'"
},
"difficulty": {
"name": "difficulty",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 1
}
},
"indexes": {},
"foreignKeys": {
"topics_course_id_courses_id_fk": {
"name": "topics_course_id_courses_id_fk",
"tableFrom": "topics",
"tableTo": "courses",
"columnsFrom": [
"course_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"uploads": {
"name": "uploads",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"course_id": {
"name": "course_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"filename": {
"name": "filename",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"stored_path": {
"name": "stored_path",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(datetime('now'))"
}
},
"indexes": {},
"foreignKeys": {
"uploads_course_id_courses_id_fk": {
"name": "uploads_course_id_courses_id_fk",
"tableFrom": "uploads",
"tableTo": "courses",
"columnsFrom": [
"course_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"user_progress": {
"name": "user_progress",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"course_id": {
"name": "course_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"topic_id": {
"name": "topic_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"lesson_complete": {
"name": "lesson_complete",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": false
},
"quiz_score": {
"name": "quiz_score",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(datetime('now'))"
}
},
"indexes": {},
"foreignKeys": {
"user_progress_course_id_courses_id_fk": {
"name": "user_progress_course_id_courses_id_fk",
"tableFrom": "user_progress",
"tableTo": "courses",
"columnsFrom": [
"course_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"user_progress_topic_id_topics_id_fk": {
"name": "user_progress_topic_id_topics_id_fk",
"tableFrom": "user_progress",
"tableTo": "topics",
"columnsFrom": [
"topic_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
}
},
"views": {},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"indexes": {}
}
}

View file

@ -1,421 +0,0 @@
{
"version": "6",
"dialect": "sqlite",
"id": "58920b2c-2c0f-42b4-a675-2b30e03bd747",
"prevId": "42b7d448-5f22-45aa-850d-dde77533d699",
"tables": {
"courses": {
"name": "courses",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"subject": {
"name": "subject",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'processing'"
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(datetime('now'))"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"lessons": {
"name": "lessons",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"topic_id": {
"name": "topic_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"content": {
"name": "content",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(datetime('now'))"
}
},
"indexes": {},
"foreignKeys": {
"lessons_topic_id_topics_id_fk": {
"name": "lessons_topic_id_topics_id_fk",
"tableFrom": "lessons",
"tableTo": "topics",
"columnsFrom": [
"topic_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"quiz_questions": {
"name": "quiz_questions",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"topic_id": {
"name": "topic_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"question": {
"name": "question",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"options": {
"name": "options",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"answer": {
"name": "answer",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"explanation": {
"name": "explanation",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"quiz_questions_topic_id_topics_id_fk": {
"name": "quiz_questions_topic_id_topics_id_fk",
"tableFrom": "quiz_questions",
"tableTo": "topics",
"columnsFrom": [
"topic_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"topics": {
"name": "topics",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"course_id": {
"name": "course_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"order": {
"name": "order",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"prerequisite_topic_ids": {
"name": "prerequisite_topic_ids",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'[]'"
},
"difficulty": {
"name": "difficulty",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 1
}
},
"indexes": {},
"foreignKeys": {
"topics_course_id_courses_id_fk": {
"name": "topics_course_id_courses_id_fk",
"tableFrom": "topics",
"tableTo": "courses",
"columnsFrom": [
"course_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"uploads": {
"name": "uploads",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"course_id": {
"name": "course_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"filename": {
"name": "filename",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"stored_path": {
"name": "stored_path",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"extracted_text": {
"name": "extracted_text",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(datetime('now'))"
}
},
"indexes": {},
"foreignKeys": {
"uploads_course_id_courses_id_fk": {
"name": "uploads_course_id_courses_id_fk",
"tableFrom": "uploads",
"tableTo": "courses",
"columnsFrom": [
"course_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"user_progress": {
"name": "user_progress",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"course_id": {
"name": "course_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"topic_id": {
"name": "topic_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"lesson_complete": {
"name": "lesson_complete",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": false
},
"quiz_score": {
"name": "quiz_score",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(datetime('now'))"
}
},
"indexes": {},
"foreignKeys": {
"user_progress_course_id_courses_id_fk": {
"name": "user_progress_course_id_courses_id_fk",
"tableFrom": "user_progress",
"tableTo": "courses",
"columnsFrom": [
"course_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"user_progress_topic_id_topics_id_fk": {
"name": "user_progress_topic_id_topics_id_fk",
"tableFrom": "user_progress",
"tableTo": "topics",
"columnsFrom": [
"topic_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
}
},
"views": {},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"indexes": {}
}
}

View file

@ -1,428 +0,0 @@
{
"version": "6",
"dialect": "sqlite",
"id": "85b190a4-a50e-4a71-a0df-ac5c1ac5c869",
"prevId": "58920b2c-2c0f-42b4-a675-2b30e03bd747",
"tables": {
"courses": {
"name": "courses",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"subject": {
"name": "subject",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'processing'"
},
"stage": {
"name": "stage",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(datetime('now'))"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"lessons": {
"name": "lessons",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"topic_id": {
"name": "topic_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"content": {
"name": "content",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(datetime('now'))"
}
},
"indexes": {},
"foreignKeys": {
"lessons_topic_id_topics_id_fk": {
"name": "lessons_topic_id_topics_id_fk",
"tableFrom": "lessons",
"tableTo": "topics",
"columnsFrom": [
"topic_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"quiz_questions": {
"name": "quiz_questions",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"topic_id": {
"name": "topic_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"question": {
"name": "question",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"options": {
"name": "options",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"answer": {
"name": "answer",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"explanation": {
"name": "explanation",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"quiz_questions_topic_id_topics_id_fk": {
"name": "quiz_questions_topic_id_topics_id_fk",
"tableFrom": "quiz_questions",
"tableTo": "topics",
"columnsFrom": [
"topic_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"topics": {
"name": "topics",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"course_id": {
"name": "course_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"order": {
"name": "order",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"prerequisite_topic_ids": {
"name": "prerequisite_topic_ids",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'[]'"
},
"difficulty": {
"name": "difficulty",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 1
}
},
"indexes": {},
"foreignKeys": {
"topics_course_id_courses_id_fk": {
"name": "topics_course_id_courses_id_fk",
"tableFrom": "topics",
"tableTo": "courses",
"columnsFrom": [
"course_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"uploads": {
"name": "uploads",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"course_id": {
"name": "course_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"filename": {
"name": "filename",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"stored_path": {
"name": "stored_path",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"extracted_text": {
"name": "extracted_text",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(datetime('now'))"
}
},
"indexes": {},
"foreignKeys": {
"uploads_course_id_courses_id_fk": {
"name": "uploads_course_id_courses_id_fk",
"tableFrom": "uploads",
"tableTo": "courses",
"columnsFrom": [
"course_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"user_progress": {
"name": "user_progress",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"course_id": {
"name": "course_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"topic_id": {
"name": "topic_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"lesson_complete": {
"name": "lesson_complete",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": false
},
"quiz_score": {
"name": "quiz_score",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(datetime('now'))"
}
},
"indexes": {},
"foreignKeys": {
"user_progress_course_id_courses_id_fk": {
"name": "user_progress_course_id_courses_id_fk",
"tableFrom": "user_progress",
"tableTo": "courses",
"columnsFrom": [
"course_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"user_progress_topic_id_topics_id_fk": {
"name": "user_progress_topic_id_topics_id_fk",
"tableFrom": "user_progress",
"tableTo": "topics",
"columnsFrom": [
"topic_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
}
},
"views": {},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"indexes": {}
}
}

View file

@ -6,106 +6,8 @@
"idx": 0, "idx": 0,
"version": "6", "version": "6",
"when": 1777109155026, "when": 1777109155026,
"tag": "0000_curved_aqueduct", "tag": "0000_init",
"breakpoints": true
},
{
"idx": 1,
"version": "6",
"when": 1777110758287,
"tag": "0001_nervous_the_fury",
"breakpoints": true
},
{
"idx": 2,
"version": "6",
"when": 1777111595079,
"tag": "0002_special_korg",
"breakpoints": true
},
{
"idx": 3,
"version": "6",
"when": 1777200000000,
"tag": "0003_adhd_mode_audio",
"breakpoints": true
},
{
"idx": 4,
"version": "6",
"when": 1777200000001,
"tag": "0004_adhd_mode_audio_chunks",
"breakpoints": true
},
{
"idx": 5,
"version": "6",
"when": 1777200000002,
"tag": "0005_cost_ai",
"breakpoints": true
},
{
"idx": 6,
"version": "6",
"when": 1777200000003,
"tag": "0006_cost_audio",
"breakpoints": true
},
{
"idx": 7,
"version": "6",
"when": 1777200000004,
"tag": "0007_branch_took",
"breakpoints": true
},
{
"idx": 8,
"version": "6",
"when": 1777200000005,
"tag": "0008_branch_count",
"breakpoints": true
},
{
"idx": 9,
"version": "6",
"when": 1777200000006,
"tag": "0009_audit_report",
"breakpoints": true
},
{
"idx": 10,
"version": "6",
"when": 1777200000007,
"tag": "0010_audit_score",
"breakpoints": true
},
{
"idx": 11,
"version": "6",
"when": 1777200000008,
"tag": "0011_tts_provider",
"breakpoints": true
},
{
"idx": 12,
"version": "6",
"when": 1777200000009,
"tag": "0012_organisation",
"breakpoints": true
},
{
"idx": 13,
"version": "6",
"when": 1777200000010,
"tag": "0013_relevant_files",
"breakpoints": true
},
{
"idx": 14,
"version": "6",
"when": 1777200000011,
"tag": "0014_jit_lessons",
"breakpoints": true "breakpoints": true
} }
] ]
} }