diff --git a/.drone.yml b/.drone.yml
index 448e2917c..a0b7596ce 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -3,21 +3,6 @@ type: docker
name: Deploy TripBot
steps:
- - name: Redo Migrations
- image: docker
- privileged: true
- commands:
- - apk update
- - apk upgrade
- - apk add --no-cache git
- - docker compose -f docker-compose.host.yml --project-name tripbot up tripbot_prisma -d --force-recreate --build
- # - tail -f /dev/null
- environment:
- DOCKER_HOST:
- from_secret: DOCKER_HOST
- DOCKER_BUILDKIT:
- from_secret: DOCKER_BUILDKIT
-
- name: Rebuild API
image: docker
privileged: true
diff --git a/.eslintignore b/.eslintignore
index ae48b4db1..88e319db0 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -4,4 +4,5 @@
**/src/telegram/**
**/src/irc/**
**/jest/**
-**/build/**
\ No newline at end of file
+**/build/**
+**/@prisma-moodle/**
\ No newline at end of file
diff --git a/.github/workflows/PullRequestOpenAll.yml b/.github/workflows/PullRequestOpenAll.yml
index 82f053a46..915df071d 100644
--- a/.github/workflows/PullRequestOpenAll.yml
+++ b/.github/workflows/PullRequestOpenAll.yml
@@ -9,17 +9,28 @@ on:
- opened
- synchronize
- reopened
+ paths-ignore:
+ - '**/archive/**'
+ - '**/legacy/**'
+ - '**/matrix/**'
+ - '**/telegram/**'
+ - '**/irc/**'
+ - '**/jest/**'
+ - '**/build/**'
+ - '**/@prisma-moodle/**'
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
+ env:
+ NODE_OPTIONS: --max-old-space-size=7168
steps:
- uses: actions/checkout@v3
- - name: Use Node.js '20.5.0'
+ - name: Use Node.js '21.1.0'
uses: actions/setup-node@v3
with:
- node-version: '20.5.0'
+ node-version: '21.1.0'
cache: 'npm'
- name: Update npm
run: npm install -g npm && npm --version
@@ -45,9 +56,11 @@ jobs:
# run: cp .env.example .env
# - name: Test
# run: npx jest --silent -c ./src/jest/jest.unit.config.ts
- codeql:
+ codeql:
name: CodeQL
runs-on: ubuntu-latest
+ env:
+ NODE_OPTIONS: --max-old-space-size=7168
permissions:
actions: read
contents: read
diff --git a/.github/workflows/PushToMain.yml b/.github/workflows/PushToMain.yml
index d5c5b6707..b2e2a5e7a 100644
--- a/.github/workflows/PushToMain.yml
+++ b/.github/workflows/PushToMain.yml
@@ -4,17 +4,27 @@ on:
push:
branches:
- main
-
+ paths-ignore:
+ - '**/archive/**'
+ - '**/legacy/**'
+ - '**/matrix/**'
+ - '**/telegram/**'
+ - '**/irc/**'
+ - '**/jest/**'
+ - '**/build/**'
+ - '**/@prisma-moodle/**'
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
+ env:
+ NODE_OPTIONS: --max-old-space-size=7168
steps:
- uses: actions/checkout@v3
- - name: Use Node.js '20.5.0'
+ - name: Use Node.js '21.1.0'
uses: actions/setup-node@v3
with:
- node-version: '20.5.0'
+ node-version: '21.1.0'
cache: 'npm'
- name: Update npm
run: npm install -g npm && npm --version
diff --git a/.gitignore b/.gitignore
index d0a3b3289..fc8ed9eda 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,7 @@
*.user
*.userosscache
*.sln.docstates
+.vscode
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
@@ -369,3 +370,4 @@ coverage/
src/discord/assets/img/*/*.png
src/matrix/cache/tripbot.json
.env.example
+src/prisma/moodle/@prisma-moodle/client/libquery_engine-linux-musl-openssl-3.0.x.so.node
diff --git a/.nvmrc b/.nvmrc
index b55acecd6..4f2a661ad 100644
--- a/.nvmrc
+++ b/.nvmrc
@@ -1 +1 @@
-v20.5.0
\ No newline at end of file
+v21.1.0
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index d21cedc64..000000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "eslint.codeActionsOnSave.rules": null,
- "editor.codeActionsOnSave": {
- "source.fixAll.eslint": true
- },
- "eslint.validate": [
- "javascript",
- "typescript",
- ],
- "editor.tabSize": 2,
- "cSpell.words": [
- "AILOG",
- "Blurple",
- "bottest",
- "logit",
- "MDMA",
- "modlog",
- "moodle",
- "Moonbear",
- "openai",
- "tripbot"
- ],
-}
\ No newline at end of file
diff --git a/README.MD b/README.MD
index 6fe412ad2..b61e941a2 100644
--- a/README.MD
+++ b/README.MD
@@ -2,97 +2,108 @@
## Table of contents
+ [About](#about)
-+ [How to use](#how-to-use)
++ [How to use](#invite)
+ [Contribute](#contribute)
+ [Authors](#contributors)
-
-## 🧐 About
-TripBot is an over-complicated (**multi-platform**(!)) bot that is a major part of our project **[TripSit](https://tripsit.me)** providing open discussion of and education about safer use and harm reduction techniques, If you want, you can [read more](https://tripsit.me/about/) about our mission.
-
-This bot's code is open source in the interest of helping people. We use it a lot, there's active development happening, and you can use it on your guild too!
+## About
+TripBot is multi-platform open-source bot that is a major part of the **[TripSit](https://tripsit.me)** project.
+It is primarily a discord bot, but has been built modularly to allow for easy expansion to other platforms such as IRC, Matrix, and Telegram.
+This bot's code is open source in the interest of helping people learn code, and to encourage people to contribute to the project.
The goals with this bot are:
-1) Provide for the needs of TripSit's community and make it an awesome place to be!
-2) Spread access to TripSit's information by allowing greater access to our wiki on discord.
+1) Provide for the needs of TripSit's community such as drug information, harm reduction, and community support.
+2) Spread access to TripSit's Harm Reduction information by encouraging other Discord guilds to use our bot.
3) Get traffic back to our discord, ultimately to gather more information that can be spread further and help more people!
-4) Allow other guilds to host their own "tripsit" service?
-5) Allow the bot to be a "remote tripsit" service??
-
-## Features
-Full Typescript support
-Postgres database support
-Prisma integration support
-Discord.js 14.8
-Jest testing support
-Sonar scanning
-Dockerized
-
-## 🎈 How to use
+
+## Invite
+ We run an instance of the bot that you can add to your guild following [this link](https://discord.com/api/oauth2/authorize?client_id=957780726806380545&permissions=18432&scope=bot%20applications.commands)
-## Contribute
+## Development
+
+Want to help out?
-If you want to contribute to TripBot, that's super cool and highly appreciated.
To get in touch, it's currently the easiest way to [Join our Discord guild](https://discord.gg/tripsit).
+Contributing to TripBot is super appreciated, and it's easy to get involved: [Join our Discord guild](https://discord.gg/tripsit) and check out the Development sections to get started.
-## How to build
-+ If you want to host your own instance of the bot, first talk to Moonbear to see if these instructions are valid. If they are, then you can follow these steps to get your own instance of the bot running.
+### Features
+Fully Typescript
+Postgres Relational Database
+Prisma ORM and Client
+Discord.js
+Jest Testing
+SonarQube Code Quality
+Docker Containerized
+ESlint Linting
+Nodemon Hot Reloading
+TSC Auto Building
+Drone Continuous Integration
-0: **Requirements**
+### How to build
+
+**Requirements**
1) Docker. You can get it [here](https://www.docker.com/products/docker-desktop).
2) A discord bot application. You can get one [here](https://discord.com/developers/applications).
-- Save your client ID and Token to the .env file (after you make it via copying env.example)
-3) A discord guild to test the bot in.
-- It's preferred that you use the TripSit dev guild, but you can use your own if you want.
-- If you use your own, you'll need to update the env.config file with your channel/roles IDs.
-- Save your guild ID to the .env file
-4) A discord bot application invite link. You can get this from your discord bot application.
-- For basic functionality you dont need a ton of permissions
-- Moonbear will give your bot permissions on the dev guild
-- On you own private guild just give it admin permissions
-- There are permission checks but they're a bit wonky.
-
-1: **Setup the bot**
+
+
+**Optional**
+1) VSCode. You can get it [here](https://code.visualstudio.com/).
+2) ESLint extension for VSCode. You can get it [here](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint).
+3) Invite the discord bot to the tripsit dev guild. Ask Moonbear for an invite link. The bot will not work properly without doing this.
+
+**Setup the bot**
Clone the repository
``` git clone https://github.com/TripSit/TripBot.git```
-Copy env.example to .env and fill in these fields. You only /need/ the discord stuff
+Copy env.example to .env and fill in these fields. You only /need/ the discord stuff like the token and client ID
-2: **Start the tripbot container**
+Install the dependencies locally so that VSCode can use them for linting and intellisense.
-```npm run tripbot```
+```npm install```
-This will start the container and build the bot. It will also run the bot in the container.
-If you need to update the container (like if you update the .env), use this command again.
-In general, if something isnt working right, rebuild the container.
+**Start the bot**
-2: **Deploy commands**
+This will start up the tripbot_database, build the bot, and run the bot in a container.
+The database container just basically sits there being a stable database, you don't need to check it's logs or anything.
-```npm run tripbot:deploy```
+```npm run tripbot:start```
-As part of the build process it will to register the bot commands with discord.
-If you modify or create a new commands you'll need to run this script again, or rebuild the container.
+You will likely want to immediately check the logs of the container to make sure it started up correctly.
-3: **View logs**
+**View logs**
-```npm run logs```
+```npm run tripbot:logs```
This will show you the logs of tripbot from inside the container.
-When i develop i have this running in a separate terminal window so i can see the logs as i work.
-4: **Develop!**
+**Deploy commands**
+
+This command will happen automatically when you build the TripBot container and tells discord what commands are available.
+
+```npm run tripbot:deployCommands```
+
+**If you create a new command, or modify the options in an existing command, you'll need to deploy commands again.**
+
+**Develop**
The container will watch the /src folder for changes and rebuild the bot when you save a file.
-If you create or update a command, make sure to run the deploy script again
-5: **Test/Lint**
+**Lint**
It's /highly/ recommended to use the eslint extension, and allow vscode the auto-fix your linting errors.
Jest tests are a WIP.
-## Folder Structure ##
+```npm run tripbot:lint```
+
+**Test**
+
+Jest tests are a WIP and while appreciated it's not required to add tests to your code
+
+```npm run tripbot:test```
+
+### Folder Structure ##
+```
src/ : This is where all the code lives
src/api : External API endpoints, see "API" below
src/api/v1 : Legacy json endpoint
@@ -108,8 +119,9 @@ src/pgadmin4 : PGAdmin4 webserver, used in database development, see "Database D
src/postgres : Postgres startup script, used in database development, see "Database Development" below.
src/prisma : Prisma database code, see "Database Development" below.
src/telegram : Telegram specific code, see "How commands work" below.
+```
-## How Commands Work
+### How Commands Work
Most commands are built with a global core function, and then have a UI function that interacts with that global function.
For example: We have the /birthday command on discord.
When someone runs the /birthday set command on discord, they enter their birth month and day.
@@ -127,43 +139,48 @@ If you wanted to do this in telegram, you would figure out how to take input val
| | | | | | | | | |
+---------+ +------------+ +------------+ +-------------+ +---------+
-## Database Development ##
+### Database Development ##
-TripBot's database runs on Postgres, which is a relational database.
+TripBot's database runs on Postgres, which is a relational database, not a JSON file.
-You make changes to the schema.prisma, and then run the ```npm run prisma:migrate``` to create the migration file
+When TripBot starts, it will automatically create the tripbot_database container and run the migrations.
-When this file is pushed to production, the database will be updated automatically.
+This gives you a copy of the production table schema on your local machine.
-One of the goals is to convert the knex queries in tripbot into Prisma Client queries.
+To make changes to the database, you need to use the Prisma ORM and make changes to the schema.prisma file.
+
+Run the ```db:migrateDev``` to create new migration files based on the changes you made to the schema.prisma file.
+
+When these migration files are pushed to production, the database will be updated automatically.
+
+Prisma documentation is excellent, check out guides like: https://www.prisma.io/docs/concepts/components/prisma-migrate/migrate-development-production
+
+#### Postgres ###
-### Postgres ###
```npm run postgres```
+
We use postgres for our database.
+
This is just a simple container that basically sits there being a stable database.
+
By itself, it does nothing, you need another utility, like Prisma, to interact with it.
-### Prisma ###
-```npm run prisma```
-Prisma runs the necessary setup to fill in the database tables and columns.
-You just need to run this container once and you can forget about it.
-Previously we used Knex so you'll still see some knex code, but we're moving away from that.
-There is a webserver (prisma studio) that starts as part of this container.
-You can access it via http://localhost:5555
-If you're worried about this, exit the prisma container after it finishes running.
-It only needs to run once to setup the DB.
-
-### PG Admin ###
+#### PG Admin ###
+
```npm run pgadmin```
+
This is a webserver that allows you to view the database.
+
It's not necessary, but it's nice to have.
+
You can access it via http://localhost:80 (maybe idk)
-### API ###
+#### API ###
+
```npm run api```
+
This is a simple API that allows you to interact with the database.
-There's a bit of neuance to the api:
+
V1 : legacy tripbot APi that interacts with static .json files
-V2 : the new prisma api that interacts with postgres for the appeal system
-There is also an api endpoint within tripbot that receives webhooks from the appeal system.
\ No newline at end of file
+V2 : the new prisma api that interacts with postgres for the appeal system
diff --git a/docker-compose.yml b/docker-compose.yml
index abb193444..d2ae1d784 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -33,7 +33,6 @@ services:
container_name: tripbot
depends_on:
- tripbot_database
- - tripbot_prisma
working_dir: /usr/src/app
env_file:
- .env
@@ -43,11 +42,10 @@ services:
- tripbot-net
- tripbot_database-net
- tripbot_website-net
+ - moodle_data-net
volumes:
- ./src:/usr/src/app/src # Needed for hot-reloading of source code
- ./.env:/usr/src/app/.env # Needed for hot-reloading the .env
- - ./package.json:/usr/src/app/package.json # Needed for saving changes to package.json
- - ./package-lock.json:/usr/src/app/package-lock.json # Needed for saving changes to package.json
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
labels:
@@ -63,7 +61,6 @@ services:
tripbot_database:
<<: *common-keys-apps
- # image: docker.io/bitnami/postgresql:15.4.0
image: postgres:15.4
container_name: tripbot_database
# Uncomment this if you want the DB to persist between rebuilds
@@ -73,46 +70,14 @@ services:
- tripbot_database-net
environment:
<<: *default-tz-puid-pgid
- POSTGRESQL_DATABASE: tripsit
- POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
+ POSTGRES_DB: tripsit
+ POSTGRES_USER: tripsit
+ POSTGRES_PASSWORD: ${POSTGRESQL_PASSWORD}
labels:
- com.centurylinklabs.watchtower.enable=false
- traefik.docker.network=tripbot_database-net
- traefik.enable=false
- tripbot_prisma:
- <<: *common-keys-apps
- build:
- # context: https://github.com/tripsit/tripbot.git#main
- context: ./
- dockerfile: ./src/docker/Dockerfile.prisma
- target: development
- container_name: tripbot_prisma
- working_dir: /usr/src/app
- depends_on:
- - tripbot_database
- networks:
- - tripbot_database-net
- - tripbot_prisma-net
- volumes:
- - ./src/prisma/:/usr/src/app/src/prisma/
- environment:
- <<: *default-tz-puid-pgid
- PORT: 5000
- TZ: America/Chicago
- POSTGRES_DB_URL: postgres://tripsit:${POSTGRESQL_PASSWORD}@tripbot_database:5432/tripsit
- labels:
- - com.centurylinklabs.watchtower.enable=false
- - traefik.enable=true
- - traefik.docker.network=tripbot_prisma-net
- - traefik.http.services.tripbot_prisma-svc.loadbalancer.server.port=5555
-
- - traefik.http.routers.tripbot_prisma.rule=Host(`prisma.${DNS_DOMAIN}`)
- - traefik.http.routers.tripbot_prisma.entrypoints=websecure
- - traefik.http.routers.tripbot_prisma.tls.certresolver=letsencrypt
- - traefik.http.routers.tripbot_prisma.service=tripbot_prisma-svc
- - traefik.http.routers.tripbot_prisma.middlewares=googleAuth@file
-
tripbot_pgadmin:
image: dpage/pgadmin4:latest
restart: unless-stopped
@@ -217,4 +182,7 @@ networks:
# external: true
tripbot_pgadmin-net:
name: tripbot_pgadmin-net
+ # external: true
+ moodle_data-net:
+ name: moodle_data-net
# external: true
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index b5f5b51b1..8a644f6a3 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -11,12 +11,12 @@
"dependencies": {
"@discordjs/voice": "^0.16.0",
"@napi-rs/canvas": "^0.1.44",
- "@octokit/types": "^12.1.1",
+ "@octokit/types": "^12.2.0",
"@octokit/webhooks-types": "^7.3.1",
"@prisma/client": "^5.5.2",
- "@sentry/node": "^7.77.0",
- "argon2": "^0.31.1",
- "axios": "^1.6.0",
+ "@sentry/node": "^7.79.0",
+ "argon2": "^0.31.2",
+ "axios": "^1.6.1",
"body-parser": "^1.20.2",
"common-tags": "^1.8.2",
"convert-units": "^2.3.4",
@@ -29,10 +29,10 @@
"dotenv": "^16.3.1",
"escape-html": "^1.0.3",
"express": "^4.18.2",
- "express-rate-limit": "^7.1.3",
+ "express-rate-limit": "^7.1.4",
"fuse.js": "^7.0.0",
"he": "^1.2.0",
- "helmet": "^7.0.0",
+ "helmet": "^7.1.0",
"imdb-api": "^4.4.1",
"keycloak-admin": "^1.14.22",
"knex": "^3.0.1",
@@ -43,7 +43,7 @@
"node-os-utils": "^1.3.7",
"objection": "^3.1.2",
"octokit": "^3.1.1",
- "openai": "^4.14.2",
+ "openai": "^4.16.2",
"pg": "^8.11.3",
"rss-parser": "^3.13.0",
"sonar-scanner": "^3.1.0",
@@ -56,32 +56,32 @@
"youtube-search-without-api-key": "^1.1.0"
},
"devDependencies": {
- "@types/common-tags": "^1.8.3",
- "@types/convert-units": "^2.3.8",
- "@types/cors": "^2.8.15",
- "@types/escape-html": "^1.0.3",
- "@types/express": "^4.17.20",
- "@types/he": "^1.2.2",
- "@types/jest": "^29.5.7",
- "@types/luxon": "^3.3.3",
- "@types/morgan": "^1.9.7",
- "@types/ms": "^0.7.33",
- "@types/node": "^20.8.10",
- "@types/node-os-utils": "^1.3.3",
- "@types/source-map-support": "^0.5.9",
- "@types/supertest": "^2.0.15",
- "@types/underscore": "^1.11.12",
- "@typescript-eslint/eslint-plugin": "^6.9.1",
- "@typescript-eslint/parser": "^6.9.1",
+ "@types/common-tags": "^1.8.4",
+ "@types/convert-units": "^2.3.9",
+ "@types/cors": "^2.8.16",
+ "@types/escape-html": "^1.0.4",
+ "@types/express": "^4.17.21",
+ "@types/he": "^1.2.3",
+ "@types/jest": "^29.5.8",
+ "@types/luxon": "^3.3.4",
+ "@types/morgan": "^1.9.9",
+ "@types/ms": "^0.7.34",
+ "@types/node": "^20.9.0",
+ "@types/node-os-utils": "^1.3.4",
+ "@types/source-map-support": "^0.5.10",
+ "@types/supertest": "^2.0.16",
+ "@types/underscore": "^1.11.13",
+ "@typescript-eslint/eslint-plugin": "^6.10.0",
+ "@typescript-eslint/parser": "^6.10.0",
"axios-mock-adapter": "^1.22.0",
- "eslint": "^8.52.0",
+ "eslint": "^8.53.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-google": "^0.14.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jest": "^27.6.0",
- "eslint-plugin-sonarjs": "^0.22.0",
+ "eslint-plugin-sonarjs": "^0.23.0",
"jest": "^29.7.0",
"nodemon": "^3.0.1",
"npm-check-updates": "^16.14.6",
@@ -120,12 +120,12 @@
}
},
"node_modules/@babel/code-frame": {
- "version": "7.22.10",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.10.tgz",
- "integrity": "sha512-/KKIMG4UEL35WmI9OlvMhurwtytjvXoFcGNrOvyG9zIzA8YmPjVtIZUf7b05+TPO7G7/GEmLHDaoCgACHl9hhA==",
+ "version": "7.22.13",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz",
+ "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==",
"dev": true,
"dependencies": {
- "@babel/highlight": "^7.22.10",
+ "@babel/highlight": "^7.22.13",
"chalk": "^2.4.2"
},
"engines": {
@@ -258,12 +258,12 @@
}
},
"node_modules/@babel/generator": {
- "version": "7.22.10",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.10.tgz",
- "integrity": "sha512-79KIf7YiWjjdZ81JnLujDRApWtl7BxTqWD88+FFdQEIOG8LJ0etDOM7CXuIgGJa55sGOwZVwuEsaLEm0PJ5/+A==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz",
+ "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==",
"dev": true,
"dependencies": {
- "@babel/types": "^7.22.10",
+ "@babel/types": "^7.23.0",
"@jridgewell/gen-mapping": "^0.3.2",
"@jridgewell/trace-mapping": "^0.3.17",
"jsesc": "^2.5.1"
@@ -298,22 +298,22 @@
}
},
"node_modules/@babel/helper-environment-visitor": {
- "version": "7.22.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz",
- "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==",
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz",
+ "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==",
"dev": true,
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-function-name": {
- "version": "7.22.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz",
- "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz",
+ "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==",
"dev": true,
"dependencies": {
- "@babel/template": "^7.22.5",
- "@babel/types": "^7.22.5"
+ "@babel/template": "^7.22.15",
+ "@babel/types": "^7.23.0"
},
"engines": {
"node": ">=6.9.0"
@@ -405,9 +405,9 @@
}
},
"node_modules/@babel/helper-validator-identifier": {
- "version": "7.22.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz",
- "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==",
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz",
+ "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==",
"dev": true,
"engines": {
"node": ">=6.9.0"
@@ -437,12 +437,12 @@
}
},
"node_modules/@babel/highlight": {
- "version": "7.22.10",
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.10.tgz",
- "integrity": "sha512-78aUtVcT7MUscr0K5mIEnkwxPE0MaxkR5RxRwuHaQ+JuU5AmTPhY+do2mdzVTnIJJpyBglql2pehuBIWHug+WQ==",
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz",
+ "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==",
"dev": true,
"dependencies": {
- "@babel/helper-validator-identifier": "^7.22.5",
+ "@babel/helper-validator-identifier": "^7.22.20",
"chalk": "^2.4.2",
"js-tokens": "^4.0.0"
},
@@ -522,9 +522,9 @@
}
},
"node_modules/@babel/parser": {
- "version": "7.22.10",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.10.tgz",
- "integrity": "sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz",
+ "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==",
"dev": true,
"bin": {
"parser": "bin/babel-parser.js"
@@ -711,33 +711,33 @@
}
},
"node_modules/@babel/template": {
- "version": "7.22.5",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz",
- "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==",
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz",
+ "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==",
"dev": true,
"dependencies": {
- "@babel/code-frame": "^7.22.5",
- "@babel/parser": "^7.22.5",
- "@babel/types": "^7.22.5"
+ "@babel/code-frame": "^7.22.13",
+ "@babel/parser": "^7.22.15",
+ "@babel/types": "^7.22.15"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/traverse": {
- "version": "7.22.10",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.10.tgz",
- "integrity": "sha512-Q/urqV4pRByiNNpb/f5OSv28ZlGJiFiiTh+GAHktbIrkPhPbl90+uW6SmpoLyZqutrg9AEaEf3Q/ZBRHBXgxig==",
+ "version": "7.23.2",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz",
+ "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==",
"dev": true,
"dependencies": {
- "@babel/code-frame": "^7.22.10",
- "@babel/generator": "^7.22.10",
- "@babel/helper-environment-visitor": "^7.22.5",
- "@babel/helper-function-name": "^7.22.5",
+ "@babel/code-frame": "^7.22.13",
+ "@babel/generator": "^7.23.0",
+ "@babel/helper-environment-visitor": "^7.22.20",
+ "@babel/helper-function-name": "^7.23.0",
"@babel/helper-hoist-variables": "^7.22.5",
"@babel/helper-split-export-declaration": "^7.22.6",
- "@babel/parser": "^7.22.10",
- "@babel/types": "^7.22.10",
+ "@babel/parser": "^7.23.0",
+ "@babel/types": "^7.23.0",
"debug": "^4.1.0",
"globals": "^11.1.0"
},
@@ -755,13 +755,13 @@
}
},
"node_modules/@babel/types": {
- "version": "7.22.10",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.10.tgz",
- "integrity": "sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz",
+ "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==",
"dev": true,
"dependencies": {
"@babel/helper-string-parser": "^7.22.5",
- "@babel/helper-validator-identifier": "^7.22.5",
+ "@babel/helper-validator-identifier": "^7.22.20",
"to-fast-properties": "^2.0.0"
},
"engines": {
@@ -956,9 +956,9 @@
}
},
"node_modules/@eslint/eslintrc": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz",
- "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==",
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.3.tgz",
+ "integrity": "sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==",
"dev": true,
"dependencies": {
"ajv": "^6.12.4",
@@ -979,9 +979,9 @@
}
},
"node_modules/@eslint/js": {
- "version": "8.52.0",
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.52.0.tgz",
- "integrity": "sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==",
+ "version": "8.53.0",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.53.0.tgz",
+ "integrity": "sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==",
"dev": true,
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -2417,9 +2417,9 @@
}
},
"node_modules/@octokit/types": {
- "version": "12.1.1",
- "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.1.1.tgz",
- "integrity": "sha512-qnJTldJ1NyGT5MTsCg/Zi+y2IFHZ1Jo5+njNCjJ9FcainV7LjuHgmB697kA0g4MjZeDAJsM3B45iqCVsCLVFZg==",
+ "version": "12.2.0",
+ "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.2.0.tgz",
+ "integrity": "sha512-ZkdHqHJdifVndN7Pha10+qrgAjy3AcG//Vmjr/o5UFuTiYCcMhqDj39Yr9VM9zJ/42KO2xAYhV7cvLnLI9Kvwg==",
"dependencies": {
"@octokit/openapi-types": "^19.0.2"
}
@@ -2579,39 +2579,39 @@
}
},
"node_modules/@sentry-internal/tracing": {
- "version": "7.77.0",
- "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.77.0.tgz",
- "integrity": "sha512-8HRF1rdqWwtINqGEdx8Iqs9UOP/n8E0vXUu3Nmbqj4p5sQPA7vvCfq+4Y4rTqZFc7sNdFpDsRION5iQEh8zfZw==",
+ "version": "7.79.0",
+ "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.79.0.tgz",
+ "integrity": "sha512-Mf9Bd0OrZ24h1qZpvmz9IRnfORMGYNYC1xWBBFpIR1AauEDX89x+mJwIOrUc4KKAAAwt73shrJv1QA8QOm4E3g==",
"dependencies": {
- "@sentry/core": "7.77.0",
- "@sentry/types": "7.77.0",
- "@sentry/utils": "7.77.0"
+ "@sentry/core": "7.79.0",
+ "@sentry/types": "7.79.0",
+ "@sentry/utils": "7.79.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/@sentry/core": {
- "version": "7.77.0",
- "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.77.0.tgz",
- "integrity": "sha512-Tj8oTYFZ/ZD+xW8IGIsU6gcFXD/gfE+FUxUaeSosd9KHwBQNOLhZSsYo/tTVf/rnQI/dQnsd4onPZLiL+27aTg==",
+ "version": "7.79.0",
+ "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.79.0.tgz",
+ "integrity": "sha512-9vG7SfOcJNJNiqlqg4MuHDUCaSf2ZXpv3eZYRPbBkgPGr8X1ekrSABpOK+6kBNvbtKxfWVTWbLpAA6xU+cwnVw==",
"dependencies": {
- "@sentry/types": "7.77.0",
- "@sentry/utils": "7.77.0"
+ "@sentry/types": "7.79.0",
+ "@sentry/utils": "7.79.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/@sentry/node": {
- "version": "7.77.0",
- "resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.77.0.tgz",
- "integrity": "sha512-Ob5tgaJOj0OYMwnocc6G/CDLWC7hXfVvKX/ofkF98+BbN/tQa5poL+OwgFn9BA8ud8xKzyGPxGU6LdZ8Oh3z/g==",
- "dependencies": {
- "@sentry-internal/tracing": "7.77.0",
- "@sentry/core": "7.77.0",
- "@sentry/types": "7.77.0",
- "@sentry/utils": "7.77.0",
+ "version": "7.79.0",
+ "resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.79.0.tgz",
+ "integrity": "sha512-7kZpYG5hGyt3JhEfo9YtEhbUMwFOzNRQqL/weKgHSyFXU20VcScorceKG2Hynn0rhdAZR6GfdKHsM4kFQvgmtg==",
+ "dependencies": {
+ "@sentry-internal/tracing": "7.79.0",
+ "@sentry/core": "7.79.0",
+ "@sentry/types": "7.79.0",
+ "@sentry/utils": "7.79.0",
"https-proxy-agent": "^5.0.0"
},
"engines": {
@@ -2619,19 +2619,19 @@
}
},
"node_modules/@sentry/types": {
- "version": "7.77.0",
- "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.77.0.tgz",
- "integrity": "sha512-nfb00XRJVi0QpDHg+JkqrmEBHsqBnxJu191Ded+Cs1OJ5oPXEW6F59LVcBScGvMqe+WEk1a73eH8XezwfgrTsA==",
+ "version": "7.79.0",
+ "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.79.0.tgz",
+ "integrity": "sha512-3tV32+v/DF8w7kD0p3kLWtgVTVdFL39oGY02+vz//rjWg/vzeqSE95mCYKm5pUfd6cPETX/8dunCiuTBQIkTHQ==",
"engines": {
"node": ">=8"
}
},
"node_modules/@sentry/utils": {
- "version": "7.77.0",
- "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.77.0.tgz",
- "integrity": "sha512-NmM2kDOqVchrey3N5WSzdQoCsyDkQkiRxExPaNI2oKQ/jMWHs9yt0tSy7otPBcXs0AP59ihl75Bvm1tDRcsp5g==",
+ "version": "7.79.0",
+ "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.79.0.tgz",
+ "integrity": "sha512-tUTlb6PvfZawqBmBK9CPXflqrZDXHKWoX3fve2zLK6W0FSpIMOO4TH8PBqkHBFs0ZgF/bnv/bsM4z7uEAlAtzg==",
"dependencies": {
- "@sentry/types": "7.77.0"
+ "@sentry/types": "7.79.0"
},
"engines": {
"node": ">=8"
@@ -2885,9 +2885,9 @@
}
},
"node_modules/@types/common-tags": {
- "version": "1.8.3",
- "resolved": "https://registry.npmjs.org/@types/common-tags/-/common-tags-1.8.3.tgz",
- "integrity": "sha512-v3smfzf7umSwpkJrmlUe+apSv6bVnrIFCeBeprnP4f8lIh6pECZxyD50e8yFwfouIt85TdxN5yXiFwS5fnsS3w==",
+ "version": "1.8.4",
+ "resolved": "https://registry.npmjs.org/@types/common-tags/-/common-tags-1.8.4.tgz",
+ "integrity": "sha512-S+1hLDJPjWNDhcGxsxEbepzaxWqURP/o+3cP4aa2w7yBXgdcmKGQtZzP8JbyfOd0m+33nh+8+kvxYE2UJtBDkg==",
"dev": true
},
"node_modules/@types/connect": {
@@ -2900,9 +2900,9 @@
}
},
"node_modules/@types/convert-units": {
- "version": "2.3.8",
- "resolved": "https://registry.npmjs.org/@types/convert-units/-/convert-units-2.3.8.tgz",
- "integrity": "sha512-EAKDi5I3PSZa7bwdBd6ip3WgZIzkEk2uCV7Osmrq7Ba2pKr7g1bbl1pnrlYp3AJFreCRZP1N+HY1c+NjTr6/ZQ==",
+ "version": "2.3.9",
+ "resolved": "https://registry.npmjs.org/@types/convert-units/-/convert-units-2.3.9.tgz",
+ "integrity": "sha512-W+R5Q76r6wo0yvitayxgZ1aFPKuSWAkVovNNa0f43vxnWHAhKXIY2IkHhd5PVJuc5g8tQpXeg+HVC0aGUVNG7g==",
"dev": true
},
"node_modules/@types/cookiejar": {
@@ -2912,24 +2912,24 @@
"dev": true
},
"node_modules/@types/cors": {
- "version": "2.8.15",
- "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.15.tgz",
- "integrity": "sha512-n91JxbNLD8eQIuXDIChAN1tCKNWCEgpceU9b7ZMbFA+P+Q4yIeh80jizFLEvolRPc1ES0VdwFlGv+kJTSirogw==",
+ "version": "2.8.16",
+ "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.16.tgz",
+ "integrity": "sha512-Trx5or1Nyg1Fq138PCuWqoApzvoSLWzZ25ORBiHMbbUT42g578lH1GT4TwYDbiUOLFuDsCkfLneT2105fsFWGg==",
"dev": true,
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/escape-html": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/@types/escape-html/-/escape-html-1.0.3.tgz",
- "integrity": "sha512-QbNxKa2IX2y/9eGiy4w8rrwk//ERHXA6zwYVRA3+ayA/D3pkz+/bLL4b5uSLA0L0kPuNX1Jbv9HyPzv9T4zbJQ==",
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@types/escape-html/-/escape-html-1.0.4.tgz",
+ "integrity": "sha512-qZ72SFTgUAZ5a7Tj6kf2SHLetiH5S6f8G5frB2SPQ3EyF02kxdyBFf4Tz4banE3xCgGnKgWLt//a6VuYHKYJTg==",
"dev": true
},
"node_modules/@types/express": {
- "version": "4.17.20",
- "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.20.tgz",
- "integrity": "sha512-rOaqlkgEvOW495xErXMsmyX3WKBInbhG5eqojXYi3cGUaLoRDlXa5d52fkfWZT963AZ3v2eZ4MbKE6WpDAGVsw==",
+ "version": "4.17.21",
+ "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz",
+ "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==",
"dev": true,
"dependencies": {
"@types/body-parser": "*",
@@ -2960,9 +2960,9 @@
}
},
"node_modules/@types/he": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/@types/he/-/he-1.2.2.tgz",
- "integrity": "sha512-v2gT1gRK65k9nz8SVSXo3lh7AHnRPL3mRcYNhhsqL/L2S1xt/MGyEI5a7vJPXWik/IxTtAktXf8/HlCxDR1nsw==",
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@types/he/-/he-1.2.3.tgz",
+ "integrity": "sha512-q67/qwlxblDzEDvzHhVkwc1gzVWxaNxeyHUBF4xElrvjL11O+Ytze+1fGpBHlr/H9myiBUaUXNnNPmBHxxfAcA==",
"dev": true
},
"node_modules/@types/http-cache-semantics": {
@@ -3001,9 +3001,9 @@
}
},
"node_modules/@types/jest": {
- "version": "29.5.7",
- "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.7.tgz",
- "integrity": "sha512-HLyetab6KVPSiF+7pFcUyMeLsx25LDNDemw9mGsJBkai/oouwrjTycocSDYopMEwFhN2Y4s9oPyOCZNofgSt2g==",
+ "version": "29.5.8",
+ "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.8.tgz",
+ "integrity": "sha512-fXEFTxMV2Co8ZF5aYFJv+YeA08RTYJfhtN5c9JSv/mFEMe+xxjufCb+PHL+bJcMs/ebPUsBu+UNTEz+ydXrR6g==",
"dev": true,
"dependencies": {
"expect": "^29.0.0",
@@ -3039,9 +3039,9 @@
}
},
"node_modules/@types/luxon": {
- "version": "3.3.3",
- "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.3.3.tgz",
- "integrity": "sha512-/BJF3NT0pRMuxrenr42emRUF67sXwcZCd+S1ksG/Fcf9O7C3kKCY4uJSbKBE4KDUIYr3WMsvfmWD8hRjXExBJQ==",
+ "version": "3.3.4",
+ "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.3.4.tgz",
+ "integrity": "sha512-H9OXxv4EzJwE75aTPKpiGXJq+y4LFxjpsdgKwSmr503P5DkWc3AG7VAFYrFNVvqemT5DfgZJV9itYhqBHSGujA==",
"dev": true
},
"node_modules/@types/mime": {
@@ -3051,24 +3051,24 @@
"dev": true
},
"node_modules/@types/morgan": {
- "version": "1.9.7",
- "resolved": "https://registry.npmjs.org/@types/morgan/-/morgan-1.9.7.tgz",
- "integrity": "sha512-4sJFBUBrIZkP5EvMm1L6VCXp3SQe8dnXqlVpe1jsmTjS1JQVmSjnpMNs8DosQd6omBi/K7BSKJ6z/Mc3ki0K9g==",
+ "version": "1.9.9",
+ "resolved": "https://registry.npmjs.org/@types/morgan/-/morgan-1.9.9.tgz",
+ "integrity": "sha512-iRYSDKVaC6FkGSpEVVIvrRGw0DfJMiQzIn3qr2G5B3C//AWkulhXgaBd7tS9/J79GWSYMTHGs7PfI5b3Y8m+RQ==",
"dev": true,
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/ms": {
- "version": "0.7.33",
- "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.33.tgz",
- "integrity": "sha512-AuHIyzR5Hea7ij0P9q7vx7xu4z0C28ucwjAZC0ja7JhINyCnOw8/DnvAPQQ9TfOlCtZAmCERKQX9+o1mgQhuOQ==",
+ "version": "0.7.34",
+ "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz",
+ "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==",
"dev": true
},
"node_modules/@types/node": {
- "version": "20.8.10",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.10.tgz",
- "integrity": "sha512-TlgT8JntpcbmKUFzjhsyhGfP2fsiz1Mv56im6enJ905xG1DAYesxJaeSbGqQmAw8OWPdhyJGhGSQGKRNJ45u9w==",
+ "version": "20.9.0",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz",
+ "integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==",
"dependencies": {
"undici-types": "~5.26.4"
}
@@ -3096,9 +3096,9 @@
}
},
"node_modules/@types/node-os-utils": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@types/node-os-utils/-/node-os-utils-1.3.3.tgz",
- "integrity": "sha512-iO0aVIeFXY6dVQvzaXzC8t6BuKdywypvRV3+K0kpVGvF0nfnnShFT9Y6AHDFDFVFtop4tL3FVwPej2+qDUzXfA==",
+ "version": "1.3.4",
+ "resolved": "https://registry.npmjs.org/@types/node-os-utils/-/node-os-utils-1.3.4.tgz",
+ "integrity": "sha512-BCUYrbdoO4FUbx6MB9atLNFnkxdliFaxdiTJMIPPiecXIApc5zf4NIqV5G1jWv/ReZvtYyHLs40RkBjHX+vykA==",
"dev": true
},
"node_modules/@types/qs": {
@@ -3149,9 +3149,9 @@
}
},
"node_modules/@types/source-map-support": {
- "version": "0.5.9",
- "resolved": "https://registry.npmjs.org/@types/source-map-support/-/source-map-support-0.5.9.tgz",
- "integrity": "sha512-91Jf4LyPAObBTFbpW3bSDK1ncdwXohvlBmzffSj7/44SY+1mD/HhesdfspCMxPIJwllgN2G4eVFatGs4Zw/lnw==",
+ "version": "0.5.10",
+ "resolved": "https://registry.npmjs.org/@types/source-map-support/-/source-map-support-0.5.10.tgz",
+ "integrity": "sha512-tgVP2H469x9zq34Z0m/fgPewGhg/MLClalNOiPIzQlXrSS2YrKu/xCdSCKnEDwkFha51VKEKB6A9wW26/ZNwzA==",
"dev": true,
"dependencies": {
"source-map": "^0.6.0"
@@ -3174,9 +3174,9 @@
}
},
"node_modules/@types/supertest": {
- "version": "2.0.15",
- "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-2.0.15.tgz",
- "integrity": "sha512-jUCZZ/TMcpGzoSaed9Gjr8HCf3HehExdibyw3OHHEL1als1KmyzcOZZH4MjbObI8TkWsEr7bc7gsW0WTDni+qQ==",
+ "version": "2.0.16",
+ "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-2.0.16.tgz",
+ "integrity": "sha512-6c2ogktZ06tr2ENoZivgm7YnprnhYE4ZoXGMY+oA7IuAf17M8FWvujXZGmxLv8y0PTyts4x5A+erSwVUFA8XSg==",
"dev": true,
"dependencies": {
"@types/superagent": "*"
@@ -3188,9 +3188,9 @@
"integrity": "sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g=="
},
"node_modules/@types/underscore": {
- "version": "1.11.12",
- "resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.11.12.tgz",
- "integrity": "sha512-beX81q12OQo809WJ/UYCvUDvJR3YQ4wtehYYQ6eNw5VLyd+KUNBRV4FgzZCHBmACbdPulH9F9ifhxzFFU9TWvQ==",
+ "version": "1.11.13",
+ "resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.11.13.tgz",
+ "integrity": "sha512-x/KVdl2MXWKrQmcGktLLZfT6LVDIgSZhWWWrKgoEXSv2BSUkqJOoELJMphnnZBbrpZ62U8z+9eyusxyIP8lxFw==",
"dev": true
},
"node_modules/@types/ws": {
@@ -3217,16 +3217,16 @@
"dev": true
},
"node_modules/@typescript-eslint/eslint-plugin": {
- "version": "6.9.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.9.1.tgz",
- "integrity": "sha512-w0tiiRc9I4S5XSXXrMHOWgHgxbrBn1Ro+PmiYhSg2ZVdxrAJtQgzU5o2m1BfP6UOn7Vxcc6152vFjQfmZR4xEg==",
+ "version": "6.10.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.10.0.tgz",
+ "integrity": "sha512-uoLj4g2OTL8rfUQVx2AFO1hp/zja1wABJq77P6IclQs6I/m9GLrm7jCdgzZkvWdDCQf1uEvoa8s8CupsgWQgVg==",
"dev": true,
"dependencies": {
"@eslint-community/regexpp": "^4.5.1",
- "@typescript-eslint/scope-manager": "6.9.1",
- "@typescript-eslint/type-utils": "6.9.1",
- "@typescript-eslint/utils": "6.9.1",
- "@typescript-eslint/visitor-keys": "6.9.1",
+ "@typescript-eslint/scope-manager": "6.10.0",
+ "@typescript-eslint/type-utils": "6.10.0",
+ "@typescript-eslint/utils": "6.10.0",
+ "@typescript-eslint/visitor-keys": "6.10.0",
"debug": "^4.3.4",
"graphemer": "^1.4.0",
"ignore": "^5.2.4",
@@ -3252,15 +3252,15 @@
}
},
"node_modules/@typescript-eslint/parser": {
- "version": "6.9.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.9.1.tgz",
- "integrity": "sha512-C7AK2wn43GSaCUZ9do6Ksgi2g3mwFkMO3Cis96kzmgudoVaKyt62yNzJOktP0HDLb/iO2O0n2lBOzJgr6Q/cyg==",
+ "version": "6.10.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.10.0.tgz",
+ "integrity": "sha512-+sZwIj+s+io9ozSxIWbNB5873OSdfeBEH/FR0re14WLI6BaKuSOnnwCJ2foUiu8uXf4dRp1UqHP0vrZ1zXGrog==",
"dev": true,
"dependencies": {
- "@typescript-eslint/scope-manager": "6.9.1",
- "@typescript-eslint/types": "6.9.1",
- "@typescript-eslint/typescript-estree": "6.9.1",
- "@typescript-eslint/visitor-keys": "6.9.1",
+ "@typescript-eslint/scope-manager": "6.10.0",
+ "@typescript-eslint/types": "6.10.0",
+ "@typescript-eslint/typescript-estree": "6.10.0",
+ "@typescript-eslint/visitor-keys": "6.10.0",
"debug": "^4.3.4"
},
"engines": {
@@ -3280,13 +3280,13 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
- "version": "6.9.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.9.1.tgz",
- "integrity": "sha512-38IxvKB6NAne3g/+MyXMs2Cda/Sz+CEpmm+KLGEM8hx/CvnSRuw51i8ukfwB/B/sESdeTGet1NH1Wj7I0YXswg==",
+ "version": "6.10.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.10.0.tgz",
+ "integrity": "sha512-TN/plV7dzqqC2iPNf1KrxozDgZs53Gfgg5ZHyw8erd6jd5Ta/JIEcdCheXFt9b1NYb93a1wmIIVW/2gLkombDg==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "6.9.1",
- "@typescript-eslint/visitor-keys": "6.9.1"
+ "@typescript-eslint/types": "6.10.0",
+ "@typescript-eslint/visitor-keys": "6.10.0"
},
"engines": {
"node": "^16.0.0 || >=18.0.0"
@@ -3297,13 +3297,13 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
- "version": "6.9.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.9.1.tgz",
- "integrity": "sha512-eh2oHaUKCK58qIeYp19F5V5TbpM52680sB4zNSz29VBQPTWIlE/hCj5P5B1AChxECe/fmZlspAWFuRniep1Skg==",
+ "version": "6.10.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.10.0.tgz",
+ "integrity": "sha512-wYpPs3hgTFblMYwbYWPT3eZtaDOjbLyIYuqpwuLBBqhLiuvJ+9sEp2gNRJEtR5N/c9G1uTtQQL5AhV0fEPJYcg==",
"dev": true,
"dependencies": {
- "@typescript-eslint/typescript-estree": "6.9.1",
- "@typescript-eslint/utils": "6.9.1",
+ "@typescript-eslint/typescript-estree": "6.10.0",
+ "@typescript-eslint/utils": "6.10.0",
"debug": "^4.3.4",
"ts-api-utils": "^1.0.1"
},
@@ -3324,9 +3324,9 @@
}
},
"node_modules/@typescript-eslint/types": {
- "version": "6.9.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.9.1.tgz",
- "integrity": "sha512-BUGslGOb14zUHOUmDB2FfT6SI1CcZEJYfF3qFwBeUrU6srJfzANonwRYHDpLBuzbq3HaoF2XL2hcr01c8f8OaQ==",
+ "version": "6.10.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.10.0.tgz",
+ "integrity": "sha512-36Fq1PWh9dusgo3vH7qmQAj5/AZqARky1Wi6WpINxB6SkQdY5vQoT2/7rW7uBIsPDcvvGCLi4r10p0OJ7ITAeg==",
"dev": true,
"engines": {
"node": "^16.0.0 || >=18.0.0"
@@ -3337,13 +3337,13 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
- "version": "6.9.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.9.1.tgz",
- "integrity": "sha512-U+mUylTHfcqeO7mLWVQ5W/tMLXqVpRv61wm9ZtfE5egz7gtnmqVIw9ryh0mgIlkKk9rZLY3UHygsBSdB9/ftyw==",
+ "version": "6.10.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.10.0.tgz",
+ "integrity": "sha512-ek0Eyuy6P15LJVeghbWhSrBCj/vJpPXXR+EpaRZqou7achUWL8IdYnMSC5WHAeTWswYQuP2hAZgij/bC9fanBg==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "6.9.1",
- "@typescript-eslint/visitor-keys": "6.9.1",
+ "@typescript-eslint/types": "6.10.0",
+ "@typescript-eslint/visitor-keys": "6.10.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@@ -3364,17 +3364,17 @@
}
},
"node_modules/@typescript-eslint/utils": {
- "version": "6.9.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.9.1.tgz",
- "integrity": "sha512-L1T0A5nFdQrMVunpZgzqPL6y2wVreSyHhKGZryS6jrEN7bD9NplVAyMryUhXsQ4TWLnZmxc2ekar/lSGIlprCA==",
+ "version": "6.10.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.10.0.tgz",
+ "integrity": "sha512-v+pJ1/RcVyRc0o4wAGux9x42RHmAjIGzPRo538Z8M1tVx6HOnoQBCX/NoadHQlZeC+QO2yr4nNSFWOoraZCAyg==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.12",
"@types/semver": "^7.5.0",
- "@typescript-eslint/scope-manager": "6.9.1",
- "@typescript-eslint/types": "6.9.1",
- "@typescript-eslint/typescript-estree": "6.9.1",
+ "@typescript-eslint/scope-manager": "6.10.0",
+ "@typescript-eslint/types": "6.10.0",
+ "@typescript-eslint/typescript-estree": "6.10.0",
"semver": "^7.5.4"
},
"engines": {
@@ -3389,12 +3389,12 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
- "version": "6.9.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.9.1.tgz",
- "integrity": "sha512-MUaPUe/QRLEffARsmNfmpghuQkW436DvESW+h+M52w0coICHRfD6Np9/K6PdACwnrq1HmuLl+cSPZaJmeVPkSw==",
+ "version": "6.10.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.10.0.tgz",
+ "integrity": "sha512-xMGluxQIEtOM7bqFCo+rCMh5fqI+ZxV5RUUOa29iVPz1OgCZrtc7rFnz5cLUazlkPKYqX+75iuDq7m0HQ48nCg==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "6.9.1",
+ "@typescript-eslint/types": "6.10.0",
"eslint-visitor-keys": "^3.4.1"
},
"engines": {
@@ -3665,9 +3665,9 @@
"dev": true
},
"node_modules/argon2": {
- "version": "0.31.1",
- "resolved": "https://registry.npmjs.org/argon2/-/argon2-0.31.1.tgz",
- "integrity": "sha512-ik2xnJrLXazya7m4Nz1XfBSRjXj8Koq8qF9PsQC8059p20ifWc9zx/hgU3ItZh/3TnwXkv0RbhvjodPkmFf0bg==",
+ "version": "0.31.2",
+ "resolved": "https://registry.npmjs.org/argon2/-/argon2-0.31.2.tgz",
+ "integrity": "sha512-QSnJ8By5Mth60IEte45w9Y7v6bWcQw3YhRtJKKN8oNCxnTLDiv/AXXkDPf2srTMfxFVn3QJdVv2nhXESsUa+Yg==",
"hasInstallScript": true,
"dependencies": {
"@mapbox/node-pre-gyp": "^1.0.11",
@@ -3834,9 +3834,9 @@
}
},
"node_modules/axios": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz",
- "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.1.tgz",
+ "integrity": "sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g==",
"dependencies": {
"follow-redirects": "^1.15.0",
"form-data": "^4.0.0",
@@ -5641,15 +5641,15 @@
}
},
"node_modules/eslint": {
- "version": "8.52.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.52.0.tgz",
- "integrity": "sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==",
+ "version": "8.53.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.53.0.tgz",
+ "integrity": "sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.6.1",
- "@eslint/eslintrc": "^2.1.2",
- "@eslint/js": "8.52.0",
+ "@eslint/eslintrc": "^2.1.3",
+ "@eslint/js": "8.53.0",
"@humanwhocodes/config-array": "^0.11.13",
"@humanwhocodes/module-importer": "^1.0.1",
"@nodelib/fs.walk": "^1.2.8",
@@ -6030,9 +6030,9 @@
}
},
"node_modules/eslint-plugin-sonarjs": {
- "version": "0.22.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.22.0.tgz",
- "integrity": "sha512-LJz+TCosMOBLkbAsNk6Q1lCgmK6qNO5RCqtOAle1DCnqqnmxoSTPHakZ1R7Gcnjhw5n7VDcAwuqefmpd4XXPLQ==",
+ "version": "0.23.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.23.0.tgz",
+ "integrity": "sha512-z44T3PBf9W7qQ/aR+NmofOTyg6HLhSEZOPD4zhStqBpLoMp8GYhFksuUBnCxbnf1nfISpKBVkQhiBLFI/F4Wlg==",
"dev": true,
"engines": {
"node": ">=14"
@@ -6276,9 +6276,9 @@
}
},
"node_modules/express-rate-limit": {
- "version": "7.1.3",
- "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.1.3.tgz",
- "integrity": "sha512-BDes6WeNYSGRRGQU8QDNwUnwqaBro28HN/TTweM3RlxXRHDld8RLoH7tbfCxAc0hamQyn6aL0KrfR45+ZxknYg==",
+ "version": "7.1.4",
+ "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.1.4.tgz",
+ "integrity": "sha512-mv/6z+EwnWpr+MjGVavMGvM4Tl8S/tHmpl9ZsDfrQeHpYy4Hfr0UYdKEf9OOTe280oIr70yPxLRmQ6MfINfJDw==",
"engines": {
"node": ">= 16"
},
@@ -6989,9 +6989,9 @@
}
},
"node_modules/globals": {
- "version": "13.21.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz",
- "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==",
+ "version": "13.23.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz",
+ "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==",
"dev": true,
"dependencies": {
"type-fest": "^0.20.2"
@@ -7242,9 +7242,9 @@
}
},
"node_modules/helmet": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/helmet/-/helmet-7.0.0.tgz",
- "integrity": "sha512-MsIgYmdBh460ZZ8cJC81q4XJknjG567wzEmv46WOBblDb6TUd3z8/GhgmsM9pn8g2B80tAJ4m5/d3Bi1KrSUBQ==",
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/helmet/-/helmet-7.1.0.tgz",
+ "integrity": "sha512-g+HZqgfbpXdCkme/Cd/mZkV0aV3BZZZSugecH03kl38m/Kmdx8jKjBikpDj2cr+Iynv4KpYEviojNdTJActJAg==",
"engines": {
"node": ">=16.0.0"
}
@@ -10785,9 +10785,9 @@
}
},
"node_modules/openai": {
- "version": "4.14.2",
- "resolved": "https://registry.npmjs.org/openai/-/openai-4.14.2.tgz",
- "integrity": "sha512-JGlm7mMC7J+cyQZnQMOH7daD9cBqqWqLtlBsejElEkgoehPrYfdyxSxIGICz5xk4YimbwI5FlLATSVojLtCKXQ==",
+ "version": "4.16.2",
+ "resolved": "https://registry.npmjs.org/openai/-/openai-4.16.2.tgz",
+ "integrity": "sha512-jsrv008Z3SkeiJ2USdJTrD/tkwBHK6YYv7cwNxkfhgAu1GUBKEDiuYKLLXtvVxdrU9gK6LXnIb03ugwoBgEimQ==",
"dependencies": {
"@types/node": "^18.11.18",
"@types/node-fetch": "^2.6.4",
diff --git a/package.json b/package.json
index 408de5dfc..a1aa65397 100644
--- a/package.json
+++ b/package.json
@@ -4,32 +4,28 @@
"description": "A bot for TripSit (and maybe the world)",
"main": "start.ts",
"prisma": {
- "schema": "src/prisma/schema.prisma"
+ "schema": "src/prisma/tripbot/schema.prisma"
},
"engines": {
"node": "v21.1.0",
"npm": "10.2.0"
},
"scripts": {
- "## START ## ": "",
- "all": "docker compose --project-name tripbot up -d --force-recreate --build",
+ "all:start": "docker compose --project-name tripbot up -d --force-recreate --build",
"## TRIPBOT ##": "",
- "tripbot": "docker compose --project-name tripbot up -d --force-recreate --build tripbot ",
+ "tripbot:start": "docker compose --project-name tripbot up -d --force-recreate --build tripbot ",
"tripbot:logs": "docker container logs tripbot -f -n 100",
"tripbot:test": "docker exec -it tripbot npx jest --silent -c ./src/jest/jest.unit.config.ts",
"tripbot:lint": "docker exec -it tripbot npx eslint --fix --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts . --cache",
- "tripbot:deploy": "docker exec -it tripbot ts-node --transpile-only ./src/discord/utils/commandDeploy.ts",
- "tripbot:dbPull": "docker exec -it tripbot npx prisma db pull && npx prisma generate",
- "## PRISMA ##": "",
- "prisma": "docker compose --project-name tripbot up -d --force-recreate --build tripbot_prisma",
- "prisma:logs": "docker container logs tripbot_prisma -f -n 100",
- "prisma:init": "npx prisma migrate dev --name init && ",
- "prisma:migrate": "docker exec -it tripbot_prisma npx prisma migrate dev",
- "prisma:validate": "docker exec -it tripbot_prisma npx prisma validate",
- "prisma:format": "docker exec -it tripbot_prisma npx prisma format",
- "## POSTGRES ##": "",
- "postgres": "docker compose --project-name tripbot up -d --force-recreate --build tripbot_database",
- "postgres:logs": "docker container logs tripbot_database -f -n 100",
+ "tripbot:deployCommands": "docker exec -it tripbot ts-node --transpile-only ./src/discord/utils/commandDeploy.ts",
+ "tripbot:db:generate": "npx prisma generate && npx prisma generate --schema src/prisma/moodle/schema.prisma && docker exec -it tripbot npx prisma generate && docker exec -it tripbot npx prisma generate --schema src/prisma/moodle/schema.prisma",
+ "## DATABASE ##": "",
+ "db:start": "docker compose --project-name tripbot up -d --force-recreate --build tripbot_database",
+ "db:logs": "docker container logs tripbot_database -f -n 100",
+ "db:formatSchema": "docker exec -it tripbot npx prisma format",
+ "db:validateSchema": "docker exec -it tripbot npx prisma validate",
+ "db:generateClient": "npx prisma generate && docker exec -it tripbot npx prisma generate",
+ "db:migrateDev": "docker exec -it tripbot npx prisma migrate dev",
"## PGADMIN ##": "",
"pgadmin": "docker compose --project-name tripbot up -d --force-recreate --build tripbot_pgadmin",
"pgadmin:logs": "docker container logs tripbot_pgadmin -f -n 100",
@@ -67,12 +63,12 @@
"dependencies": {
"@discordjs/voice": "^0.16.0",
"@napi-rs/canvas": "^0.1.44",
- "@octokit/types": "^12.1.1",
+ "@octokit/types": "^12.2.0",
"@octokit/webhooks-types": "^7.3.1",
"@prisma/client": "^5.5.2",
- "@sentry/node": "^7.77.0",
- "argon2": "^0.31.1",
- "axios": "^1.6.0",
+ "@sentry/node": "^7.79.0",
+ "argon2": "^0.31.2",
+ "axios": "^1.6.1",
"body-parser": "^1.20.2",
"common-tags": "^1.8.2",
"convert-units": "^2.3.4",
@@ -85,10 +81,10 @@
"dotenv": "^16.3.1",
"escape-html": "^1.0.3",
"express": "^4.18.2",
- "express-rate-limit": "^7.1.3",
+ "express-rate-limit": "^7.1.4",
"fuse.js": "^7.0.0",
"he": "^1.2.0",
- "helmet": "^7.0.0",
+ "helmet": "^7.1.0",
"imdb-api": "^4.4.1",
"keycloak-admin": "^1.14.22",
"knex": "^3.0.1",
@@ -99,7 +95,7 @@
"node-os-utils": "^1.3.7",
"objection": "^3.1.2",
"octokit": "^3.1.1",
- "openai": "^4.14.2",
+ "openai": "^4.16.2",
"pg": "^8.11.3",
"rss-parser": "^3.13.0",
"sonar-scanner": "^3.1.0",
@@ -112,32 +108,32 @@
"youtube-search-without-api-key": "^1.1.0"
},
"devDependencies": {
- "@types/common-tags": "^1.8.3",
- "@types/convert-units": "^2.3.8",
- "@types/cors": "^2.8.15",
- "@types/escape-html": "^1.0.3",
- "@types/express": "^4.17.20",
- "@types/he": "^1.2.2",
- "@types/jest": "^29.5.7",
- "@types/luxon": "^3.3.3",
- "@types/morgan": "^1.9.7",
- "@types/ms": "^0.7.33",
- "@types/node": "^20.8.10",
- "@types/node-os-utils": "^1.3.3",
- "@types/source-map-support": "^0.5.9",
- "@types/supertest": "^2.0.15",
- "@types/underscore": "^1.11.12",
- "@typescript-eslint/eslint-plugin": "^6.9.1",
- "@typescript-eslint/parser": "^6.9.1",
+ "@types/common-tags": "^1.8.4",
+ "@types/convert-units": "^2.3.9",
+ "@types/cors": "^2.8.16",
+ "@types/escape-html": "^1.0.4",
+ "@types/express": "^4.17.21",
+ "@types/he": "^1.2.3",
+ "@types/jest": "^29.5.8",
+ "@types/luxon": "^3.3.4",
+ "@types/morgan": "^1.9.9",
+ "@types/ms": "^0.7.34",
+ "@types/node": "^20.9.0",
+ "@types/node-os-utils": "^1.3.4",
+ "@types/source-map-support": "^0.5.10",
+ "@types/supertest": "^2.0.16",
+ "@types/underscore": "^1.11.13",
+ "@typescript-eslint/eslint-plugin": "^6.10.0",
+ "@typescript-eslint/parser": "^6.10.0",
"axios-mock-adapter": "^1.22.0",
- "eslint": "^8.52.0",
+ "eslint": "^8.53.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-google": "^0.14.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jest": "^27.6.0",
- "eslint-plugin-sonarjs": "^0.22.0",
+ "eslint-plugin-sonarjs": "^0.23.0",
"jest": "^29.7.0",
"nodemon": "^3.0.1",
"npm-check-updates": "^16.14.6",
diff --git a/src/api/apiV2/appeals/appeals.queries.ts b/src/api/apiV2/appeals/appeals.queries.ts
index f32c73b39..7307d0b25 100644
--- a/src/api/apiV2/appeals/appeals.queries.ts
+++ b/src/api/apiV2/appeals/appeals.queries.ts
@@ -1,5 +1,6 @@
-import db from '../../../global/utils/db';
+import { PrismaClient } from '@prisma/client';
+const db = new PrismaClient({ log: ['error'] });
const F = f(__filename);
export default {
diff --git a/src/api/apiV2/drugs/drugs.queries.ts b/src/api/apiV2/drugs/drugs.queries.ts
index f25a69176..c567034b0 100644
--- a/src/api/apiV2/drugs/drugs.queries.ts
+++ b/src/api/apiV2/drugs/drugs.queries.ts
@@ -1,4 +1,6 @@
-import db from '../../../global/utils/db';
+import { PrismaClient } from '@prisma/client';
+
+const db = new PrismaClient({ log: ['error'] });
export default {
getAllDrugs() {
diff --git a/src/api/apiV2/users/users.queries.ts b/src/api/apiV2/users/users.queries.ts
index 5aeb72202..5c4f50eae 100644
--- a/src/api/apiV2/users/users.queries.ts
+++ b/src/api/apiV2/users/users.queries.ts
@@ -1,4 +1,6 @@
-import db from '../../../global/utils/db';
+import { PrismaClient } from '@prisma/client';
+
+const db = new PrismaClient({ log: ['error'] });
export default {
getAllUsers() {
diff --git a/src/discord/api/apiV1/appeals/appealSubmit.queries.ts b/src/discord/api/apiV1/appeals/appealSubmit.queries.ts
index f18c9a91e..90106ef40 100644
--- a/src/discord/api/apiV1/appeals/appealSubmit.queries.ts
+++ b/src/discord/api/apiV1/appeals/appealSubmit.queries.ts
@@ -14,8 +14,11 @@ import {
} from 'discord.js';
import { stripIndents } from 'common-tags';
import escape from 'escape-html';
-import { appeal_status, appeals, users } from '@prisma/client';
-import db from '../../../../global/utils/db';
+import {
+ PrismaClient, appeal_status, appeals, users,
+} from '@prisma/client';
+
+const db = new PrismaClient({ log: ['error'] });
const F = f(__filename);
diff --git a/src/discord/commands/global/d.learn.ts b/src/discord/commands/global/d.learn.ts
index 3416c5938..f4af5ccbc 100644
--- a/src/discord/commands/global/d.learn.ts
+++ b/src/discord/commands/global/d.learn.ts
@@ -151,8 +151,7 @@ async function moodleProfile(
.setAuthor({
name: `${discordMember.displayName}${moodleProfileData.department && moodleProfileData.institution ? title : ''}`,
url: env.MOODLE_URL,
- })
- .setThumbnail(moodleProfileData.profileImage);
+ });
if (completedCourses.length > 0) {
profileEmbed.addFields([
diff --git a/src/discord/commands/guild/d.ai.ts b/src/discord/commands/guild/d.ai.ts
index e7bb0af59..95cdc1561 100644
--- a/src/discord/commands/guild/d.ai.ts
+++ b/src/discord/commands/guild/d.ai.ts
@@ -25,6 +25,7 @@ import {
} from 'discord-api-types/v10';
import { stripIndents } from 'common-tags';
import {
+ PrismaClient,
ai_channels,
ai_model,
ai_personas,
@@ -43,10 +44,11 @@ import {
aiModerate,
} from '../../../global/commands/g.ai';
import commandContext from '../../utils/context';
-import db from '../../../global/utils/db';
import { userInfoEmbed } from '../../../global/commands/g.moderate';
import { sleep } from './d.bottest';
+const db = new PrismaClient({ log: ['error'] });
+
const F = f(__filename);
const maxHistoryLength = 5;
@@ -347,8 +349,8 @@ async function get(
where: {
id: aiLinkData.persona_id,
},
- });
- description = `Channel ${(channel as TextChannel).name} is linked with the **"${aiPersona.name}"** persona:`;
+ }) as ai_personas;
+ description = `Channel ${(channel as TextChannel).name} is linked with the **"${aiPersona.name ?? aiPersona}"** persona:`;
}
if (!aiLinkData && (channel as ThreadChannel).parent) {
@@ -364,7 +366,7 @@ async function get(
where: {
id: aiLinkData.persona_id,
},
- });
+ }) as ai_personas;
// eslint-disable-next-line max-len
description = `Channel ${(channel as ThreadChannel).parent} is linked with the **"${aiPersona.name}"** persona:`;
}
@@ -383,7 +385,7 @@ async function get(
where: {
id: aiLinkData.persona_id,
},
- });
+ }) as ai_personas;
// eslint-disable-next-line max-len
description = `Category ${(channel as ThreadChannel).parent?.parent} is linked with the **"${aiPersona.name}"** persona:`;
}
@@ -641,10 +643,10 @@ export async function aiAudit(
.join('\n')
.slice(0, 1024);
- log.debug(F, `messageOutput: ${messageOutput}`);
+ // log.debug(F, `messageOutput: ${messageOutput}`);
const responseOutput = chatResponse.slice(0, 1023);
- log.debug(F, `responseOutput: ${responseOutput}`);
+ // log.debug(F, `responseOutput: ${responseOutput}`);
embed.spliceFields(
0,
@@ -661,9 +663,9 @@ export async function aiAudit(
},
);
- const promptCost = (promptTokens / 1000) * aiCosts[cleanPersona.ai_model].input;
- const completionCost = (completionTokens / 1000) * aiCosts[cleanPersona.ai_model].output;
- log.debug(F, `promptCost: ${promptCost}, completionCost: ${completionCost}`);
+ const promptCost = (promptTokens / 1000) * aiCosts[cleanPersona.ai_model as keyof typeof aiCosts].input;
+ const completionCost = (completionTokens / 1000) * aiCosts[cleanPersona.ai_model as keyof typeof aiCosts].output;
+ // log.debug(F, `promptCost: ${promptCost}, completionCost: ${completionCost}`);
embed.spliceFields(
2,
diff --git a/src/discord/events/autocomplete.ts b/src/discord/events/autocomplete.ts
index 4bb24658f..9d694c6e2 100644
--- a/src/discord/events/autocomplete.ts
+++ b/src/discord/events/autocomplete.ts
@@ -4,13 +4,15 @@ import {
} from 'discord.js';
import Fuse from 'fuse.js';
+import { PrismaClient } from '@prisma/client';
import pillColors from '../../global/assets/data/pill_colors.json';
import pillShapes from '../../global/assets/data/pill_shapes.json';
import drugDataAll from '../../global/assets/data/drug_db_combined.json';
import drugDataTripsit from '../../global/assets/data/drug_db_tripsit.json';
import timezones from '../../global/assets/data/timezones.json';
import unitsOfMeasurement from '../../global/assets/data/units_of_measurement.json';
-import db from '../../global/utils/db';
+
+const db = new PrismaClient({ log: ['error'] });
const F = f(__filename); // eslint-disable-line
@@ -98,7 +100,7 @@ async function autocompleteBenzos(interaction:AutocompleteInteraction) {
const drugNames = Object.keys(drugDataTripsit);
const benzoNames = drugNames.filter(drugName => {
const props = drugDataTripsit[drugName as keyof typeof drugDataTripsit].properties;
- return Object.prototype.hasOwnProperty.call(props, 'dose_to_diazepam');
+ return Object.hasOwn(props, 'dose_to_diazepam');
});
// log.debug(F, `benzoNames: ${benzoNames}`);
@@ -108,7 +110,7 @@ async function autocompleteBenzos(interaction:AutocompleteInteraction) {
name: drugName,
aliases: [] as string[],
};
- if (Object.prototype.hasOwnProperty.call(drugDataTripsit[drugName as keyof typeof drugDataTripsit], 'aliases')) {
+ if (Object.hasOwn(drugDataTripsit[drugName as keyof typeof drugDataTripsit], 'aliases')) {
// @ts-ignore
drugObj.aliases = drugDataTripsit[drugName as keyof typeof drugDataTripsit].aliases;
}
@@ -530,13 +532,15 @@ async function autocompleteAiNames(interaction:AutocompleteInteraction) {
if (results.length > 0) {
const top25 = results.slice(0, 20);
const listResults = top25.map(choice => ({
- name: choice.item.name,
- value: choice.item.name,
+ name: (choice.item as any).name,
+ value: (choice.item as any).name,
}));
// log.debug(F, `list_results: ${listResults}`);
interaction.respond(listResults);
} else {
- const defaultDiscordColors = nameList.slice(0, 25);
+ const defaultDiscordColors = nameList.slice(0, 25) as {
+ name: string;
+ }[];
const listResults = defaultDiscordColors.map(choice => ({ name: choice.name, value: choice.name }));
// log.debug(F, `list_results: ${listResults}`);
interaction.respond(listResults);
diff --git a/src/discord/utils/appeal.ts b/src/discord/utils/appeal.ts
index 69f982f20..3e4cef943 100644
--- a/src/discord/utils/appeal.ts
+++ b/src/discord/utils/appeal.ts
@@ -6,8 +6,11 @@ import {
time,
} from 'discord.js';
import { stripIndents } from 'common-tags';
-import { appeal_status, user_action_type, user_actions } from '@prisma/client';
-import db from '../../global/utils/db';
+import {
+ PrismaClient, appeal_status, user_action_type, user_actions,
+} from '@prisma/client';
+
+const db = new PrismaClient({ log: ['error'] });
const F = f(__filename);
diff --git a/src/docker/Dockerfile.api b/src/docker/Dockerfile.api
index 8cbf7cbe2..a5873efeb 100644
--- a/src/docker/Dockerfile.api
+++ b/src/docker/Dockerfile.api
@@ -27,7 +27,8 @@ RUN npm ci
COPY --chown=node:node . .
# Generate the prisma client
-RUN npx prisma generate --schema=./src/prisma/schema.prisma
+RUN npx prisma generate
+RUN npx prisma generate --schema=./src/prisma/moodle/schema.prisma
# For container development, the following command runs forever, so we can inspect the container
CMD npx tsc-watch --onSuccess "npx nodemon --config ./src/api/nodemon.json"
@@ -60,6 +61,10 @@ COPY --chown=node:node --from=development /usr/src/app/node_modules ./node_modul
# Copy over the existing source code
COPY --chown=node:node . .
+
+# RUN npx prisma generate
+# RUN npx prisma generate --schema=./src/prisma/moodle/schema.prisma
+
# Build the code
RUN tsc
@@ -94,7 +99,8 @@ RUN npm install pm2 -g
COPY --chown=node:node --from=build /usr/src/app/node_modules ./node_modules
COPY --chown=node:node --from=build /usr/src/app/build ./build
-RUN npx prisma generate
+# RUN npx prisma generate
+# RUN npx prisma generate --schema=./src/prisma/moodle/schema.prisma
USER node
diff --git a/src/docker/Dockerfile.prisma b/src/docker/Dockerfile.prisma
deleted file mode 100644
index dd5f70faf..000000000
--- a/src/docker/Dockerfile.prisma
+++ /dev/null
@@ -1,90 +0,0 @@
-###################
-# BUILD FOR LOCAL DEVELOPMENT
-###################
-# In this step we copy over everything we need and install all dependancies
-# We stop at the end of this step in development, so it also includes the deploy command
-# We install jest, eslint and ts-node so we can run tests and lint.
-
-FROM node:21.1.0-alpine AS development
-
-ENV TZ="America/Chicago"
-ENV NODE_ENV=development
-RUN date
-
-# Create app directory
-WORKDIR /usr/src/app
-
-# Copy application dependency manifests to the container image.
-# A wildcard is used to ensure copying both package.json AND package-lock.json (when available).
-# Copying this first prevents re-running npm install on every code change.
-COPY --chown=node:node package*.json ./
-
-# Install app dependencies using the `npm ci` command instead of `npm install`
-# Use NPM CI even though this may be your first time, cuz package-lock already thinks you installed stuff
-RUN npm ci
-
-# Bundle app source
-COPY --chown=node:node /src/prisma/ ./src/prisma/
-# COPY --chown=node:node .env ./.env
-
-# Initialize the first migration and then run studio
-CMD npx prisma migrate deploy && npx prisma studio
-
-###################
-# BUILD FOR PRODUCTION
-###################
-# This stage prepares for and builds the production .js code
-# We copy over the node_modules directory from the development image to ensure that the production image has access to all the dependencies it needs
-# Then we copy over everything else that may be needed to run
-# We run npm ci --only=production to ensure that only the production dependencies are installed
-
-FROM node:21.1.0-alpine AS build
-
-ENV TZ="America/Chicago"
-ENV NODE_ENV=production
-RUN date
-
-WORKDIR /usr/src/app
-
-# Run the build command which creates the production bundle
-# This comes before the next command cuz ts is a dev requirement and we don't want it in the production image
-
-# In order to run `npm run build` we need access to the Nest CLI which is a dev dependency. In the previous development stage we ran `npm ci` which installed all dependencies, so we can copy over the node_modules directory from the development image
-COPY --chown=node:node --from=development /usr/src/app/node_modules ./node_modules
-COPY --chown=node:node --from=development /usr/src/app/package*.json ./
-
-# Copy over the existing source code
-# COPY --chown=node:node . .
-
-# Running `npm ci` removes the existing node_modules directory and passing in --only=production ensures that only the production dependencies are installed. This ensures that the node_modules directory is as optimized as possible
-RUN npm ci --omit:dev && npm cache clean --force
-
-CMD tail -f /dev/null
-
-###################
-# PRODUCTION
-###################
-# This stage creates the final, small-as-can-be, production image
-# We copy over the node_modules directory from the build stage
-
-FROM node:21.1.0-alpine AS production
-
-ENV TZ="America/Chicago"
-ENV NODE_ENV=production
-RUN date
-
-WORKDIR /usr/src/app
-
-# # Copy the bundled code from the build stage to the production image
-COPY --chown=node:node --from=build /usr/src/app/node_modules ./node_modules
-COPY --chown=node:node --from=build /usr/src/app/package*.json ./
-COPY --chown=node:node /src/prisma/ ./src/prisma/
-# COPY --chown=node:node .env ./.env
-
-USER node
-
-# Deploy migrations and then run studio
-CMD npx prisma migrate deploy && npx prisma studio
-# CMD npx prisma studio
-# CMD tail -f /dev/null
-
diff --git a/src/docker/Dockerfile.tripbot b/src/docker/Dockerfile.tripbot
index d897920c7..5763d0816 100644
--- a/src/docker/Dockerfile.tripbot
+++ b/src/docker/Dockerfile.tripbot
@@ -37,17 +37,19 @@ RUN npm ci
# Bundle app source
COPY --chown=node:node . .
-# Generate the prisma client
-RUN npx prisma generate --schema=./src/prisma/schema.prisma
+# RUN npx prisma migrate deploy
-# Use the node user from the image (instead of the root user)
-# USER node
+# Generate prisma client
+# This needs to happen before the next command for some reason
+RUN npx prisma generate
+RUN npx prisma generate --schema=./src/prisma/moodle/schema.prisma
# Deploy the commands
-RUN ts-node --transpile-only ./src/discord/utils/commandDeploy.ts
+RUN npx ts-node --transpile-only ./src/discord/utils/commandDeploy.ts
# For container development, the following command runs forever, so we can inspect the container
-CMD npx tsc-watch --onSuccess "npx nodemon --config ./nodemon.json"
+CMD npx prisma migrate deploy && npx tsc-watch --onSuccess "npx nodemon --config ./nodemon.json"
+# CMD npx tsc-watch --onSuccess "npx nodemon --config ./nodemon.json"
###################
# BUILD FOR PRODUCTION
@@ -113,8 +115,14 @@ RUN npm install pm2 -g
COPY --chown=node:node --from=build /usr/src/app/node_modules ./node_modules
COPY --chown=node:node --from=build /usr/src/app/build ./build
COPY --chown=node:node ./src/discord/assets/Futura.otf ./build/discord/assets/Futura.otf
+COPY --chown=node:node ./src/prisma/ ./src/prisma
+COPY --chown=node:node package*.json ./
+
+# Generate prisma client
+RUN npx prisma generate
+RUN npx prisma generate --schema=./src/prisma/moodle/schema.prisma
USER node
# Start the bot using the production build
-CMD ["pm2-runtime", "build/start.js"]
+CMD npx prisma migrate deploy && pm2-runtime build/start.js
\ No newline at end of file
diff --git a/src/global/commands/g.ai.ts b/src/global/commands/g.ai.ts
index 5cc7bd377..ce990f174 100644
--- a/src/global/commands/g.ai.ts
+++ b/src/global/commands/g.ai.ts
@@ -1,7 +1,8 @@
import OpenAI from 'openai';
-import { ai_personas } from '@prisma/client';
+import { PrismaClient, ai_personas } from '@prisma/client';
import { Moderation } from 'openai/resources';
-import db from '../utils/db';
+
+const db = new PrismaClient({ log: ['error'] });
const F = f(__filename);
@@ -325,7 +326,7 @@ export async function aiChat(
// function_call: 'auto',
} as OpenAI.Chat.CompletionCreateParamsNonStreaming;
- log.debug(F, `payload: ${JSON.stringify(payload, null, 2)}`);
+ // log.debug(F, `payload: ${JSON.stringify(payload, null, 2)}`);
let responseMessage = {} as OpenAI.Chat.CreateChatCompletionRequestMessage;
const openai = new OpenAI({
organization: 'org-h4Jvunqw3MmHmIgeLHpr1a3Y',
@@ -343,7 +344,7 @@ export async function aiChat(
throw err;
}
});
- log.debug(F, `chatCompletion: ${JSON.stringify(chatCompletion, null, 2)}`);
+ // log.debug(F, `chatCompletion: ${JSON.stringify(chatCompletion, null, 2)}`);
if (chatCompletion && chatCompletion.choices[0].message) {
responseMessage = chatCompletion.choices[0].message;
diff --git a/src/global/commands/g.learn.ts b/src/global/commands/g.learn.ts
index b16efa3d3..ceb9145ef 100644
--- a/src/global/commands/g.learn.ts
+++ b/src/global/commands/g.learn.ts
@@ -1,112 +1,31 @@
/* eslint-disable max-len */
-import https from 'https';
import { stripIndents } from 'common-tags';
+import { PrismaClient as PrismaClientTripbot } from '@prisma/client';
+// eslint-disable-next-line import/no-extraneous-dependencies
+import { PrismaClient as PrismaClientMoodle } from '@prisma-moodle/client';
import { DateTime } from 'luxon';
-import { database } from '../utils/knex';
+const moodleDb = new PrismaClientMoodle();
+const tripbotDb = new PrismaClientTripbot();
+
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
const F = f(__filename);
type MoodleProfile = {
fullName: string,
institution: string | null,
department: string | null,
- profileImage: string,
completedCourses: string[],
incompleteCourses: string[],
};
-type MoodleUser = {
- id: number,
- username: string,
- firstname: string,
- lastname: string,
- fullname: string,
- email: string,
- department: string,
- institution: string,
- firstAccess: number,
- lastAccess: number,
- auth: string,
- suspended: boolean,
- confirmed: boolean,
- lang: string,
- theme: string,
- timezone: string,
- mailFormat: number,
- description: string,
- descriptionFormat: number,
- city: string,
- country: string,
- profileimageurlsmall: string,
- profileimageurl: string,
-};
-
-type MoodleFile = {
- filename: string,
- filepath: string,
- filesize: number,
- fileurl: string,
- timemodified: number,
- mimetype: string,
-};
-
-type MoodleCourse = {
- id: string,
- shortname: string,
- fullname: string,
- displayname: string,
- enrolledusercount: number,
- idnumber: string,
- visible: number,
- summary: string,
- summaryformat: number,
- format: string,
- showgrades: boolean,
- lang: string,
- enablecompletion: boolean,
- completionhascriteria: boolean,
- completionusertracked: boolean,
- category: number,
- progress: number,
- completed: boolean,
- startdate: number,
- enddate: number,
- marker: number,
- lastaccess: number,
- isfavourite: boolean,
- hidden: boolean,
- overviewfiles: MoodleFile[],
- showactivitydates: boolean,
- showcompletionconditions: boolean,
- timemodified: number,
-};
-
-type MoodleActivityInfo = {
- type: string,
- criteria: string,
- requirement: string,
- status: string,
-};
-
-type MoodleActivityCompletion = {
- type: number,
- title: string,
- status: string,
- complete: boolean,
- timecompleted: number,
- details: MoodleActivityInfo,
-};
-
-type MoodleCompletionInfo = {
- completed: boolean,
- aggregation: number,
- completions: Array,
-};
-
-type MoodleCompletionStatus = {
- completionstatus: MoodleCompletionInfo,
- warnings: Array,
-};
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
+function bigIntSanitize(key: any, value: any) {
+ if (typeof value === 'bigint') {
+ return value.toString(); // or alternatively `Number(value)` if the value is within the safe integer range for JavaScript
+ }
+ return value; // return the unchanged property value.
+}
type MoodleInfo = {
title: string,
@@ -115,191 +34,6 @@ type MoodleInfo = {
footer: string,
};
-type MoodleCourseCompletion = {
- course:MoodleCourse,
- completion:MoodleCompletionStatus,
-};
-
-async function getMoodleUser(
- username?:string,
- email?:string,
-):Promise {
- // log.debug(F, `getMoodleUser | username: ${username} | email: ${email}`);
-
- let url = `${env.MOODLE_URL}/webservice/rest/server.php?wstoken=${env.MOODLE_TOKEN}\
-&wsfunction=core_user_get_users_by_field\
-&moodlewsrestformat=json`;
-
- if (username) {
- url += `&field=username&values[]=${username}`;
- } else if (email) {
- url += `&field=email&values[]=${email}`;
- } else {
- log.error(F, 'No user ID or email provided.');
- throw new Error('No user ID or email provided.');
- }
-
- // log.debug(F, `url: ${url}`);
-
- return new Promise((resolve, reject) => {
- https.get(url, response => {
- let data = '';
-
- response.on('data', chunk => {
- data += chunk;
- });
-
- response.on('end', () => {
- let result = [] as MoodleUser[];
- try {
- result = JSON.parse(data) as MoodleUser[];
- global.moodleConnection = {
- status: true,
- date: DateTime.now(),
- };
- } catch (error:unknown) {
- log.error(F, 'getMoodleUser | Improper JSON returned from Moodle, is it alive?');
- log.error(F, `getMoodleUser | Error: ${(error as Error).message}`);
- log.error(F, `getMoodleUser | username: ${username} | email: ${email}`);
- log.error(F, `getMoodleUser | Data: ${JSON.stringify(data, null, 2)}`);
- log.error(F, `getMoodleUser | URL: ${url}`);
- global.moodleConnection = {
- status: false,
- date: DateTime.now(),
- };
- reject(error);
- }
- // log.debug(F, `Result: ${JSON.stringify(result, null, 2)}`);
- if (result.length > 1) {
- log.error(F, `Multiple users with email ${email} found.`);
- reject(new Error(`Multiple users with email ${email} found.`));
- } else if (result.length === 1) {
- // log.debug(F, `moodleUser: ${JSON.stringify(result, null, 2)}`);
- resolve(result[0]);
- } else {
- // log.debug(F, `User with email ${email} or username ${username} not found.`);
- // reject(new Error(`User with email ${email} or username ${username} not found.`));
- }
- });
- }).on('error', error => {
- log.error(F, `Error: ${error.message}`);
- log.error(F, `URL: ${url}`);
- reject(error);
- });
- });
-}
-
-async function getMoodleEnrollments(
- moodleUser:MoodleUser,
-):Promise {
- const url = `${env.MOODLE_URL}/webservice/rest/server.php?wstoken=${env.MOODLE_TOKEN}\
-&wsfunction=core_enrol_get_users_courses\
-&userid=${moodleUser.id}\
-&moodlewsrestformat=json`;
- // log.debug(F, `url: ${url}`);
-
- return new Promise((resolve, reject) => {
- https.get(url, response => {
- let data = '';
-
- response.on('data', chunk => {
- data += chunk;
- });
-
- response.on('end', () => {
- try {
- const result = JSON.parse(data);
- // log.debug(F, `Result: ${JSON.stringify(result, null, 2)}`);
- global.moodleConnection = {
- status: true,
- date: DateTime.now(),
- };
- resolve(result);
- } catch (error) {
- log.error(F, 'getMoodleEnrollments | Improper JSON returned from Moodle, is it alive?');
- log.error(F, `getMoodleEnrollments | Error: ${(error as Error).message}`);
- log.error(F, `getMoodleEnrollments | moodleUser: ${JSON.stringify(moodleUser, null, 2)}`);
- log.error(F, `getMoodleEnrollments | Data: ${JSON.stringify(data, null, 2)}`);
- global.moodleConnection = {
- status: false,
- date: DateTime.now(),
- };
- reject(error);
- }
- });
- }).on('error', error => {
- // log.debug(F, `Error: ${error.message}`);
- reject(error);
- });
- });
-}
-
-async function getMoodleCourseCompletion(
- moodleUser:MoodleUser,
- moodleEnrollments:MoodleCourse[],
-):Promise {
- const completionStatuses = [] as MoodleCourseCompletion[];
- // For each moodle course, get the course info. This needs to be async so that we can return the results
- // once all the promises have been resolved.
- const promises = moodleEnrollments.map(async (moodleCourse:MoodleCourse) => {
- const url = `${env.MOODLE_URL}/webservice/rest/server.php?wstoken=${env.MOODLE_TOKEN}\
-&wsfunction=core_completion_get_course_completion_status\
-&userid=${moodleUser.id}\
-&courseid=${moodleCourse.id}\
-&moodlewsrestformat=json`;
-
- return new Promise((resolve, reject) => {
- https.get(url, response => {
- let data = '';
-
- response.on('data', chunk => {
- data += chunk;
- });
-
- response.on('end', () => {
- try {
- const result = JSON.parse(data) as MoodleCompletionStatus;
- // log.debug(F, `Result: ${JSON.stringify(result, null, 2)}`);
- completionStatuses.push({
- course: moodleCourse,
- completion: result,
- });
- global.moodleConnection = {
- status: true,
- date: DateTime.now(),
- };
- resolve(result);
- } catch (error) {
- log.error(F, 'getMoodleCourses | Improper JSON returned from Moodle, is it alive?');
- log.error(F, `getMoodleCourses | Error: ${(error as Error).message}`);
- log.error(F, `getMoodleCourses | moodleUser: ${JSON.stringify(moodleUser, null, 2)}`);
- log.error(F, `getMoodleCourses | moodleEnrollments: ${JSON.stringify(moodleEnrollments, null, 2)}`);
- log.error(F, `getMoodleCourses | Data: ${JSON.stringify(data, null, 2)}`);
- global.moodleConnection = {
- status: false,
- date: DateTime.now(),
- };
- reject(error);
- }
- });
- }).on('error', error => {
- // log.debug(F, `Error: ${error.message}`);
- reject(error);
- });
- });
- });
-
- return new Promise((resolve, reject) => {
- Promise.all(promises).then(() => {
- // log.debug(F, `completionStatuses: ${JSON.stringify(completionStatuses, null, 2)}`);
- resolve(completionStatuses);
- }).catch(error => {
- log.error(F, `Error: ${error.message}`);
- reject(error);
- });
- });
-}
-
export async function help():Promise {
return {
title: 'TripSitLearn Info',
@@ -332,23 +66,61 @@ export async function link(
):Promise {
// log.debug(F, `Link started with moodleUsername: ${moodleUsername}, \
// discordId: ${discordId}, matrixId: ${matrixId}`);
+
const userData = discordId
- ? await database.users.get(discordId, null, null)
- : await database.users.get(null, matrixId as string, null);
+ ? await tripbotDb.users.findUnique({
+ where: {
+ discord_id: discordId,
+ },
+ })
+ : await tripbotDb.users.findFirst({
+ where: {
+ matrix_id: matrixId as string,
+ },
+ });
+
// log.debug(F, `userData: ${JSON.stringify(userData)}`);
- const moodleUserData = email
- ? await getMoodleUser(undefined, email).catch(() => ({} as MoodleUser))
- : await getMoodleUser(moodleUsername).catch(() => ({} as MoodleUser));
+ if (!userData) {
+ return 'No user found with that Discord or Matrix ID.';
+ }
- // log.debug(F, `moodleUserData: ${JSON.stringify(moodleUserData)}`);
+ const moodleUserData = moodleUsername
+ ? await moodleDb.mdl_user.findUnique({
+ where: {
+ mnethostid_username: {
+ username: moodleUsername,
+ mnethostid: 1,
+ },
+ },
+ })
+ : await moodleDb.mdl_user.findFirst({
+ where: {
+ email,
+ },
+ });
- if (!moodleUserData.username) {
+ // const [moodleUserData] = await moodleDb.mdl_user.findMany();
+
+ if (!moodleUserData) {
+ if (moodleUsername) {
+ return 'No user found with that username.';
+ }
return 'No user found with that email address.';
}
+ // log.debug(F, `moodleUserData: ${JSON.stringify(moodleUserData.username)}`);
+
userData.moodle_id = moodleUserData.username;
- await database.users.set(userData);
+
+ tripbotDb.users.update({
+ where: {
+ id: userData.id,
+ },
+ data: {
+ moodle_id: userData.moodle_id,
+ },
+ });
if (moodleUsername) {
return stripIndents`You have linked this Discord account with TripSitLearn!
@@ -364,11 +136,32 @@ export async function unlink(
matrixId?:string,
):Promise {
// log.debug(F, `Unlink started with discordId: ${discordId}, matrixId: ${matrixId}`);
+
const userData = discordId
- ? await database.users.get(discordId, null, null)
- : await database.users.get(null, matrixId as string, null);
- userData.moodle_id = null;
- await database.users.set(userData);
+ ? await tripbotDb.users.findUnique({
+ where: {
+ discord_id: discordId,
+ },
+ })
+ : await tripbotDb.users.findFirst({
+ where: {
+ matrix_id: matrixId as string,
+ },
+ });
+
+ if (!userData) {
+ return 'No user found with that Discord or Matrix ID.';
+ }
+
+ tripbotDb.users.update({
+ where: {
+ id: userData.id,
+ },
+ data: {
+ moodle_id: null,
+ },
+ });
+
return stripIndents`You have unlinked your Discord account with TripSitLearn!
Use the /learn link command if you ever want to link your account again!`;
}
@@ -382,42 +175,93 @@ export async function profile(
let moodleProfile = {} as MoodleProfile;
const userData = discordId
- ? await database.users.get(discordId, null, null)
- : await database.users.get(null, matrixId as string, null);
+ ? await tripbotDb.users.findUnique({
+ where: {
+ discord_id: discordId,
+ },
+ })
+ : await tripbotDb.users.findFirst({
+ where: {
+ matrix_id: matrixId as string,
+ },
+ });
+
+ // log.debug(F, `userData: ${JSON.stringify(userData, null, 2)}`);
+
+ if (!userData || !userData.moodle_id) {
+ return moodleProfile;
+ }
- if (!userData.moodle_id) {
+ try {
+ await moodleDb.mdl_user.findMany();
+ } catch (err) {
+ global.moodleConnection = {
+ status: false,
+ date: DateTime.now(),
+ };
return moodleProfile;
}
- const moodleUserData = await getMoodleUser(userData.moodle_id);
- // log.debug(F, `moodleUserData: ${JSON.stringify(moodleUserData, null, 2)}`);
- const moodleEnrollments = await getMoodleEnrollments(moodleUserData);
+ const moodleUserData = await moodleDb.mdl_user.findUnique({
+ where: {
+ mnethostid_username: {
+ username: userData.moodle_id,
+ mnethostid: 1,
+ },
+ },
+ });
+
+ if (!moodleUserData) {
+ return moodleProfile;
+ }
+
+ // log.debug(F, `moodleUserData: ${JSON.stringify(moodleUserData, bigIntSanitize, 2)}`);
+
+ const moodleEnrollments = await moodleDb.mdl_user_enrolments.findMany({
+ where: {
+ userid: moodleUserData.id,
+ },
+ include: {
+ enrol: {
+ include: {
+ course: {
+ include: {
+ completions: {
+ where: {
+ userid: moodleUserData.id,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ });
let completedCourses:string[] = [];
let incompleteCourses:string[] = [];
if (moodleEnrollments.length > 0) {
// log.debug(F, `moodleEnrollments: ${JSON.stringify(moodleEnrollments, null, 2)}`);
- const moodleCourseCompletionData = await getMoodleCourseCompletion(moodleUserData, moodleEnrollments);
// log.debug(F, `moodleCourseCompletionData: ${JSON.stringify(moodleCourseCompletionData, null, 2)}`);
// Get an array of courses the user has completed
- completedCourses = moodleCourseCompletionData
- .filter(ccData => ccData.completion.completionstatus.completed)
- .map(course => course.course.fullname);
-
- // Get an array of courses the user has NOT completed
- incompleteCourses = moodleCourseCompletionData
- .filter(ccData => !ccData.completion.completionstatus.completed)
- .map(course => course.course.fullname);
+ completedCourses = moodleEnrollments
+ .filter(enrollments => enrollments.enrol.course.completions[0].timecompleted !== null)
+ .map(enrollments => enrollments.enrol.course.fullname);
+
+ incompleteCourses = moodleEnrollments
+ .filter(enrollments => enrollments.enrol.course.completions[0].timecompleted === null)
+ .map(enrollments => enrollments.enrol.course.fullname);
}
moodleProfile = {
fullName: `${moodleUserData.firstname} ${moodleUserData.lastname}`,
institution: moodleUserData.institution,
department: moodleUserData.department,
- profileImage: moodleUserData.profileimageurl,
completedCourses,
incompleteCourses,
};
+
+ // log.debug(F, `moodleProfile: ${JSON.stringify(moodleProfile, null, 2)}`);
return moodleProfile;
}
diff --git a/src/global/utils/db.ts b/src/global/utils/db.ts
deleted file mode 100644
index 1040bbb44..000000000
--- a/src/global/utils/db.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import { PrismaClient } from '@prisma/client';
-
-const db = new PrismaClient({ log: ['error', 'info', 'query', 'warn'] });
-export default db;
diff --git a/src/global/utils/timer.ts b/src/global/utils/timer.ts
index 0b22c6a31..c133ecff3 100644
--- a/src/global/utils/timer.ts
+++ b/src/global/utils/timer.ts
@@ -944,10 +944,11 @@ async function checkMoodle() { // eslint-disable-line
// It will loop through each of those users and check their enrollments and course status in moodle
// If the user has completed a course, it will attempt to give that user a role in discord
- // log.debug(F, 'Checking Moodle...');
+ // log.debug(F, 'Starting checkMoodle');
// Set the connection status on first run
- if (!global.moodleConnection) {
+ if (global.moodleConnection === undefined) {
+ // log.debug(F, 'moodleConnection is undefined setting it to true and now');
global.moodleConnection = {
status: true,
date: DateTime.now(),
@@ -964,7 +965,7 @@ async function checkMoodle() { // eslint-disable-line
const userDataList = env.POSTGRES_DB_URL
? await database.users.getMoodleUsers()
: [];
- // log.debug(F, `userDataList: ${JSON.stringify(userDataList, null, 2)}`);
+ // log.debug(F, `userDataList: ${userDataList.length}`);
const courseRoleMap = {
'Intro to Tripsitting': env.ROLE_TS100,
@@ -974,6 +975,7 @@ async function checkMoodle() { // eslint-disable-line
const channelHowToVolunteer = await guild.channels.fetch(env.CHANNEL_HOW_TO_VOLUNTEER);
const channelContent = await guild.channels.fetch(env.CHANNEL_CONTENT);
+ // log.debug(F, 'Starting to check each user');
userDataList.forEach(async user => {
let member = {} as GuildMember;
try {
@@ -986,7 +988,7 @@ async function checkMoodle() { // eslint-disable-line
const moodleProfile = await profile(user.discord_id as string);
// log.debug(F, `Checking ${member.user.username}...`);
- if (moodleProfile.completedCourses.length > 0) {
+ if (moodleProfile.completedCourses && moodleProfile.completedCourses.length > 0) {
moodleProfile.completedCourses.forEach(async course => {
// log.debug(F, `${member.user.username} completed ${course}...`);
const roleId = courseRoleMap[course as keyof typeof courseRoleMap];
@@ -1044,10 +1046,15 @@ async function checkMoodle() { // eslint-disable-line
// log.debug(F, `Sent ${member.user.username} a message!`);
}
});
- } else {
- // log.debug(F, 'No completed courses found');
}
});
+
+ // log.debug(F, 'Finished checking moodle!');
+ // log.debug(F, `connection: ${JSON.stringify(global.moodleConnection, null, 2)}`);
+
+ // if (!global.moodleConnection.status) {
+ // log.debug(F, 'moodleConnection failed, hopefully you\'re in dev LMAO');
+ // }
}
async function checkEvery(
@@ -1085,7 +1092,7 @@ async function runTimer() {
{ callback: checkVoice, interval: env.NODE_ENV === 'production' ? seconds60 : seconds5 },
// { callback: changeStatus, interval: env.NODE_ENV === 'production' ? hours24 : seconds5 },
{ callback: checkStats, interval: env.NODE_ENV === 'production' ? minutes5 : seconds5 },
- { callback: checkMoodle, interval: env.NODE_ENV === 'production' ? seconds60 : seconds10 },
+ { callback: checkMoodle, interval: env.NODE_ENV === 'production' ? seconds60 : seconds5 },
// { callback: checkLpm, interval: env.NODE_ENV === 'production' ? seconds10 : seconds5 },
];
diff --git a/src/pgadmin4/servers.json b/src/pgadmin4/servers.json
index fd2a399cf..e4482baa5 100644
--- a/src/pgadmin4/servers.json
+++ b/src/pgadmin4/servers.json
@@ -4,7 +4,7 @@
"Name": "TripSit",
"Group": "Servers",
"Port": 5432,
- "Username": "postgres",
+ "Username": "tripsit",
"Host": "tripbot_database",
"SSLMode": "prefer",
"MaintenanceDB": "postgres"
diff --git a/src/prisma/moodle/schema.prisma b/src/prisma/moodle/schema.prisma
new file mode 100644
index 000000000..e94c13a4d
--- /dev/null
+++ b/src/prisma/moodle/schema.prisma
@@ -0,0 +1,8093 @@
+generator client {
+ provider = "prisma-client-js"
+ previewFeatures = ["fullTextIndex"]
+ // output = "./@prisma-moodle/client"
+ // output = "/usr/src/app/node_modules/@prisma-moodle/client"
+ output = "./../../../node_modules/@prisma-moodle/client"
+ binaryTargets = ["native", "linux-musl-openssl-3.0.x"]
+}
+
+datasource db {
+ provider = "mysql"
+ url = env("MOODLE_DB_URL")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_adminpresets {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ name String @default("") @db.VarChar(255)
+ comments String? @db.LongText
+ site String @default("") @db.VarChar(255)
+ author String? @db.VarChar(255)
+ moodleversion String @default("") @db.VarChar(20)
+ moodlerelease String @default("") @db.VarChar(255)
+ iscore Boolean @default(false)
+ timecreated BigInt @default(0)
+ timeimported BigInt @default(0)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_adminpresets_app {
+ id BigInt @id @default(autoincrement())
+ adminpresetid BigInt
+ userid BigInt
+ time BigInt
+
+ @@index([adminpresetid], map: "mdl_admiapp_adm_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_adminpresets_app_it {
+ id BigInt @id @default(autoincrement())
+ adminpresetapplyid BigInt
+ configlogid BigInt
+
+ @@index([adminpresetapplyid], map: "mdl_admiappit_adm_ix")
+ @@index([configlogid], map: "mdl_admiappit_con_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_adminpresets_app_it_a {
+ id BigInt @id @default(autoincrement())
+ adminpresetapplyid BigInt
+ configlogid BigInt
+ itemname String? @db.VarChar(100)
+
+ @@index([adminpresetapplyid], map: "mdl_admiappita_adm_ix")
+ @@index([configlogid], map: "mdl_admiappita_con_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_adminpresets_app_plug {
+ id BigInt @id @default(autoincrement())
+ adminpresetapplyid BigInt
+ plugin String? @db.VarChar(100)
+ name String @default("") @db.VarChar(100)
+ value Int @default(0) @db.SmallInt
+ oldvalue Int @default(0) @db.SmallInt
+
+ @@index([adminpresetapplyid], map: "mdl_admiappplug_adm_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_adminpresets_it {
+ id BigInt @id @default(autoincrement())
+ adminpresetid BigInt
+ plugin String? @db.VarChar(100)
+ name String @default("") @db.VarChar(100)
+ value String? @db.LongText
+
+ @@index([adminpresetid], map: "mdl_admiit_adm_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_adminpresets_it_a {
+ id BigInt @id @default(autoincrement())
+ itemid BigInt
+ name String @default("") @db.VarChar(100)
+ value String? @db.LongText
+
+ @@index([itemid], map: "mdl_admiita_ite_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_adminpresets_plug {
+ id BigInt @id @default(autoincrement())
+ adminpresetid BigInt
+ plugin String? @db.VarChar(100)
+ name String @default("") @db.VarChar(100)
+ enabled Int @default(0) @db.SmallInt
+
+ @@index([adminpresetid], map: "mdl_admiplug_adm_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_analytics_indicator_calc {
+ id BigInt @id @default(autoincrement())
+ starttime BigInt
+ endtime BigInt
+ contextid BigInt
+ sampleorigin String @default("") @db.VarChar(255)
+ sampleid BigInt
+ indicator String @default("") @db.VarChar(255)
+ value Decimal? @db.Decimal(10, 2)
+ timecreated BigInt
+
+ @@index([contextid], map: "mdl_analindicalc_con_ix")
+ @@index([starttime, endtime, contextid], map: "mdl_analindicalc_staendcon_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_analytics_models {
+ id BigInt @id @default(autoincrement())
+ enabled Boolean @default(false)
+ trained Boolean @default(false)
+ name String? @db.VarChar(1333)
+ target String @default("") @db.VarChar(255)
+ indicators String @db.LongText
+ timesplitting String? @db.VarChar(255)
+ predictionsprocessor String? @db.VarChar(255)
+ version BigInt
+ contextids String? @db.LongText
+ timecreated BigInt?
+ timemodified BigInt
+ usermodified BigInt
+
+ @@index([enabled, trained], map: "mdl_analmode_enatra_ix")
+ @@index([usermodified], map: "mdl_analmode_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_analytics_models_log {
+ id BigInt @id @default(autoincrement())
+ modelid BigInt
+ version BigInt
+ evaluationmode String @default("") @db.VarChar(50)
+ target String @default("") @db.VarChar(255)
+ indicators String @db.LongText
+ timesplitting String? @db.VarChar(255)
+ score Decimal @default(0.00000) @db.Decimal(10, 5)
+ info String? @db.LongText
+ dir String @db.LongText
+ timecreated BigInt
+ usermodified BigInt
+
+ @@index([modelid], map: "mdl_analmodelog_mod_ix")
+ @@index([usermodified], map: "mdl_analmodelog_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_analytics_predict_samples {
+ id BigInt @id @default(autoincrement())
+ modelid BigInt
+ analysableid BigInt
+ timesplitting String @default("") @db.VarChar(255)
+ rangeindex BigInt
+ sampleids String @db.LongText
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([modelid], map: "mdl_analpredsamp_mod_ix")
+ @@index([modelid, analysableid, timesplitting, rangeindex], map: "mdl_analpredsamp_modanatimr_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_analytics_prediction_actions {
+ id BigInt @id @default(autoincrement())
+ predictionid BigInt
+ userid BigInt
+ actionname String @default("") @db.VarChar(255)
+ timecreated BigInt
+
+ @@index([predictionid], map: "mdl_analpredacti_pre_ix")
+ @@index([predictionid, userid, actionname], map: "mdl_analpredacti_preuseact_ix")
+ @@index([userid], map: "mdl_analpredacti_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_analytics_predictions {
+ id BigInt @id @default(autoincrement())
+ modelid BigInt
+ contextid BigInt
+ sampleid BigInt
+ rangeindex Int @db.MediumInt
+ prediction Decimal @db.Decimal(10, 2)
+ predictionscore Decimal @db.Decimal(10, 5)
+ calculations String @db.LongText
+ timecreated BigInt @default(0)
+ timestart BigInt?
+ timeend BigInt?
+
+ @@index([contextid], map: "mdl_analpred_con_ix")
+ @@index([modelid], map: "mdl_analpred_mod_ix")
+ @@index([modelid, contextid], map: "mdl_analpred_modcon_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_analytics_train_samples {
+ id BigInt @id @default(autoincrement())
+ modelid BigInt
+ analysableid BigInt
+ timesplitting String @default("") @db.VarChar(255)
+ sampleids String @db.LongText
+ timecreated BigInt @default(0)
+
+ @@index([modelid], map: "mdl_analtraisamp_mod_ix")
+ @@index([modelid, analysableid, timesplitting], map: "mdl_analtraisamp_modanatim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_analytics_used_analysables {
+ id BigInt @id @default(autoincrement())
+ modelid BigInt
+ action String @default("") @db.VarChar(50)
+ analysableid BigInt
+ firstanalysis BigInt
+ timeanalysed BigInt
+
+ @@index([analysableid], map: "mdl_analusedanal_ana_ix")
+ @@index([modelid], map: "mdl_analusedanal_mod_ix")
+ @@index([modelid, action], map: "mdl_analusedanal_modact_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_analytics_used_files {
+ id BigInt @id @default(autoincrement())
+ modelid BigInt @default(0)
+ fileid BigInt @default(0)
+ action String @default("") @db.VarChar(50)
+ time BigInt @default(0)
+
+ @@index([fileid], map: "mdl_analusedfile_fil_ix")
+ @@index([modelid], map: "mdl_analusedfile_mod_ix")
+ @@index([modelid, action, fileid], map: "mdl_analusedfile_modactfil_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assign {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ alwaysshowdescription Int @default(0) @db.TinyInt
+ nosubmissions Int @default(0) @db.TinyInt
+ submissiondrafts Int @default(0) @db.TinyInt
+ sendnotifications Int @default(0) @db.TinyInt
+ sendlatenotifications Int @default(0) @db.TinyInt
+ duedate BigInt @default(0)
+ allowsubmissionsfromdate BigInt @default(0)
+ grade BigInt @default(0)
+ timemodified BigInt @default(0)
+ requiresubmissionstatement Int @default(0) @db.TinyInt
+ completionsubmit Int @default(0) @db.TinyInt
+ cutoffdate BigInt @default(0)
+ gradingduedate BigInt @default(0)
+ teamsubmission Int @default(0) @db.TinyInt
+ requireallteammemberssubmit Int @default(0) @db.TinyInt
+ teamsubmissiongroupingid BigInt @default(0)
+ blindmarking Int @default(0) @db.TinyInt
+ hidegrader Int @default(0) @db.TinyInt
+ revealidentities Int @default(0) @db.TinyInt
+ attemptreopenmethod String @default("none") @db.VarChar(10)
+ maxattempts Int @default(-1) @db.MediumInt
+ markingworkflow Int @default(0) @db.TinyInt
+ markingallocation Int @default(0) @db.TinyInt
+ sendstudentnotifications Int @default(1) @db.TinyInt
+ preventsubmissionnotingroup Int @default(0) @db.TinyInt
+ activity String? @db.LongText
+ activityformat Int @default(0) @db.SmallInt
+ timelimit BigInt @default(0)
+ submissionattachments Int @default(0) @db.TinyInt
+
+ @@index([course], map: "mdl_assi_cou_ix")
+ @@index([teamsubmissiongroupingid], map: "mdl_assi_tea_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assign_grades {
+ id BigInt @id @default(autoincrement())
+ assignment BigInt @default(0)
+ userid BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ grader BigInt @default(0)
+ grade Decimal? @default(0.00000) @db.Decimal(10, 5)
+ attemptnumber BigInt @default(0)
+
+ @@unique([assignment, userid, attemptnumber], map: "mdl_assigrad_assuseatt_uix")
+ @@index([assignment], map: "mdl_assigrad_ass_ix")
+ @@index([attemptnumber], map: "mdl_assigrad_att_ix")
+ @@index([userid], map: "mdl_assigrad_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assign_overrides {
+ id BigInt @id @default(autoincrement())
+ assignid BigInt @default(0)
+ groupid BigInt?
+ userid BigInt?
+ sortorder BigInt?
+ allowsubmissionsfromdate BigInt?
+ duedate BigInt?
+ cutoffdate BigInt?
+ timelimit BigInt?
+
+ @@index([assignid], map: "mdl_assiover_ass_ix")
+ @@index([groupid], map: "mdl_assiover_gro_ix")
+ @@index([userid], map: "mdl_assiover_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assign_plugin_config {
+ id BigInt @id @default(autoincrement())
+ assignment BigInt @default(0)
+ plugin String @default("") @db.VarChar(28)
+ subtype String @default("") @db.VarChar(28)
+ name String @default("") @db.VarChar(28)
+ value String? @db.LongText
+
+ @@index([assignment], map: "mdl_assiplugconf_ass_ix")
+ @@index([name], map: "mdl_assiplugconf_nam_ix")
+ @@index([plugin], map: "mdl_assiplugconf_plu_ix")
+ @@index([subtype], map: "mdl_assiplugconf_sub_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assign_submission {
+ id BigInt @id @default(autoincrement())
+ assignment BigInt @default(0)
+ userid BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ timestarted BigInt?
+ status String? @db.VarChar(10)
+ groupid BigInt @default(0)
+ attemptnumber BigInt @default(0)
+ latest Int @default(0) @db.TinyInt
+
+ @@unique([assignment, userid, groupid, attemptnumber], map: "mdl_assisubm_assusegroatt_uix")
+ @@index([assignment], map: "mdl_assisubm_ass_ix")
+ @@index([assignment, userid, groupid, latest], map: "mdl_assisubm_assusegrolat_ix")
+ @@index([attemptnumber], map: "mdl_assisubm_att_ix")
+ @@index([userid], map: "mdl_assisubm_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assign_user_flags {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ assignment BigInt @default(0)
+ locked BigInt @default(0)
+ mailed Int @default(0) @db.SmallInt
+ extensionduedate BigInt @default(0)
+ workflowstate String? @db.VarChar(20)
+ allocatedmarker BigInt @default(0)
+
+ @@index([assignment], map: "mdl_assiuserflag_ass_ix")
+ @@index([mailed], map: "mdl_assiuserflag_mai_ix")
+ @@index([userid], map: "mdl_assiuserflag_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assign_user_mapping {
+ id BigInt @id @default(autoincrement())
+ assignment BigInt @default(0)
+ userid BigInt @default(0)
+
+ @@index([assignment], map: "mdl_assiusermapp_ass_ix")
+ @@index([userid], map: "mdl_assiusermapp_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assignfeedback_comments {
+ id BigInt @id @default(autoincrement())
+ assignment BigInt @default(0)
+ grade BigInt @default(0)
+ commenttext String? @db.LongText
+ commentformat Int @default(0) @db.SmallInt
+
+ @@index([assignment], map: "mdl_assicomm_ass_ix")
+ @@index([grade], map: "mdl_assicomm_gra_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assignfeedback_editpdf_annot {
+ id BigInt @id @default(autoincrement())
+ gradeid BigInt @default(0)
+ pageno BigInt @default(0)
+ x BigInt? @default(0)
+ y BigInt? @default(0)
+ endx BigInt? @default(0)
+ endy BigInt? @default(0)
+ path String? @db.LongText
+ type String? @default("line") @db.VarChar(10)
+ colour String? @default("black") @db.VarChar(10)
+ draft Int @default(1) @db.TinyInt
+
+ @@index([gradeid], map: "mdl_assieditanno_gra_ix")
+ @@index([gradeid, pageno], map: "mdl_assieditanno_grapag_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assignfeedback_editpdf_cmnt {
+ id BigInt @id @default(autoincrement())
+ gradeid BigInt @default(0)
+ x BigInt? @default(0)
+ y BigInt? @default(0)
+ width BigInt? @default(120)
+ rawtext String? @db.LongText
+ pageno BigInt @default(0)
+ colour String? @default("black") @db.VarChar(10)
+ draft Int @default(1) @db.TinyInt
+
+ @@index([gradeid], map: "mdl_assieditcmnt_gra_ix")
+ @@index([gradeid, pageno], map: "mdl_assieditcmnt_grapag_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assignfeedback_editpdf_quick {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ rawtext String @db.LongText
+ width BigInt @default(120)
+ colour String? @default("yellow") @db.VarChar(10)
+
+ @@index([userid], map: "mdl_assieditquic_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assignfeedback_editpdf_rot {
+ id BigInt @id @default(autoincrement())
+ gradeid BigInt @default(0)
+ pageno BigInt @default(0)
+ pathnamehash String @db.LongText
+ isrotated Boolean @default(false)
+ degree BigInt @default(0)
+
+ @@unique([gradeid, pageno], map: "mdl_assieditrot_grapag_uix")
+ @@index([gradeid], map: "mdl_assieditrot_gra_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assignfeedback_file {
+ id BigInt @id @default(autoincrement())
+ assignment BigInt @default(0)
+ grade BigInt @default(0)
+ numfiles BigInt @default(0)
+
+ @@index([assignment], map: "mdl_assifile_ass2_ix")
+ @@index([grade], map: "mdl_assifile_gra_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assignment {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ assignmenttype String @default("") @db.VarChar(50)
+ resubmit Int @default(0) @db.TinyInt
+ preventlate Int @default(0) @db.TinyInt
+ emailteachers Int @default(0) @db.TinyInt
+ var1 BigInt? @default(0)
+ var2 BigInt? @default(0)
+ var3 BigInt? @default(0)
+ var4 BigInt? @default(0)
+ var5 BigInt? @default(0)
+ maxbytes BigInt @default(100000)
+ timedue BigInt @default(0)
+ timeavailable BigInt @default(0)
+ grade BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([course], map: "mdl_assi_cou2_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assignment_submissions {
+ id BigInt @id @default(autoincrement())
+ assignment BigInt @default(0)
+ userid BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ numfiles BigInt @default(0)
+ data1 String? @db.LongText
+ data2 String? @db.LongText
+ grade BigInt @default(0)
+ submissioncomment String @db.LongText
+ format Int @default(0) @db.SmallInt
+ teacher BigInt @default(0)
+ timemarked BigInt @default(0)
+ mailed Boolean @default(false)
+
+ @@index([assignment], map: "mdl_assisubm_ass2_ix")
+ @@index([mailed], map: "mdl_assisubm_mai_ix")
+ @@index([timemarked], map: "mdl_assisubm_tim_ix")
+ @@index([userid], map: "mdl_assisubm_use2_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assignment_upgrade {
+ id BigInt @id @default(autoincrement())
+ oldcmid BigInt @default(0)
+ oldinstance BigInt @default(0)
+ newcmid BigInt @default(0)
+ newinstance BigInt @default(0)
+ timecreated BigInt @default(0)
+
+ @@index([oldinstance], map: "mdl_assiupgr_old2_ix")
+ @@index([oldcmid], map: "mdl_assiupgr_old_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assignsubmission_file {
+ id BigInt @id @default(autoincrement())
+ assignment BigInt @default(0)
+ submission BigInt @default(0)
+ numfiles BigInt @default(0)
+
+ @@index([assignment], map: "mdl_assifile_ass_ix")
+ @@index([submission], map: "mdl_assifile_sub_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_assignsubmission_onlinetext {
+ id BigInt @id @default(autoincrement())
+ assignment BigInt @default(0)
+ submission BigInt @default(0)
+ onlinetext String? @db.LongText
+ onlineformat Int @default(0) @db.SmallInt
+
+ @@index([assignment], map: "mdl_assionli_ass_ix")
+ @@index([submission], map: "mdl_assionli_sub_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_auth_lti_linked_login {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ issuer String @db.LongText
+ issuer256 String @default("") @db.VarChar(64)
+ sub String @default("") @db.VarChar(255)
+ sub256 String @default("") @db.VarChar(64)
+ timecreated BigInt
+ timemodified BigInt
+
+ @@unique([userid, issuer256, sub256], map: "mdl_authltilinklogi_useiss_uix")
+ @@index([userid], map: "mdl_authltilinklogi_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_auth_oauth2_linked_login {
+ id BigInt @id @default(autoincrement())
+ timecreated BigInt
+ timemodified BigInt
+ usermodified BigInt
+ userid BigInt
+ issuerid BigInt
+ username String @default("") @db.VarChar(255)
+ email String @db.LongText
+ confirmtoken String @default("") @db.VarChar(64)
+ confirmtokenexpires BigInt?
+
+ @@unique([userid, issuerid, username], map: "mdl_authoautlinklogi_useis_uix")
+ @@index([issuerid], map: "mdl_authoautlinklogi_iss_ix")
+ @@index([issuerid, username], map: "mdl_authoautlinklogi_issuse_ix")
+ @@index([userid], map: "mdl_authoautlinklogi_use2_ix")
+ @@index([usermodified], map: "mdl_authoautlinklogi_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_auth_oidc_prevlogin {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @unique(map: "mdl_authoidcprev_use_uix")
+ method String @default("") @db.VarChar(255)
+ password String @default("") @db.VarChar(255)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_auth_oidc_state {
+ id BigInt @id @default(autoincrement())
+ sesskey String @default("") @db.VarChar(10)
+ state String @default("") @db.VarChar(15)
+ nonce String @default("") @db.VarChar(15)
+ timecreated BigInt
+ additionaldata String? @db.LongText
+
+ @@index([state], map: "mdl_authoidcstat_sta_ix")
+ @@index([timecreated], map: "mdl_authoidcstat_tim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_auth_oidc_token {
+ id BigInt @id @default(autoincrement())
+ oidcuniqid String @default("") @db.VarChar(255)
+ username String @default("") @db.VarChar(100)
+ userid BigInt @default(0)
+ oidcusername String @default("") @db.VarChar(255)
+ scope String @db.LongText
+ tokenresource String @default("") @db.VarChar(127)
+ authcode String @db.LongText
+ token String @db.LongText
+ expiry BigInt
+ refreshtoken String @db.LongText
+ idtoken String @db.LongText
+ sid String? @db.VarChar(36)
+
+ @@index([oidcuniqid], map: "mdl_authoidctoke_oid_ix")
+ @@index([username], map: "mdl_authoidctoke_use2_ix")
+ @@index([userid], map: "mdl_authoidctoke_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_backup_controllers {
+ id BigInt @id @default(autoincrement())
+ backupid String @unique(map: "mdl_backcont_bac_uix") @default("") @db.VarChar(32)
+ operation String @default("backup") @db.VarChar(20)
+ type String @default("") @db.VarChar(10)
+ itemid BigInt
+ format String @default("") @db.VarChar(20)
+ interactive Int @db.SmallInt
+ purpose Int @db.SmallInt
+ userid BigInt
+ status Int @db.SmallInt
+ execution Int @db.SmallInt
+ executiontime BigInt
+ checksum String @default("") @db.VarChar(32)
+ timecreated BigInt
+ timemodified BigInt
+ progress Decimal @default(0.00000000000000) @db.Decimal(15, 14)
+ controller String @db.LongText
+
+ @@index([type, itemid], map: "mdl_backcont_typite_ix")
+ @@index([userid], map: "mdl_backcont_use_ix")
+ @@index([userid, itemid], map: "mdl_backcont_useite_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_backup_courses {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt @unique(map: "mdl_backcour_cou_uix") @default(0)
+ laststarttime BigInt @default(0)
+ lastendtime BigInt @default(0)
+ laststatus String @default("5") @db.VarChar(1)
+ nextstarttime BigInt @default(0)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_backup_logs {
+ id BigInt @id @default(autoincrement())
+ backupid String @default("") @db.VarChar(32)
+ loglevel Int @db.SmallInt
+ message String @db.LongText
+ timecreated BigInt
+
+ @@unique([backupid, id], map: "mdl_backlogs_bacid_uix")
+ @@index([backupid], map: "mdl_backlogs_bac_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_badge {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(255)
+ description String? @db.LongText
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ usercreated BigInt
+ usermodified BigInt
+ issuername String @default("") @db.VarChar(255)
+ issuerurl String @default("") @db.VarChar(255)
+ issuercontact String? @db.VarChar(255)
+ expiredate BigInt?
+ expireperiod BigInt?
+ type Boolean @default(true)
+ courseid BigInt?
+ message String @db.LongText
+ messagesubject String @db.LongText
+ attachment Boolean @default(true)
+ notification Boolean @default(true)
+ status Boolean @default(false)
+ nextcron BigInt?
+ version String? @db.VarChar(255)
+ language String? @db.VarChar(255)
+ imageauthorname String? @db.VarChar(255)
+ imageauthoremail String? @db.VarChar(255)
+ imageauthorurl String? @db.VarChar(255)
+ imagecaption String? @db.LongText
+
+ @@index([courseid], map: "mdl_badg_cou_ix")
+ @@index([type], map: "mdl_badg_typ_ix")
+ @@index([usercreated], map: "mdl_badg_use2_ix")
+ @@index([usermodified], map: "mdl_badg_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_badge_alignment {
+ id BigInt @id @default(autoincrement())
+ badgeid BigInt @default(0)
+ targetname String @default("") @db.VarChar(255)
+ targeturl String @default("") @db.VarChar(255)
+ targetdescription String? @db.LongText
+ targetframework String? @db.VarChar(255)
+ targetcode String? @db.VarChar(255)
+
+ @@index([badgeid], map: "mdl_badgalig_bad_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_badge_backpack {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ email String @default("") @db.VarChar(100)
+ backpackuid BigInt
+ autosync Boolean @default(false)
+ password String? @db.VarChar(50)
+ externalbackpackid BigInt?
+
+ @@unique([userid, externalbackpackid], map: "mdl_badgback_useext_uix")
+ @@index([externalbackpackid], map: "mdl_badgback_ext_ix")
+ @@index([userid], map: "mdl_badgback_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_badge_backpack_oauth2 {
+ id BigInt @id @default(autoincrement())
+ usermodified BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ userid BigInt
+ issuerid BigInt
+ externalbackpackid BigInt
+ token String @db.LongText
+ refreshtoken String @db.LongText
+ expires BigInt?
+ scope String? @db.LongText
+
+ @@index([externalbackpackid], map: "mdl_badgbackoaut_ext_ix")
+ @@index([issuerid], map: "mdl_badgbackoaut_iss_ix")
+ @@index([userid], map: "mdl_badgbackoaut_use2_ix")
+ @@index([usermodified], map: "mdl_badgbackoaut_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_badge_criteria {
+ id BigInt @id @default(autoincrement())
+ badgeid BigInt @default(0)
+ criteriatype BigInt?
+ method Boolean @default(true)
+ description String? @db.LongText
+ descriptionformat Int @default(0) @db.TinyInt
+
+ @@unique([badgeid, criteriatype], map: "mdl_badgcrit_badcri_uix")
+ @@index([badgeid], map: "mdl_badgcrit_bad_ix")
+ @@index([criteriatype], map: "mdl_badgcrit_cri_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_badge_criteria_met {
+ id BigInt @id @default(autoincrement())
+ issuedid BigInt?
+ critid BigInt
+ userid BigInt
+ datemet BigInt
+
+ @@index([critid], map: "mdl_badgcritmet_cri_ix")
+ @@index([issuedid], map: "mdl_badgcritmet_iss_ix")
+ @@index([userid], map: "mdl_badgcritmet_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_badge_criteria_param {
+ id BigInt @id @default(autoincrement())
+ critid BigInt
+ name String @default("") @db.VarChar(255)
+ value String? @db.VarChar(255)
+
+ @@index([critid], map: "mdl_badgcritpara_cri_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_badge_endorsement {
+ id BigInt @id @default(autoincrement())
+ badgeid BigInt @default(0)
+ issuername String @default("") @db.VarChar(255)
+ issuerurl String @default("") @db.VarChar(255)
+ issueremail String @default("") @db.VarChar(255)
+ claimid String? @db.VarChar(255)
+ claimcomment String? @db.LongText
+ dateissued BigInt @default(0)
+
+ @@index([badgeid], map: "mdl_badgendo_bad_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_badge_external {
+ id BigInt @id @default(autoincrement())
+ backpackid BigInt
+ collectionid BigInt
+ entityid String? @db.VarChar(255)
+ assertion String? @db.LongText
+
+ @@index([backpackid], map: "mdl_badgexte_bac_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_badge_external_backpack {
+ id BigInt @id @default(autoincrement())
+ backpackapiurl String @unique(map: "mdl_badgexteback_bac_uix") @default("") @db.VarChar(255)
+ backpackweburl String @unique(map: "mdl_badgexteback_bac2_uix") @default("") @db.VarChar(255)
+ apiversion String @default("1.0") @db.VarChar(12)
+ sortorder BigInt @default(0)
+ oauth2_issuerid BigInt?
+
+ @@index([oauth2_issuerid], map: "mdl_badgexteback_oau_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_badge_external_identifier {
+ id BigInt @id @default(autoincrement())
+ sitebackpackid BigInt
+ internalid String @default("") @db.VarChar(128)
+ externalid String @default("") @db.VarChar(128)
+ type String @default("") @db.VarChar(16)
+
+ @@unique([sitebackpackid, internalid, externalid, type], map: "mdl_badgexteiden_sitintext_uix")
+ @@index([sitebackpackid], map: "mdl_badgexteiden_sit_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_badge_issued {
+ id BigInt @id @default(autoincrement())
+ badgeid BigInt @default(0)
+ userid BigInt @default(0)
+ uniquehash String @db.LongText
+ dateissued BigInt @default(0)
+ dateexpire BigInt?
+ visible Boolean @default(false)
+ issuernotified BigInt?
+
+ @@unique([badgeid, userid], map: "mdl_badgissu_baduse_uix")
+ @@index([badgeid], map: "mdl_badgissu_bad_ix")
+ @@index([userid], map: "mdl_badgissu_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_badge_manual_award {
+ id BigInt @id @default(autoincrement())
+ badgeid BigInt
+ recipientid BigInt
+ issuerid BigInt
+ issuerrole BigInt
+ datemet BigInt
+
+ @@index([badgeid], map: "mdl_badgmanuawar_bad_ix")
+ @@index([issuerrole], map: "mdl_badgmanuawar_iss2_ix")
+ @@index([issuerid], map: "mdl_badgmanuawar_iss_ix")
+ @@index([recipientid], map: "mdl_badgmanuawar_rec_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_badge_related {
+ id BigInt @id @default(autoincrement())
+ badgeid BigInt @default(0)
+ relatedbadgeid BigInt?
+
+ @@unique([badgeid, relatedbadgeid], map: "mdl_badgrela_badrel_uix")
+ @@index([badgeid], map: "mdl_badgrela_bad_ix")
+ @@index([relatedbadgeid], map: "mdl_badgrela_rel_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_bigbluebuttonbn {
+ id BigInt @id @default(autoincrement())
+ type Int @default(0) @db.TinyInt
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String? @db.LongText
+ introformat Int @default(1) @db.SmallInt
+ meetingid String @default("") @db.VarChar(255)
+ moderatorpass String @default("") @db.VarChar(255)
+ viewerpass String @default("") @db.VarChar(255)
+ wait Boolean @default(false)
+ record Boolean @default(false)
+ recordallfromstart Boolean @default(false)
+ recordhidebutton Boolean @default(false)
+ welcome String? @db.LongText
+ voicebridge Int @default(0) @db.MediumInt
+ openingtime BigInt @default(0)
+ closingtime BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ presentation String? @db.LongText
+ participants String? @db.LongText
+ userlimit Int @default(0) @db.SmallInt
+ recordings_html Boolean @default(false)
+ recordings_deleted Boolean @default(true)
+ recordings_imported Boolean @default(false)
+ recordings_preview Boolean @default(false)
+ clienttype Boolean @default(false)
+ muteonstart Boolean @default(false)
+ disablecam Boolean @default(false)
+ disablemic Boolean @default(false)
+ disableprivatechat Boolean @default(false)
+ disablepublicchat Boolean @default(false)
+ disablenote Boolean @default(false)
+ hideuserlist Boolean @default(false)
+ lockedlayout Boolean @default(false)
+ completionattendance Int @default(0)
+ completionengagementchats Int @default(0)
+ completionengagementtalks Int @default(0)
+ completionengagementraisehand Int @default(0)
+ completionengagementpollvotes Int @default(0)
+ completionengagementemojis Int @default(0)
+ guestallowed Int? @default(0) @db.TinyInt
+ mustapproveuser Int? @default(1) @db.TinyInt
+ guestlinkuid String? @db.VarChar(1024)
+ guestpassword String? @db.VarChar(255)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_bigbluebuttonbn_logs {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ bigbluebuttonbnid BigInt
+ userid BigInt?
+ timecreated BigInt @default(0)
+ meetingid String @default("") @db.VarChar(256)
+ log String @default("") @db.VarChar(32)
+ meta String? @db.LongText
+
+ @@index([courseid], map: "mdl_bigblogs_cou_ix")
+ @@index([courseid, bigbluebuttonbnid, userid, log], map: "mdl_bigblogs_coubiguselog_ix")
+ @@index([log], map: "mdl_bigblogs_log_ix")
+ @@index([userid, log], map: "mdl_bigblogs_uselog_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_bigbluebuttonbn_recordings {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ bigbluebuttonbnid BigInt
+ groupid BigInt?
+ recordingid String @default("") @db.VarChar(64)
+ headless Boolean @default(false)
+ imported Boolean @default(false)
+ status Boolean @default(false)
+ importeddata String? @db.LongText
+ timecreated BigInt @default(0)
+ usermodified BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([bigbluebuttonbnid], map: "mdl_bigbreco_big_ix")
+ @@index([courseid], map: "mdl_bigbreco_cou_ix")
+ @@index([recordingid], map: "mdl_bigbreco_rec_ix")
+ @@index([usermodified], map: "mdl_bigbreco_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_block {
+ id BigInt @id @default(autoincrement())
+ name String @unique(map: "mdl_bloc_nam_uix") @default("") @db.VarChar(40)
+ cron BigInt @default(0)
+ lastcron BigInt @default(0)
+ visible Boolean @default(true)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_block_instances {
+ id BigInt @id @default(autoincrement())
+ blockname String @default("") @db.VarChar(40)
+ parentcontextid BigInt
+ showinsubcontexts Int @db.SmallInt
+ requiredbytheme Int @default(0) @db.SmallInt
+ pagetypepattern String @default("") @db.VarChar(64)
+ subpagepattern String? @db.VarChar(16)
+ defaultregion String @default("") @db.VarChar(16)
+ defaultweight BigInt
+ configdata String? @db.LongText
+ timecreated BigInt
+ timemodified BigInt
+
+ @@index([parentcontextid], map: "mdl_blocinst_par_ix")
+ @@index([parentcontextid, showinsubcontexts, pagetypepattern, subpagepattern], map: "mdl_blocinst_parshopagsub_ix")
+ @@index([timemodified], map: "mdl_blocinst_tim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_block_positions {
+ id BigInt @id @default(autoincrement())
+ blockinstanceid BigInt
+ contextid BigInt
+ pagetype String @default("") @db.VarChar(64)
+ subpage String @default("") @db.VarChar(16)
+ visible Int @db.SmallInt
+ region String @default("") @db.VarChar(16)
+ weight BigInt
+
+ @@unique([blockinstanceid, contextid, pagetype, subpage], map: "mdl_blocposi_bloconpagsub_uix")
+ @@index([blockinstanceid], map: "mdl_blocposi_blo_ix")
+ @@index([contextid], map: "mdl_blocposi_con_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_block_recent_activity {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ cmid BigInt
+ timecreated BigInt
+ userid BigInt
+ action Boolean
+ modname String? @db.VarChar(20)
+
+ @@index([courseid, timecreated], map: "mdl_blocreceacti_coutim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_block_recentlyaccesseditems {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ cmid BigInt
+ userid BigInt
+ timeaccess BigInt
+
+ @@unique([userid, courseid, cmid], map: "mdl_blocrece_usecoucmi_uix")
+ @@index([cmid], map: "mdl_blocrece_cmi_ix")
+ @@index([courseid], map: "mdl_blocrece_cou_ix")
+ @@index([userid], map: "mdl_blocrece_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_block_rss_client {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ title String @db.LongText
+ preferredtitle String @default("") @db.VarChar(64)
+ description String @db.LongText
+ shared Int @default(0) @db.TinyInt
+ url String @default("") @db.VarChar(255)
+ skiptime BigInt @default(0)
+ skipuntil BigInt @default(0)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_block_xp {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ userid BigInt
+ xp BigInt
+ lvl BigInt? @default(1)
+
+ @@unique([courseid, userid], map: "mdl_blocxp_couuse_uix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_block_xp_config {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt @unique(map: "mdl_blocxpconf_cou_uix")
+ enabled Boolean @default(false)
+ levels BigInt
+ lastlogpurge BigInt @default(0)
+ enablecheatguard Boolean @default(true)
+ enableladder Boolean @default(true)
+ enableinfos Boolean @default(true)
+ levelsdata String? @db.LongText
+ enablelevelupnotif Boolean @default(true)
+ enablecustomlevelbadges Boolean @default(false)
+ maxactionspertime BigInt @default(10)
+ timeformaxactions BigInt @default(60)
+ timebetweensameactions BigInt @default(180)
+ identitymode Int @default(1) @db.TinyInt
+ rankmode Int @default(1) @db.TinyInt
+ neighbours Int @default(0) @db.TinyInt
+ defaultfilters BigInt @default(1)
+ laddercols String @default("xp,progress") @db.VarChar(255)
+ instructions String? @db.LongText
+ instructions_format Int @default(0) @db.TinyInt
+ blocktitle String? @db.LongText
+ blockdescription String? @db.LongText
+ blockrecentactivity Boolean?
+ blockrankingsnapshot Boolean @default(true)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_block_xp_filters {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ category Int @default(0) @db.SmallInt
+ ruledata String @db.LongText
+ points BigInt @default(0)
+ sortorder BigInt @default(0)
+
+ @@index([courseid], map: "mdl_blocxpfilt_cou_ix")
+ @@index([courseid, category], map: "mdl_blocxpfilt_coucat_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_block_xp_log {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ userid BigInt
+ eventname String @default("") @db.VarChar(255)
+ xp BigInt
+ time BigInt
+
+ @@index([courseid, userid], map: "mdl_blocxplog_couuse_ix")
+ @@index([time], map: "mdl_blocxplog_tim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_blog_association {
+ id BigInt @id @default(autoincrement())
+ contextid BigInt
+ blogid BigInt
+
+ @@index([blogid], map: "mdl_blogasso_blo_ix")
+ @@index([contextid], map: "mdl_blogasso_con_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_blog_external {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ name String @default("") @db.VarChar(255)
+ description String? @db.LongText
+ url String @db.LongText
+ filtertags String? @db.VarChar(255)
+ failedlastsync Boolean @default(false)
+ timemodified BigInt?
+ timefetched BigInt @default(0)
+
+ @@index([userid], map: "mdl_blogexte_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_book {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String? @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ numbering Int @default(0) @db.SmallInt
+ navstyle Int @default(1) @db.SmallInt
+ customtitles Int @default(0) @db.TinyInt
+ revision BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([course], map: "mdl_book_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_book_chapters {
+ id BigInt @id @default(autoincrement())
+ bookid BigInt @default(0)
+ pagenum BigInt @default(0)
+ subchapter BigInt @default(0)
+ title String @default("") @db.VarChar(255)
+ content String @db.LongText
+ contentformat Int @default(0) @db.SmallInt
+ hidden Int @default(0) @db.TinyInt
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ importsrc String @default("") @db.VarChar(255)
+
+ @@index([bookid], map: "mdl_bookchap_boo_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_cache_filters {
+ id BigInt @id @default(autoincrement())
+ filter String @default("") @db.VarChar(32)
+ version BigInt @default(0)
+ md5key String @default("") @db.VarChar(32)
+ rawtext String @db.LongText
+ timemodified BigInt @default(0)
+
+ @@index([filter, md5key], map: "mdl_cachfilt_filmd5_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_cache_flags {
+ id BigInt @id @default(autoincrement())
+ flagtype String @default("") @db.VarChar(255)
+ name String @default("") @db.VarChar(255)
+ timemodified BigInt @default(0)
+ value String @db.LongText
+ expiry BigInt
+
+ @@index([flagtype], map: "mdl_cachflag_fla_ix")
+ @@index([name], map: "mdl_cachflag_nam_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_capabilities {
+ id BigInt @id @default(autoincrement())
+ name String @unique(map: "mdl_capa_nam_uix") @default("") @db.VarChar(255)
+ captype String @default("") @db.VarChar(50)
+ contextlevel BigInt @default(0)
+ component String @default("") @db.VarChar(100)
+ riskbitmask BigInt @default(0)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_chat {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ keepdays BigInt @default(0)
+ studentlogs Int @default(0) @db.SmallInt
+ chattime BigInt @default(0)
+ schedule Int @default(0) @db.SmallInt
+ timemodified BigInt @default(0)
+
+ @@index([course], map: "mdl_chat_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_chat_messages {
+ id BigInt @id @default(autoincrement())
+ chatid BigInt @default(0)
+ userid BigInt @default(0)
+ groupid BigInt @default(0)
+ issystem Boolean @default(false)
+ message String @db.LongText
+ timestamp BigInt @default(0)
+
+ @@index([chatid], map: "mdl_chatmess_cha_ix")
+ @@index([groupid], map: "mdl_chatmess_gro_ix")
+ @@index([timestamp, chatid], map: "mdl_chatmess_timcha_ix")
+ @@index([userid], map: "mdl_chatmess_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_chat_messages_current {
+ id BigInt @id @default(autoincrement())
+ chatid BigInt @default(0)
+ userid BigInt @default(0)
+ groupid BigInt @default(0)
+ issystem Boolean @default(false)
+ message String @db.LongText
+ timestamp BigInt @default(0)
+
+ @@index([chatid], map: "mdl_chatmesscurr_cha_ix")
+ @@index([groupid], map: "mdl_chatmesscurr_gro_ix")
+ @@index([timestamp, chatid], map: "mdl_chatmesscurr_timcha_ix")
+ @@index([userid], map: "mdl_chatmesscurr_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_chat_users {
+ id BigInt @id @default(autoincrement())
+ chatid BigInt @default(0)
+ userid BigInt @default(0)
+ groupid BigInt @default(0)
+ version String @default("") @db.VarChar(16)
+ ip String @default("") @db.VarChar(45)
+ firstping BigInt @default(0)
+ lastping BigInt @default(0)
+ lastmessageping BigInt @default(0)
+ sid String @default("") @db.VarChar(32)
+ course BigInt @default(0)
+ lang String @default("") @db.VarChar(30)
+
+ @@index([chatid], map: "mdl_chatuser_cha_ix")
+ @@index([course], map: "mdl_chatuser_cou_ix")
+ @@index([groupid], map: "mdl_chatuser_gro_ix")
+ @@index([lastping], map: "mdl_chatuser_las_ix")
+ @@index([userid], map: "mdl_chatuser_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_choice {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ publish Int @default(0) @db.TinyInt
+ showresults Int @default(0) @db.TinyInt
+ display Int @default(0) @db.SmallInt
+ allowupdate Int @default(0) @db.TinyInt
+ allowmultiple Int @default(0) @db.TinyInt
+ showunanswered Int @default(0) @db.TinyInt
+ includeinactive Int @default(1) @db.TinyInt
+ limitanswers Int @default(0) @db.TinyInt
+ timeopen BigInt @default(0)
+ timeclose BigInt @default(0)
+ showpreview Int @default(0) @db.TinyInt
+ timemodified BigInt @default(0)
+ completionsubmit Boolean @default(false)
+ showavailable Boolean @default(false)
+
+ @@index([course], map: "mdl_choi_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_choice_answers {
+ id BigInt @id @default(autoincrement())
+ choiceid BigInt @default(0)
+ userid BigInt @default(0)
+ optionid BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([choiceid], map: "mdl_choiansw_cho_ix")
+ @@index([optionid], map: "mdl_choiansw_opt_ix")
+ @@index([userid], map: "mdl_choiansw_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_choice_options {
+ id BigInt @id @default(autoincrement())
+ choiceid BigInt @default(0)
+ text String? @db.LongText
+ maxanswers BigInt? @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([choiceid], map: "mdl_choiopti_cho_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_cohort {
+ id BigInt @id @default(autoincrement())
+ contextid BigInt
+ name String @default("") @db.VarChar(254)
+ idnumber String? @db.VarChar(100)
+ description String? @db.LongText
+ descriptionformat Int @db.TinyInt
+ visible Boolean @default(true)
+ component String @default("") @db.VarChar(100)
+ timecreated BigInt
+ timemodified BigInt
+ theme String? @db.VarChar(50)
+
+ @@index([contextid], map: "mdl_coho_con_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_cohort_members {
+ id BigInt @id @default(autoincrement())
+ cohortid BigInt @default(0)
+ userid BigInt @default(0)
+ timeadded BigInt @default(0)
+
+ @@unique([cohortid, userid], map: "mdl_cohomemb_cohuse_uix")
+ @@index([cohortid], map: "mdl_cohomemb_coh_ix")
+ @@index([userid], map: "mdl_cohomemb_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_comments {
+ id BigInt @id @default(autoincrement())
+ contextid BigInt
+ component String? @db.VarChar(255)
+ commentarea String @default("") @db.VarChar(255)
+ itemid BigInt
+ content String @db.LongText
+ format Int @default(0) @db.TinyInt
+ userid BigInt
+ timecreated BigInt
+
+ @@index([contextid, commentarea, itemid], map: "mdl_comm_concomite_ix")
+ @@index([userid], map: "mdl_comm_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_competency {
+ id BigInt @id @default(autoincrement())
+ shortname String? @db.VarChar(100)
+ description String? @db.LongText
+ descriptionformat Int @default(0) @db.SmallInt
+ idnumber String? @db.VarChar(100)
+ competencyframeworkid BigInt
+ parentid BigInt @default(0)
+ path String @default("") @db.VarChar(255)
+ sortorder BigInt
+ ruletype String? @db.VarChar(100)
+ ruleoutcome Int @default(0) @db.TinyInt
+ ruleconfig String? @db.LongText
+ scaleid BigInt?
+ scaleconfiguration String? @db.LongText
+ timecreated BigInt
+ timemodified BigInt
+ usermodified BigInt?
+
+ @@unique([competencyframeworkid, idnumber], map: "mdl_comp_comidn_uix")
+ @@index([ruleoutcome], map: "mdl_comp_rul_ix")
+ @@index([scaleid], map: "mdl_comp_sca_ix")
+ @@index([usermodified], map: "mdl_comp_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_competency_coursecomp {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ competencyid BigInt
+ ruleoutcome Int @db.TinyInt
+ timecreated BigInt
+ timemodified BigInt
+ usermodified BigInt
+ sortorder BigInt
+
+ @@unique([courseid, competencyid], map: "mdl_compcour_coucom_uix")
+ @@index([competencyid], map: "mdl_compcour_com_ix")
+ @@index([courseid], map: "mdl_compcour_cou2_ix")
+ @@index([courseid, ruleoutcome], map: "mdl_compcour_courul_ix")
+ @@index([usermodified], map: "mdl_compcour_use2_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_competency_coursecompsetting {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt @unique(map: "mdl_compcour_cou_uix")
+ pushratingstouserplans Int? @db.TinyInt
+ timecreated BigInt
+ timemodified BigInt
+ usermodified BigInt?
+
+ @@index([usermodified], map: "mdl_compcour_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_competency_evidence {
+ id BigInt @id @default(autoincrement())
+ usercompetencyid BigInt
+ contextid BigInt
+ action Int @db.TinyInt
+ actionuserid BigInt?
+ descidentifier String @default("") @db.VarChar(255)
+ desccomponent String @default("") @db.VarChar(255)
+ desca String? @db.LongText
+ url String? @db.VarChar(255)
+ grade BigInt?
+ note String? @db.LongText
+ timecreated BigInt
+ timemodified BigInt
+ usermodified BigInt
+
+ @@index([actionuserid], map: "mdl_compevid_act_ix")
+ @@index([contextid], map: "mdl_compevid_con_ix")
+ @@index([usermodified], map: "mdl_compevid_use2_ix")
+ @@index([usercompetencyid], map: "mdl_compevid_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_competency_framework {
+ id BigInt @id @default(autoincrement())
+ shortname String? @db.VarChar(100)
+ contextid BigInt
+ idnumber String? @unique(map: "mdl_compfram_idn_uix") @db.VarChar(100)
+ description String? @db.LongText
+ descriptionformat Int @default(0) @db.SmallInt
+ scaleid BigInt?
+ scaleconfiguration String @db.LongText
+ visible Int @default(1) @db.TinyInt
+ taxonomies String @default("") @db.VarChar(255)
+ timecreated BigInt
+ timemodified BigInt
+ usermodified BigInt?
+
+ @@index([contextid], map: "mdl_compfram_con_ix")
+ @@index([scaleid], map: "mdl_compfram_sca_ix")
+ @@index([usermodified], map: "mdl_compfram_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_competency_modulecomp {
+ id BigInt @id @default(autoincrement())
+ cmid BigInt
+ timecreated BigInt
+ timemodified BigInt
+ usermodified BigInt
+ sortorder BigInt
+ competencyid BigInt
+ ruleoutcome Int @db.TinyInt
+ overridegrade Boolean @default(false)
+
+ @@unique([cmid, competencyid], map: "mdl_compmodu_cmicom_uix")
+ @@index([cmid], map: "mdl_compmodu_cmi_ix")
+ @@index([cmid, ruleoutcome], map: "mdl_compmodu_cmirul_ix")
+ @@index([competencyid], map: "mdl_compmodu_com_ix")
+ @@index([usermodified], map: "mdl_compmodu_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_competency_plan {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(100)
+ description String? @db.LongText
+ descriptionformat Int @default(0) @db.SmallInt
+ userid BigInt
+ templateid BigInt?
+ origtemplateid BigInt?
+ status Boolean
+ duedate BigInt? @default(0)
+ reviewerid BigInt?
+ timecreated BigInt
+ timemodified BigInt @default(0)
+ usermodified BigInt
+
+ @@index([status, duedate], map: "mdl_compplan_stadue_ix")
+ @@index([templateid], map: "mdl_compplan_tem_ix")
+ @@index([usermodified], map: "mdl_compplan_use_ix")
+ @@index([userid, status], map: "mdl_compplan_usesta_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_competency_plancomp {
+ id BigInt @id @default(autoincrement())
+ planid BigInt
+ competencyid BigInt
+ sortorder BigInt?
+ timecreated BigInt
+ timemodified BigInt?
+ usermodified BigInt
+
+ @@unique([planid, competencyid], map: "mdl_compplan_placom_uix")
+ @@index([usermodified], map: "mdl_compplan_use2_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_competency_relatedcomp {
+ id BigInt @id @default(autoincrement())
+ competencyid BigInt
+ relatedcompetencyid BigInt
+ timecreated BigInt
+ timemodified BigInt?
+ usermodified BigInt
+
+ @@index([competencyid], map: "mdl_comprela_com_ix")
+ @@index([relatedcompetencyid], map: "mdl_comprela_rel_ix")
+ @@index([usermodified], map: "mdl_comprela_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_competency_template {
+ id BigInt @id @default(autoincrement())
+ shortname String? @db.VarChar(100)
+ contextid BigInt
+ description String? @db.LongText
+ descriptionformat Int @default(0) @db.SmallInt
+ visible Int @default(1) @db.TinyInt
+ duedate BigInt?
+ timecreated BigInt
+ timemodified BigInt
+ usermodified BigInt?
+
+ @@index([contextid], map: "mdl_comptemp_con_ix")
+ @@index([usermodified], map: "mdl_comptemp_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_competency_templatecohort {
+ id BigInt @id @default(autoincrement())
+ templateid BigInt
+ cohortid BigInt
+ timecreated BigInt
+ timemodified BigInt
+ usermodified BigInt
+
+ @@unique([templateid, cohortid], map: "mdl_comptemp_temcoh_uix")
+ @@index([templateid], map: "mdl_comptemp_tem2_ix")
+ @@index([usermodified], map: "mdl_comptemp_use3_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_competency_templatecomp {
+ id BigInt @id @default(autoincrement())
+ templateid BigInt
+ competencyid BigInt
+ timecreated BigInt
+ timemodified BigInt
+ usermodified BigInt
+ sortorder BigInt?
+
+ @@index([competencyid], map: "mdl_comptemp_com_ix")
+ @@index([templateid], map: "mdl_comptemp_tem_ix")
+ @@index([usermodified], map: "mdl_comptemp_use2_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_competency_usercomp {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ competencyid BigInt
+ status Int @default(0) @db.TinyInt
+ reviewerid BigInt?
+ proficiency Int? @db.TinyInt
+ grade BigInt?
+ timecreated BigInt
+ timemodified BigInt?
+ usermodified BigInt
+
+ @@unique([userid, competencyid], map: "mdl_compuser_usecom_uix")
+ @@index([usermodified], map: "mdl_compuser_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_competency_usercompcourse {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ courseid BigInt
+ competencyid BigInt
+ proficiency Int? @db.TinyInt
+ grade BigInt?
+ timecreated BigInt
+ timemodified BigInt?
+ usermodified BigInt
+
+ @@unique([userid, courseid, competencyid], map: "mdl_compuser_usecoucom_uix")
+ @@index([usermodified], map: "mdl_compuser_use2_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_competency_usercompplan {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ competencyid BigInt
+ planid BigInt
+ proficiency Int? @db.TinyInt
+ grade BigInt?
+ sortorder BigInt?
+ timecreated BigInt
+ timemodified BigInt?
+ usermodified BigInt
+
+ @@unique([userid, competencyid, planid], map: "mdl_compuser_usecompla_uix")
+ @@index([usermodified], map: "mdl_compuser_use3_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_competency_userevidence {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ name String @default("") @db.VarChar(100)
+ description String @db.LongText
+ descriptionformat Boolean
+ url String @db.LongText
+ timecreated BigInt
+ timemodified BigInt
+ usermodified BigInt
+
+ @@index([userid], map: "mdl_compuser_use4_ix")
+ @@index([usermodified], map: "mdl_compuser_use5_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_competency_userevidencecomp {
+ id BigInt @id @default(autoincrement())
+ userevidenceid BigInt
+ competencyid BigInt
+ timecreated BigInt
+ timemodified BigInt
+ usermodified BigInt
+
+ @@unique([userevidenceid, competencyid], map: "mdl_compuser_usecom2_uix")
+ @@index([userevidenceid], map: "mdl_compuser_use6_ix")
+ @@index([usermodified], map: "mdl_compuser_use7_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_config {
+ id BigInt @id @default(autoincrement())
+ name String @unique(map: "mdl_conf_nam_uix") @default("") @db.VarChar(255)
+ value String @db.LongText
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_config_log {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ timemodified BigInt
+ plugin String? @db.VarChar(100)
+ name String @default("") @db.VarChar(100)
+ value String? @db.LongText
+ oldvalue String? @db.LongText
+
+ @@index([timemodified], map: "mdl_conflog_tim_ix")
+ @@index([userid], map: "mdl_conflog_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_config_plugins {
+ id BigInt @id @default(autoincrement())
+ plugin String @default("core") @db.VarChar(100)
+ name String @default("") @db.VarChar(100)
+ value String @db.LongText
+
+ @@unique([plugin, name], map: "mdl_confplug_plunam_uix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_contentbank_content {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(255)
+ contenttype String @default("") @db.VarChar(100)
+ contextid BigInt
+ visibility Boolean @default(true)
+ instanceid BigInt?
+ configdata String? @db.LongText
+ usercreated BigInt
+ usermodified BigInt?
+ timecreated BigInt @default(0)
+ timemodified BigInt? @default(0)
+
+ @@index([contextid], map: "mdl_contcont_con_ix")
+ @@index([contextid, contenttype, instanceid], map: "mdl_contcont_conconins_ix")
+ @@index([name], map: "mdl_contcont_nam_ix")
+ @@index([usercreated], map: "mdl_contcont_use2_ix")
+ @@index([usermodified], map: "mdl_contcont_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_context {
+ id BigInt @id @default(autoincrement())
+ contextlevel BigInt @default(0)
+ instanceid BigInt @default(0)
+ path String? @db.VarChar(255)
+ depth Int @default(0) @db.TinyInt
+ locked Int @default(0) @db.TinyInt
+
+ @@unique([contextlevel, instanceid], map: "mdl_cont_conins_uix")
+ @@index([instanceid], map: "mdl_cont_ins_ix")
+ @@index([path], map: "mdl_cont_pat_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_context_temp {
+ id BigInt @id
+ path String @default("") @db.VarChar(255)
+ depth Int @db.TinyInt
+ locked Int @default(0) @db.TinyInt
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_course {
+ id BigInt @id @default(autoincrement())
+ category BigInt @default(0)
+ sortorder BigInt @default(0)
+ fullname String @default("") @db.VarChar(254)
+ shortname String @default("") @db.VarChar(255)
+ idnumber String @default("") @db.VarChar(100)
+ summary String? @db.LongText
+ summaryformat Int @default(0) @db.TinyInt
+ format String @default("topics") @db.VarChar(21)
+ showgrades Int @default(1) @db.TinyInt
+ newsitems Int @default(1) @db.MediumInt
+ startdate BigInt @default(0)
+ enddate BigInt @default(0)
+ relativedatesmode Boolean @default(false)
+ marker BigInt @default(0)
+ maxbytes BigInt @default(0)
+ legacyfiles Int @default(0) @db.SmallInt
+ showreports Int @default(0) @db.SmallInt
+ visible Boolean @default(true)
+ visibleold Boolean @default(true)
+ downloadcontent Boolean?
+ groupmode Int @default(0) @db.SmallInt
+ groupmodeforce Int @default(0) @db.SmallInt
+ defaultgroupingid BigInt @default(0)
+ lang String @default("") @db.VarChar(30)
+ calendartype String @default("") @db.VarChar(30)
+ theme String @default("") @db.VarChar(50)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ requested Boolean @default(false)
+ enablecompletion Boolean @default(false)
+ completionnotify Boolean @default(false)
+ cacherev BigInt @default(0)
+ originalcourseid BigInt?
+ showactivitydates Boolean @default(false)
+ showcompletionconditions Boolean?
+
+ enrolments mdl_enrol[]
+ completions mdl_course_completions[]
+
+ @@index([category], map: "mdl_cour_cat_ix")
+ @@index([idnumber], map: "mdl_cour_idn_ix")
+ @@index([originalcourseid], map: "mdl_cour_ori_ix")
+ @@index([shortname], map: "mdl_cour_sho_ix")
+ @@index([sortorder], map: "mdl_cour_sor_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_course_categories {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(255)
+ idnumber String? @db.VarChar(100)
+ description String? @db.LongText
+ descriptionformat Int @default(0) @db.TinyInt
+ parent BigInt @default(0)
+ sortorder BigInt @default(0)
+ coursecount BigInt @default(0)
+ visible Boolean @default(true)
+ visibleold Boolean @default(true)
+ timemodified BigInt @default(0)
+ depth BigInt @default(0)
+ path String @default("") @db.VarChar(255)
+ theme String? @db.VarChar(50)
+
+ @@index([parent], map: "mdl_courcate_par_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_course_completion_aggr_methd {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ criteriatype BigInt?
+ method Boolean @default(false)
+ value Decimal? @db.Decimal(10, 5)
+
+ @@unique([course, criteriatype], map: "mdl_courcompaggrmeth_coucr_uix")
+ @@index([course], map: "mdl_courcompaggrmeth_cou_ix")
+ @@index([criteriatype], map: "mdl_courcompaggrmeth_cri_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_course_completion_crit_compl {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ course BigInt @default(0)
+ criteriaid BigInt @default(0)
+ gradefinal Decimal? @db.Decimal(10, 5)
+ unenroled BigInt?
+ timecompleted BigInt?
+
+ @@unique([userid, course, criteriaid], map: "mdl_courcompcritcomp_useco_uix")
+ @@index([course], map: "mdl_courcompcritcomp_cou_ix")
+ @@index([criteriaid], map: "mdl_courcompcritcomp_cri_ix")
+ @@index([timecompleted], map: "mdl_courcompcritcomp_tim_ix")
+ @@index([userid], map: "mdl_courcompcritcomp_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_course_completion_criteria {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ criteriatype BigInt @default(0)
+ module String? @db.VarChar(100)
+ moduleinstance BigInt?
+ courseinstance BigInt?
+ enrolperiod BigInt?
+ timeend BigInt?
+ gradepass Decimal? @db.Decimal(10, 5)
+ role BigInt?
+
+ @@index([course], map: "mdl_courcompcrit_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_course_completion_defaults {
+ id BigInt @id @default(autoincrement())
+ course BigInt
+ module BigInt
+ completion Boolean @default(false)
+ completionview Boolean @default(false)
+ completionusegrade Boolean @default(false)
+ completionpassgrade Boolean @default(false)
+ completionexpected BigInt @default(0)
+ customrules String? @db.LongText
+
+ @@unique([course, module], map: "mdl_courcompdefa_coumod_uix")
+ @@index([course], map: "mdl_courcompdefa_cou_ix")
+ @@index([module], map: "mdl_courcompdefa_mod_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_course_completions {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ course BigInt @default(0)
+ timeenrolled BigInt @default(0)
+ timestarted BigInt @default(0)
+ timecompleted BigInt?
+ reaggregate BigInt @default(0)
+
+ // Relate this to the mdl_courses tables based on course
+ courseId mdl_course @relation(fields: [course], references: [id])
+
+ @@unique([userid, course], map: "mdl_courcomp_usecou_uix")
+ @@index([course], map: "mdl_courcomp_cou_ix")
+ @@index([timecompleted], map: "mdl_courcomp_tim_ix")
+ @@index([userid], map: "mdl_courcomp_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_course_format_options {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ format String @default("") @db.VarChar(21)
+ sectionid BigInt @default(0)
+ name String @default("") @db.VarChar(100)
+ value String? @db.LongText
+
+ @@unique([courseid, format, sectionid, name], map: "mdl_courformopti_couforsec_uix")
+ @@index([courseid], map: "mdl_courformopti_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_course_modules {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ module BigInt @default(0)
+ instance BigInt @default(0)
+ section BigInt @default(0)
+ idnumber String? @db.VarChar(100)
+ added BigInt @default(0)
+ score Int @default(0) @db.SmallInt
+ indent Int @default(0) @db.MediumInt
+ visible Boolean @default(true)
+ visibleoncoursepage Boolean @default(true)
+ visibleold Boolean @default(true)
+ groupmode Int @default(0) @db.SmallInt
+ groupingid BigInt @default(0)
+ completion Boolean @default(false)
+ completiongradeitemnumber BigInt?
+ completionview Boolean @default(false)
+ completionexpected BigInt @default(0)
+ completionpassgrade Boolean @default(false)
+ showdescription Boolean @default(false)
+ availability String? @db.LongText
+ deletioninprogress Boolean @default(false)
+ downloadcontent Boolean? @default(true)
+ lang String? @db.VarChar(30)
+
+ @@index([course], map: "mdl_courmodu_cou_ix")
+ @@index([groupingid], map: "mdl_courmodu_gro_ix")
+ @@index([idnumber, course], map: "mdl_courmodu_idncou_ix")
+ @@index([instance], map: "mdl_courmodu_ins_ix")
+ @@index([module], map: "mdl_courmodu_mod_ix")
+ @@index([visible], map: "mdl_courmodu_vis_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_course_modules_completion {
+ id BigInt @id @default(autoincrement())
+ coursemoduleid BigInt
+ userid BigInt
+ completionstate Boolean
+ overrideby BigInt?
+ timemodified BigInt
+
+ @@unique([userid, coursemoduleid], map: "mdl_courmoducomp_usecou_uix")
+ @@index([coursemoduleid], map: "mdl_courmoducomp_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_course_modules_viewed {
+ id BigInt @id @default(autoincrement())
+ coursemoduleid BigInt
+ userid BigInt
+ timecreated BigInt
+
+ @@unique([userid, coursemoduleid], map: "mdl_courmoduview_usecou_uix")
+ @@index([coursemoduleid], map: "mdl_courmoduview_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_course_published {
+ id BigInt @id @default(autoincrement())
+ huburl String? @db.VarChar(255)
+ courseid BigInt
+ timepublished BigInt
+ enrollable Boolean @default(true)
+ hubcourseid BigInt
+ status Boolean? @default(false)
+ timechecked BigInt?
+
+ @@index([courseid], map: "mdl_courpubl_cou_ix")
+ @@index([hubcourseid], map: "mdl_courpubl_hub_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_course_request {
+ id BigInt @id @default(autoincrement())
+ fullname String @default("") @db.VarChar(254)
+ shortname String @default("") @db.VarChar(100)
+ summary String @db.LongText
+ summaryformat Int @default(0) @db.TinyInt
+ category BigInt @default(0)
+ reason String @db.LongText
+ requester BigInt @default(0)
+ password String @default("") @db.VarChar(50)
+
+ @@index([shortname], map: "mdl_courrequ_sho_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_course_sections {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ section BigInt @default(0)
+ name String? @db.VarChar(255)
+ summary String? @db.LongText
+ summaryformat Int @default(0) @db.TinyInt
+ sequence String? @db.LongText
+ visible Boolean @default(true)
+ availability String? @db.LongText
+ timemodified BigInt @default(0)
+
+ @@unique([course, section], map: "mdl_coursect_cousec_uix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_customcert {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ templateid BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String? @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ requiredtime BigInt @default(0)
+ verifyany BigInt @default(0)
+ deliveryoption String? @db.VarChar(255)
+ emailstudents Boolean @default(false)
+ emailteachers Boolean @default(false)
+ emailothers String? @db.LongText
+ protection String @default("") @db.VarChar(255)
+ language String? @db.VarChar(20)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([templateid], map: "mdl_cust_tem_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_customcert_elements {
+ id BigInt @id @default(autoincrement())
+ pageid BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ element String @default("") @db.VarChar(255)
+ data String? @db.LongText
+ font String? @db.VarChar(255)
+ fontsize BigInt?
+ colour String? @db.VarChar(50)
+ posx BigInt?
+ posy BigInt?
+ width BigInt?
+ refpoint Int? @db.SmallInt
+ alignment String @default("L") @db.VarChar(1)
+ sequence BigInt?
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([pageid], map: "mdl_custelem_pag_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_customcert_issues {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ customcertid BigInt @default(0)
+ code String? @db.VarChar(40)
+ emailed Boolean @default(false)
+ timecreated BigInt @default(0)
+
+ @@index([customcertid], map: "mdl_custissu_cus_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_customcert_pages {
+ id BigInt @id @default(autoincrement())
+ templateid BigInt @default(0)
+ width BigInt @default(0)
+ height BigInt @default(0)
+ leftmargin BigInt @default(0)
+ rightmargin BigInt @default(0)
+ sequence BigInt?
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([templateid], map: "mdl_custpage_tem_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_customcert_templates {
+ id BigInt @id @default(autoincrement())
+ name String? @db.VarChar(255)
+ contextid BigInt
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([contextid], map: "mdl_custtemp_con_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_customfield_category {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(400)
+ description String? @db.LongText
+ descriptionformat BigInt?
+ sortorder BigInt?
+ timecreated BigInt
+ timemodified BigInt
+ component String @default("") @db.VarChar(100)
+ area String @default("") @db.VarChar(100)
+ itemid BigInt @default(0)
+ contextid BigInt?
+
+ @@index([component, area, itemid, sortorder], map: "mdl_custcate_comareitesor_ix")
+ @@index([contextid], map: "mdl_custcate_con_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_customfield_data {
+ id BigInt @id @default(autoincrement())
+ fieldid BigInt
+ instanceid BigInt
+ intvalue BigInt?
+ decvalue Decimal? @db.Decimal(10, 5)
+ shortcharvalue String? @db.VarChar(255)
+ charvalue String? @db.VarChar(1333)
+ value String @db.LongText
+ valueformat BigInt
+ timecreated BigInt
+ timemodified BigInt
+ contextid BigInt?
+
+ @@unique([instanceid, fieldid], map: "mdl_custdata_insfie_uix")
+ @@index([contextid], map: "mdl_custdata_con_ix")
+ @@index([fieldid], map: "mdl_custdata_fie_ix")
+ @@index([fieldid, decvalue], map: "mdl_custdata_fiedec_ix")
+ @@index([fieldid, intvalue], map: "mdl_custdata_fieint_ix")
+ @@index([fieldid, shortcharvalue], map: "mdl_custdata_fiesho_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_customfield_field {
+ id BigInt @id @default(autoincrement())
+ shortname String @default("") @db.VarChar(100)
+ name String @default("") @db.VarChar(400)
+ type String @default("") @db.VarChar(100)
+ description String? @db.LongText
+ descriptionformat BigInt?
+ sortorder BigInt?
+ categoryid BigInt?
+ configdata String? @db.LongText
+ timecreated BigInt
+ timemodified BigInt
+
+ @@index([categoryid], map: "mdl_custfiel_cat_ix")
+ @@index([categoryid, sortorder], map: "mdl_custfiel_catsor_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_data {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ comments Int @default(0) @db.SmallInt
+ timeavailablefrom BigInt @default(0)
+ timeavailableto BigInt @default(0)
+ timeviewfrom BigInt @default(0)
+ timeviewto BigInt @default(0)
+ requiredentries Int @default(0)
+ requiredentriestoview Int @default(0)
+ maxentries Int @default(0)
+ rssarticles Int @default(0) @db.SmallInt
+ singletemplate String? @db.LongText
+ listtemplate String? @db.LongText
+ listtemplateheader String? @db.LongText
+ listtemplatefooter String? @db.LongText
+ addtemplate String? @db.LongText
+ rsstemplate String? @db.LongText
+ rsstitletemplate String? @db.LongText
+ csstemplate String? @db.LongText
+ jstemplate String? @db.LongText
+ asearchtemplate String? @db.LongText
+ approval Int @default(0) @db.SmallInt
+ manageapproved Int @default(1) @db.SmallInt
+ scale BigInt @default(0)
+ assessed BigInt @default(0)
+ assesstimestart BigInt @default(0)
+ assesstimefinish BigInt @default(0)
+ defaultsort BigInt @default(0)
+ defaultsortdir Int @default(0) @db.SmallInt
+ editany Int @default(0) @db.SmallInt
+ notification BigInt @default(0)
+ timemodified BigInt @default(0)
+ config String? @db.LongText
+ completionentries BigInt? @default(0)
+
+ @@index([course], map: "mdl_data_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_data_content {
+ id BigInt @id @default(autoincrement())
+ fieldid BigInt @default(0)
+ recordid BigInt @default(0)
+ content String? @db.LongText
+ content1 String? @db.LongText
+ content2 String? @db.LongText
+ content3 String? @db.LongText
+ content4 String? @db.LongText
+
+ @@index([fieldid], map: "mdl_datacont_fie_ix")
+ @@index([recordid], map: "mdl_datacont_rec_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_data_fields {
+ id BigInt @id @default(autoincrement())
+ dataid BigInt @default(0)
+ type String @default("") @db.VarChar(255)
+ name String @default("") @db.VarChar(255)
+ description String @db.LongText
+ required Boolean @default(false)
+ param1 String? @db.LongText
+ param2 String? @db.LongText
+ param3 String? @db.LongText
+ param4 String? @db.LongText
+ param5 String? @db.LongText
+ param6 String? @db.LongText
+ param7 String? @db.LongText
+ param8 String? @db.LongText
+ param9 String? @db.LongText
+ param10 String? @db.LongText
+
+ @@index([dataid], map: "mdl_datafiel_dat_ix")
+ @@index([type, dataid], map: "mdl_datafiel_typdat_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_data_records {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ groupid BigInt @default(0)
+ dataid BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ approved Int @default(0) @db.SmallInt
+
+ @@index([dataid], map: "mdl_datareco_dat_ix")
+ @@index([userid], map: "mdl_datareco_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_editor_atto_autosave {
+ id BigInt @id @default(autoincrement())
+ elementid String @default("") @db.VarChar(255)
+ contextid BigInt
+ pagehash String @default("") @db.VarChar(64)
+ userid BigInt
+ drafttext String @db.LongText
+ draftid BigInt?
+ pageinstance String @default("") @db.VarChar(64)
+ timemodified BigInt @default(0)
+
+ @@unique([elementid, contextid, userid, pagehash], map: "mdl_editattoauto_eleconuse_uix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol {
+ id BigInt @id @default(autoincrement())
+ enrol String @default("") @db.VarChar(20)
+ status BigInt @default(0)
+ courseid BigInt
+ sortorder BigInt @default(0)
+ name String? @db.VarChar(255)
+ enrolperiod BigInt? @default(0)
+ enrolstartdate BigInt? @default(0)
+ enrolenddate BigInt? @default(0)
+ expirynotify Boolean? @default(false)
+ expirythreshold BigInt? @default(0)
+ notifyall Boolean? @default(false)
+ password String? @db.VarChar(50)
+ cost String? @db.VarChar(20)
+ currency String? @db.VarChar(3)
+ roleid BigInt? @default(0)
+ customint1 BigInt?
+ customint2 BigInt?
+ customint3 BigInt?
+ customint4 BigInt?
+ customint5 BigInt?
+ customint6 BigInt?
+ customint7 BigInt?
+ customint8 BigInt?
+ customchar1 String? @db.VarChar(255)
+ customchar2 String? @db.VarChar(255)
+ customchar3 String? @db.VarChar(1333)
+ customdec1 Decimal? @db.Decimal(12, 7)
+ customdec2 Decimal? @db.Decimal(12, 7)
+ customtext1 String? @db.LongText
+ customtext2 String? @db.LongText
+ customtext3 String? @db.LongText
+ customtext4 String? @db.LongText
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ course mdl_course @relation(fields: [courseid], references: [id])
+ mdl_user_enrolments mdl_user_enrolments[]
+
+ @@index([courseid], map: "mdl_enro_cou_ix")
+ @@index([enrol], map: "mdl_enro_enr_ix")
+ @@index([roleid], map: "mdl_enro_rol_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol_flatfile {
+ id BigInt @id @default(autoincrement())
+ action String @default("") @db.VarChar(30)
+ roleid BigInt
+ userid BigInt
+ courseid BigInt
+ timestart BigInt @default(0)
+ timeend BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([courseid], map: "mdl_enroflat_cou_ix")
+ @@index([roleid], map: "mdl_enroflat_rol_ix")
+ @@index([userid], map: "mdl_enroflat_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol_lti_app_registration {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(255)
+ platformid String? @db.LongText
+ clientid String? @db.VarChar(1333)
+ uniqueid String @unique(map: "mdl_enroltiappregi_uni_uix") @default("") @db.VarChar(255)
+ platformclienthash String? @unique(map: "mdl_enroltiappregi_pla_uix") @db.VarChar(64)
+ platformuniqueidhash String? @unique(map: "mdl_enroltiappregi_pla2_uix") @db.VarChar(64)
+ authenticationrequesturl String? @db.LongText
+ jwksurl String? @db.LongText
+ accesstokenurl String? @db.LongText
+ status Boolean @default(false)
+ timecreated BigInt
+ timemodified BigInt
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol_lti_context {
+ id BigInt @id @default(autoincrement())
+ contextid String @default("") @db.VarChar(255)
+ ltideploymentid BigInt
+ type String? @db.LongText
+ timecreated BigInt
+ timemodified BigInt
+
+ @@unique([ltideploymentid, contextid], map: "mdl_enrolticont_lticon_uix")
+ @@index([ltideploymentid], map: "mdl_enrolticont_lti_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol_lti_deployment {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(255)
+ deploymentid String @default("") @db.VarChar(255)
+ platformid BigInt
+ legacyconsumerkey String? @db.VarChar(255)
+ timecreated BigInt
+ timemodified BigInt
+
+ @@unique([platformid, deploymentid], map: "mdl_enroltidepl_pladep_uix")
+ @@index([platformid], map: "mdl_enroltidepl_pla_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol_lti_lti2_consumer {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(50)
+ consumerkey256 String @unique(map: "mdl_enroltilti2cons_con_uix") @default("") @db.VarChar(255)
+ consumerkey String? @db.LongText
+ secret String @default("") @db.VarChar(1024)
+ ltiversion String? @db.VarChar(10)
+ consumername String? @db.VarChar(255)
+ consumerversion String? @db.VarChar(255)
+ consumerguid String? @db.VarChar(1024)
+ profile String? @db.LongText
+ toolproxy String? @db.LongText
+ settings String? @db.LongText
+ protected Boolean
+ enabled Boolean
+ enablefrom BigInt?
+ enableuntil BigInt?
+ lastaccess BigInt?
+ created BigInt
+ updated BigInt
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol_lti_lti2_context {
+ id BigInt @id @default(autoincrement())
+ consumerid BigInt
+ lticontextkey String @default("") @db.VarChar(255)
+ type String? @db.VarChar(100)
+ settings String? @db.LongText
+ created BigInt
+ updated BigInt
+
+ @@index([consumerid], map: "mdl_enroltilti2cont_con_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol_lti_lti2_nonce {
+ id BigInt @id @default(autoincrement())
+ consumerid BigInt
+ value String @default("") @db.VarChar(64)
+ expires BigInt
+
+ @@index([consumerid], map: "mdl_enroltilti2nonc_con_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol_lti_lti2_resource_link {
+ id BigInt @id @default(autoincrement())
+ contextid BigInt?
+ consumerid BigInt?
+ ltiresourcelinkkey String @default("") @db.VarChar(255)
+ settings String? @db.LongText
+ primaryresourcelinkid BigInt?
+ shareapproved Boolean?
+ created BigInt
+ updated BigInt
+
+ @@index([consumerid], map: "mdl_enroltilti2resolink_co2_ix")
+ @@index([contextid], map: "mdl_enroltilti2resolink_con_ix")
+ @@index([primaryresourcelinkid], map: "mdl_enroltilti2resolink_pri_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol_lti_lti2_share_key {
+ id BigInt @id @default(autoincrement())
+ sharekey String @unique(map: "mdl_enroltilti2sharkey_sha_uix") @default("") @db.VarChar(32)
+ resourcelinkid BigInt @unique(map: "mdl_enroltilti2sharkey_res_uix")
+ autoapprove Boolean
+ expires BigInt
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol_lti_lti2_tool_proxy {
+ id BigInt @id @default(autoincrement())
+ toolproxykey String @unique(map: "mdl_enroltilti2toolprox_to_uix") @default("") @db.VarChar(32)
+ consumerid BigInt
+ toolproxy String @db.LongText
+ created BigInt
+ updated BigInt
+
+ @@index([consumerid], map: "mdl_enroltilti2toolprox_con_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol_lti_lti2_user_result {
+ id BigInt @id @default(autoincrement())
+ resourcelinkid BigInt
+ ltiuserkey String @default("") @db.VarChar(255)
+ ltiresultsourcedid String @default("") @db.VarChar(1024)
+ created BigInt
+ updated BigInt
+
+ @@index([resourcelinkid], map: "mdl_enroltilti2userresu_res_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol_lti_resource_link {
+ id BigInt @id @default(autoincrement())
+ resourcelinkid String @default("") @db.VarChar(255)
+ ltideploymentid BigInt
+ resourceid BigInt
+ lticontextid BigInt?
+ lineitemsservice String? @db.VarChar(1333)
+ lineitemservice String? @db.VarChar(1333)
+ lineitemscope String? @db.VarChar(255)
+ resultscope String? @db.VarChar(255)
+ scorescope String? @db.VarChar(255)
+ contextmembershipsurl String? @db.VarChar(1333)
+ nrpsserviceversions String? @db.VarChar(255)
+ timecreated BigInt
+ timemodified BigInt
+
+ @@unique([resourcelinkid, ltideploymentid], map: "mdl_enroltiresolink_reslti_uix")
+ @@index([lticontextid], map: "mdl_enroltiresolink_lti2_ix")
+ @@index([ltideploymentid], map: "mdl_enroltiresolink_lti_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol_lti_tool_consumer_map {
+ id BigInt @id @default(autoincrement())
+ toolid BigInt
+ consumerid BigInt
+
+ @@index([consumerid], map: "mdl_enroltitoolconsmap_con_ix")
+ @@index([toolid], map: "mdl_enroltitoolconsmap_too_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol_lti_tools {
+ id BigInt @id @default(autoincrement())
+ enrolid BigInt
+ contextid BigInt
+ ltiversion String @default("LTI-1p3") @db.VarChar(15)
+ institution String @default("") @db.VarChar(40)
+ lang String @default("en") @db.VarChar(30)
+ timezone String @default("99") @db.VarChar(100)
+ maxenrolled BigInt @default(0)
+ maildisplay Int @default(2) @db.TinyInt
+ city String @default("") @db.VarChar(120)
+ country String @default("") @db.VarChar(2)
+ gradesync Boolean @default(false)
+ gradesynccompletion Boolean @default(false)
+ membersync Boolean @default(false)
+ membersyncmode Boolean @default(false)
+ roleinstructor BigInt
+ rolelearner BigInt
+ secret String? @db.LongText
+ uuid String? @unique(map: "mdl_enroltitool_uui_uix") @db.VarChar(36)
+ provisioningmodelearner Int? @db.TinyInt
+ provisioningmodeinstructor Int? @db.TinyInt
+ timecreated BigInt
+ timemodified BigInt
+
+ @@index([contextid], map: "mdl_enroltitool_con_ix")
+ @@index([enrolid], map: "mdl_enroltitool_enr_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol_lti_user_resource_link {
+ id BigInt @id @default(autoincrement())
+ ltiuserid BigInt
+ resourcelinkid BigInt
+
+ @@unique([ltiuserid, resourcelinkid], map: "mdl_enroltiuserresolink_lt_uix")
+ @@index([ltiuserid], map: "mdl_enroltiuserresolink_lti_ix")
+ @@index([resourcelinkid], map: "mdl_enroltiuserresolink_res_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol_lti_users {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ toolid BigInt
+ serviceurl String? @db.LongText
+ sourceid String? @db.LongText
+ ltideploymentid BigInt?
+ consumerkey String? @db.LongText
+ consumersecret String? @db.LongText
+ membershipsurl String? @db.LongText
+ membershipsid String? @db.LongText
+ lastgrade Decimal? @db.Decimal(10, 5)
+ lastaccess BigInt?
+ timecreated BigInt?
+
+ @@index([ltideploymentid], map: "mdl_enroltiuser_lti_ix")
+ @@index([toolid], map: "mdl_enroltiuser_too_ix")
+ @@index([userid], map: "mdl_enroltiuser_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_enrol_paypal {
+ id BigInt @id @default(autoincrement())
+ business String @default("") @db.VarChar(255)
+ receiver_email String @default("") @db.VarChar(255)
+ receiver_id String @default("") @db.VarChar(255)
+ item_name String @default("") @db.VarChar(255)
+ courseid BigInt @default(0)
+ userid BigInt @default(0)
+ instanceid BigInt @default(0)
+ memo String @default("") @db.VarChar(255)
+ tax String @default("") @db.VarChar(255)
+ option_name1 String @default("") @db.VarChar(255)
+ option_selection1_x String @default("") @db.VarChar(255)
+ option_name2 String @default("") @db.VarChar(255)
+ option_selection2_x String @default("") @db.VarChar(255)
+ payment_status String @default("") @db.VarChar(255)
+ pending_reason String @default("") @db.VarChar(255)
+ reason_code String @default("") @db.VarChar(30)
+ txn_id String @default("") @db.VarChar(255)
+ parent_txn_id String @default("") @db.VarChar(255)
+ payment_type String @default("") @db.VarChar(30)
+ timeupdated BigInt @default(0)
+
+ @@index([business], map: "mdl_enropayp_bus_ix")
+ @@index([courseid], map: "mdl_enropayp_cou_ix")
+ @@index([instanceid], map: "mdl_enropayp_ins_ix")
+ @@index([receiver_email], map: "mdl_enropayp_rec_ix")
+ @@index([userid], map: "mdl_enropayp_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_event {
+ id BigInt @id @default(autoincrement())
+ name String @db.LongText
+ description String @db.LongText
+ format Int @default(0) @db.SmallInt
+ categoryid BigInt @default(0)
+ courseid BigInt @default(0)
+ groupid BigInt @default(0)
+ userid BigInt @default(0)
+ repeatid BigInt @default(0)
+ component String? @db.VarChar(100)
+ modulename String @default("") @db.VarChar(20)
+ instance BigInt @default(0)
+ type Int @default(0) @db.SmallInt
+ eventtype String @default("") @db.VarChar(20)
+ timestart BigInt @default(0)
+ timeduration BigInt @default(0)
+ timesort BigInt?
+ visible Int @default(1) @db.SmallInt
+ uuid String @default("") @db.VarChar(255)
+ sequence BigInt @default(1)
+ timemodified BigInt @default(0)
+ subscriptionid BigInt?
+ priority BigInt?
+ location String? @db.LongText
+
+ @@index([categoryid], map: "mdl_even_cat_ix")
+ @@index([component, eventtype, instance], map: "mdl_even_comeveins_ix")
+ @@index([courseid], map: "mdl_even_cou_ix")
+ @@index([eventtype], map: "mdl_even_eve_ix")
+ @@index([groupid, courseid, categoryid, visible, userid], map: "mdl_even_grocoucatvisuse_ix")
+ @@index([modulename, instance, eventtype], map: "mdl_even_modinseve_ix")
+ @@index([subscriptionid], map: "mdl_even_sub_ix")
+ @@index([timeduration], map: "mdl_even_tim2_ix")
+ @@index([timestart], map: "mdl_even_tim_ix")
+ @@index([type, timesort], map: "mdl_even_typtim_ix")
+ @@index([userid], map: "mdl_even_use_ix")
+ @@index([uuid], map: "mdl_even_uui_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_event_subscriptions {
+ id BigInt @id @default(autoincrement())
+ url String @default("") @db.VarChar(255)
+ categoryid BigInt @default(0)
+ courseid BigInt @default(0)
+ groupid BigInt @default(0)
+ userid BigInt @default(0)
+ eventtype String @default("") @db.VarChar(20)
+ pollinterval BigInt @default(0)
+ lastupdated BigInt?
+ name String @default("") @db.VarChar(255)
+
+ @@index([courseid], map: "mdl_evensubs_cou_ix")
+ @@index([userid], map: "mdl_evensubs_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_events_handlers {
+ id BigInt @id @default(autoincrement())
+ eventname String @default("") @db.VarChar(166)
+ component String @default("") @db.VarChar(166)
+ handlerfile String @default("") @db.VarChar(255)
+ handlerfunction String? @db.LongText
+ schedule String? @db.VarChar(255)
+ status BigInt @default(0)
+ internal Int @default(1) @db.TinyInt
+
+ @@unique([eventname, component], map: "mdl_evenhand_evecom_uix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_events_queue {
+ id BigInt @id @default(autoincrement())
+ eventdata String @db.LongText
+ stackdump String? @db.LongText
+ userid BigInt?
+ timecreated BigInt
+
+ @@index([userid], map: "mdl_evenqueu_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_events_queue_handlers {
+ id BigInt @id @default(autoincrement())
+ queuedeventid BigInt
+ handlerid BigInt
+ status BigInt?
+ errormessage String? @db.LongText
+ timemodified BigInt
+
+ @@index([handlerid], map: "mdl_evenqueuhand_han_ix")
+ @@index([queuedeventid], map: "mdl_evenqueuhand_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_external_functions {
+ id BigInt @id @default(autoincrement())
+ name String @unique(map: "mdl_extefunc_nam_uix") @default("") @db.VarChar(200)
+ classname String @default("") @db.VarChar(100)
+ methodname String @default("") @db.VarChar(100)
+ classpath String? @db.VarChar(255)
+ component String @default("") @db.VarChar(100)
+ capabilities String? @db.VarChar(255)
+ services String? @db.VarChar(1333)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_external_services {
+ id BigInt @id @default(autoincrement())
+ name String @unique(map: "mdl_exteserv_nam_uix") @default("") @db.VarChar(200)
+ enabled Boolean
+ requiredcapability String? @db.VarChar(150)
+ restrictedusers Boolean
+ component String? @db.VarChar(100)
+ timecreated BigInt
+ timemodified BigInt?
+ shortname String? @db.VarChar(255)
+ downloadfiles Boolean @default(false)
+ uploadfiles Boolean @default(false)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_external_services_functions {
+ id BigInt @id @default(autoincrement())
+ externalserviceid BigInt
+ functionname String @default("") @db.VarChar(200)
+
+ @@index([externalserviceid], map: "mdl_exteservfunc_ext_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_external_services_users {
+ id BigInt @id @default(autoincrement())
+ externalserviceid BigInt
+ userid BigInt
+ iprestriction String? @db.VarChar(255)
+ validuntil BigInt?
+ timecreated BigInt?
+
+ @@index([externalserviceid], map: "mdl_exteservuser_ext_ix")
+ @@index([userid], map: "mdl_exteservuser_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_external_tokens {
+ id BigInt @id @default(autoincrement())
+ token String @default("") @db.VarChar(128)
+ privatetoken String? @db.VarChar(64)
+ tokentype Int @db.SmallInt
+ userid BigInt
+ externalserviceid BigInt
+ sid String? @db.VarChar(128)
+ contextid BigInt
+ creatorid BigInt @default(1)
+ iprestriction String? @db.VarChar(255)
+ validuntil BigInt?
+ timecreated BigInt
+ lastaccess BigInt?
+
+ @@index([contextid], map: "mdl_extetoke_con_ix")
+ @@index([creatorid], map: "mdl_extetoke_cre_ix")
+ @@index([externalserviceid], map: "mdl_extetoke_ext_ix")
+ @@index([sid], map: "mdl_extetoke_sid_ix")
+ @@index([token], map: "mdl_extetoke_tok_ix")
+ @@index([userid], map: "mdl_extetoke_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_favourite {
+ id BigInt @id @default(autoincrement())
+ component String @default("") @db.VarChar(100)
+ itemtype String @default("") @db.VarChar(100)
+ itemid BigInt
+ contextid BigInt
+ userid BigInt
+ ordering BigInt?
+ timecreated BigInt
+ timemodified BigInt
+
+ @@unique([component, itemtype, itemid, contextid, userid], map: "mdl_favo_comiteiteconuse_uix")
+ @@index([contextid], map: "mdl_favo_con_ix")
+ @@index([userid], map: "mdl_favo_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_feedback {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ anonymous Boolean @default(true)
+ email_notification Boolean @default(true)
+ multiple_submit Boolean @default(true)
+ autonumbering Boolean @default(true)
+ site_after_submit String @default("") @db.VarChar(255)
+ page_after_submit String @db.LongText
+ page_after_submitformat Int @default(0) @db.TinyInt
+ publish_stats Boolean @default(false)
+ timeopen BigInt @default(0)
+ timeclose BigInt @default(0)
+ timemodified BigInt @default(0)
+ completionsubmit Boolean @default(false)
+
+ @@index([course], map: "mdl_feed_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_feedback_completed {
+ id BigInt @id @default(autoincrement())
+ feedback BigInt @default(0)
+ userid BigInt @default(0)
+ timemodified BigInt @default(0)
+ random_response BigInt @default(0)
+ anonymous_response Boolean @default(false)
+ courseid BigInt @default(0)
+
+ @@index([courseid], map: "mdl_feedcomp_cou_ix")
+ @@index([feedback], map: "mdl_feedcomp_fee_ix")
+ @@index([userid], map: "mdl_feedcomp_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_feedback_completedtmp {
+ id BigInt @id @default(autoincrement())
+ feedback BigInt @default(0)
+ userid BigInt @default(0)
+ guestid String @default("") @db.VarChar(255)
+ timemodified BigInt @default(0)
+ random_response BigInt @default(0)
+ anonymous_response Boolean @default(false)
+ courseid BigInt @default(0)
+
+ @@index([feedback], map: "mdl_feedcomp_fee2_ix")
+ @@index([userid], map: "mdl_feedcomp_use2_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_feedback_item {
+ id BigInt @id @default(autoincrement())
+ feedback BigInt @default(0)
+ template BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ label String @default("") @db.VarChar(255)
+ presentation String @db.LongText
+ typ String @default("") @db.VarChar(255)
+ hasvalue Boolean @default(false)
+ position Int @default(0) @db.SmallInt
+ required Boolean @default(false)
+ dependitem BigInt @default(0)
+ dependvalue String @default("") @db.VarChar(255)
+ options String @default("") @db.VarChar(255)
+
+ @@index([feedback], map: "mdl_feeditem_fee_ix")
+ @@index([template], map: "mdl_feeditem_tem_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_feedback_sitecourse_map {
+ id BigInt @id @default(autoincrement())
+ feedbackid BigInt @default(0)
+ courseid BigInt @default(0)
+
+ @@index([courseid], map: "mdl_feedsitemap_cou_ix")
+ @@index([feedbackid], map: "mdl_feedsitemap_fee_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_feedback_template {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ ispublic Boolean @default(false)
+ name String @default("") @db.VarChar(255)
+
+ @@index([course], map: "mdl_feedtemp_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_feedback_value {
+ id BigInt @id @default(autoincrement())
+ course_id BigInt @default(0)
+ item BigInt @default(0)
+ completed BigInt @default(0)
+ tmp_completed BigInt @default(0)
+ value String @db.LongText
+
+ @@unique([completed, item, course_id], map: "mdl_feedvalu_comitecou_uix")
+ @@index([course_id], map: "mdl_feedvalu_cou_ix")
+ @@index([item], map: "mdl_feedvalu_ite_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_feedback_valuetmp {
+ id BigInt @id @default(autoincrement())
+ course_id BigInt @default(0)
+ item BigInt @default(0)
+ completed BigInt @default(0)
+ tmp_completed BigInt @default(0)
+ value String @db.LongText
+
+ @@unique([completed, item, course_id], map: "mdl_feedvalu_comitecou2_uix")
+ @@index([course_id], map: "mdl_feedvalu_cou2_ix")
+ @@index([item], map: "mdl_feedvalu_ite2_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_file_conversion {
+ id BigInt @id @default(autoincrement())
+ usermodified BigInt
+ timecreated BigInt
+ timemodified BigInt
+ sourcefileid BigInt
+ targetformat String @default("") @db.VarChar(100)
+ status BigInt? @default(0)
+ statusmessage String? @db.LongText
+ converter String? @db.VarChar(255)
+ destfileid BigInt?
+ data String? @db.LongText
+
+ @@index([destfileid], map: "mdl_fileconv_des_ix")
+ @@index([sourcefileid], map: "mdl_fileconv_sou_ix")
+ @@index([usermodified], map: "mdl_fileconv_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_files {
+ id BigInt @id @default(autoincrement())
+ contenthash String @default("") @db.VarChar(40)
+ pathnamehash String @unique(map: "mdl_file_pat_uix") @default("") @db.VarChar(40)
+ contextid BigInt
+ component String @default("") @db.VarChar(100)
+ filearea String @default("") @db.VarChar(50)
+ itemid BigInt
+ filepath String @default("") @db.VarChar(255)
+ filename String @default("") @db.VarChar(255)
+ userid BigInt?
+ filesize BigInt
+ mimetype String? @db.VarChar(100)
+ status BigInt @default(0)
+ source String? @db.LongText
+ author String? @db.VarChar(255)
+ license String? @db.VarChar(255)
+ timecreated BigInt
+ timemodified BigInt
+ sortorder BigInt @default(0)
+ referencefileid BigInt?
+
+ @@index([component, filearea, contextid, itemid], map: "mdl_file_comfilconite_ix")
+ @@index([contextid], map: "mdl_file_con2_ix")
+ @@index([contenthash], map: "mdl_file_con_ix")
+ @@index([filename], map: "mdl_file_fil_ix")
+ @@index([license], map: "mdl_file_lic_ix")
+ @@index([referencefileid], map: "mdl_file_ref_ix")
+ @@index([userid], map: "mdl_file_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_files_reference {
+ id BigInt @id @default(autoincrement())
+ repositoryid BigInt
+ lastsync BigInt?
+ reference String? @db.LongText
+ referencehash String @default("") @db.VarChar(40)
+
+ @@unique([referencehash, repositoryid], map: "mdl_filerefe_refrep_uix")
+ @@index([repositoryid], map: "mdl_filerefe_rep_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_filter_active {
+ id BigInt @id @default(autoincrement())
+ filter String @default("") @db.VarChar(32)
+ contextid BigInt
+ active Int @db.SmallInt
+ sortorder BigInt @default(0)
+
+ @@unique([contextid, filter], map: "mdl_filtacti_confil_uix")
+ @@index([contextid], map: "mdl_filtacti_con_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_filter_config {
+ id BigInt @id @default(autoincrement())
+ filter String @default("") @db.VarChar(32)
+ contextid BigInt
+ name String @default("") @db.VarChar(255)
+ value String? @db.LongText
+
+ @@unique([contextid, filter, name], map: "mdl_filtconf_confilnam_uix")
+ @@index([contextid], map: "mdl_filtconf_con_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_folder {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String? @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ revision BigInt @default(0)
+ timemodified BigInt @default(0)
+ display Int @default(0) @db.SmallInt
+ showexpanded Boolean @default(true)
+ showdownloadfolder Boolean @default(true)
+ forcedownload Boolean @default(true)
+
+ @@index([course], map: "mdl_fold_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_forum {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ type String @default("general") @db.VarChar(20)
+ name String @default("") @db.VarChar(255)
+ intro String @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ duedate BigInt @default(0)
+ cutoffdate BigInt @default(0)
+ assessed BigInt @default(0)
+ assesstimestart BigInt @default(0)
+ assesstimefinish BigInt @default(0)
+ scale BigInt @default(0)
+ grade_forum BigInt @default(0)
+ grade_forum_notify Int @default(0) @db.SmallInt
+ maxbytes BigInt @default(0)
+ maxattachments BigInt @default(1)
+ forcesubscribe Boolean @default(false)
+ trackingtype Int @default(1) @db.TinyInt
+ rsstype Int @default(0) @db.TinyInt
+ rssarticles Int @default(0) @db.TinyInt
+ timemodified BigInt @default(0)
+ warnafter BigInt @default(0)
+ blockafter BigInt @default(0)
+ blockperiod BigInt @default(0)
+ completiondiscussions Int @default(0)
+ completionreplies Int @default(0)
+ completionposts Int @default(0)
+ displaywordcount Boolean @default(false)
+ lockdiscussionafter BigInt @default(0)
+
+ @@index([course], map: "mdl_foru_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_forum_digests {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ forum BigInt
+ maildigest Int @default(-1) @db.TinyInt
+
+ @@unique([forum, userid, maildigest], map: "mdl_forudige_forusemai_uix")
+ @@index([forum], map: "mdl_forudige_for_ix")
+ @@index([userid], map: "mdl_forudige_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_forum_discussion_subs {
+ id BigInt @id @default(autoincrement())
+ forum BigInt
+ userid BigInt
+ discussion BigInt
+ preference BigInt @default(1)
+
+ @@unique([userid, discussion], map: "mdl_forudiscsubs_usedis_uix")
+ @@index([discussion], map: "mdl_forudiscsubs_dis_ix")
+ @@index([forum], map: "mdl_forudiscsubs_for_ix")
+ @@index([userid], map: "mdl_forudiscsubs_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_forum_discussions {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ forum BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ firstpost BigInt @default(0)
+ userid BigInt @default(0)
+ groupid BigInt @default(-1)
+ assessed Boolean @default(true)
+ timemodified BigInt @default(0)
+ usermodified BigInt @default(0)
+ timestart BigInt @default(0)
+ timeend BigInt @default(0)
+ pinned Boolean @default(false)
+ timelocked BigInt @default(0)
+
+ @@index([course], map: "mdl_forudisc_cou_ix")
+ @@index([forum], map: "mdl_forudisc_for_ix")
+ @@index([usermodified], map: "mdl_forudisc_use2_ix")
+ @@index([userid], map: "mdl_forudisc_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_forum_grades {
+ id BigInt @id @default(autoincrement())
+ forum BigInt
+ itemnumber BigInt
+ userid BigInt
+ grade Decimal? @db.Decimal(10, 5)
+ timecreated BigInt
+ timemodified BigInt
+
+ @@unique([forum, itemnumber, userid], map: "mdl_forugrad_foriteuse_uix")
+ @@index([forum], map: "mdl_forugrad_for_ix")
+ @@index([userid], map: "mdl_forugrad_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_forum_posts {
+ id BigInt @id @default(autoincrement())
+ discussion BigInt @default(0)
+ parent BigInt @default(0)
+ userid BigInt @default(0)
+ created BigInt @default(0)
+ modified BigInt @default(0)
+ mailed Int @default(0) @db.TinyInt
+ subject String @default("") @db.VarChar(255)
+ message String @db.LongText
+ messageformat Int @default(0) @db.TinyInt
+ messagetrust Int @default(0) @db.TinyInt
+ attachment String @default("") @db.VarChar(100)
+ totalscore Int @default(0) @db.SmallInt
+ mailnow BigInt @default(0)
+ deleted Boolean @default(false)
+ privatereplyto BigInt @default(0)
+ wordcount BigInt?
+ charcount BigInt?
+
+ @@index([created], map: "mdl_forupost_cre_ix")
+ @@index([discussion], map: "mdl_forupost_dis_ix")
+ @@index([mailed], map: "mdl_forupost_mai_ix")
+ @@index([parent], map: "mdl_forupost_par_ix")
+ @@index([privatereplyto], map: "mdl_forupost_pri_ix")
+ @@index([userid], map: "mdl_forupost_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_forum_queue {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ discussionid BigInt @default(0)
+ postid BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([discussionid], map: "mdl_foruqueu_dis_ix")
+ @@index([postid], map: "mdl_foruqueu_pos_ix")
+ @@index([userid], map: "mdl_foruqueu_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_forum_read {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ forumid BigInt @default(0)
+ discussionid BigInt @default(0)
+ postid BigInt @default(0)
+ firstread BigInt @default(0)
+ lastread BigInt @default(0)
+
+ @@index([discussionid, userid], map: "mdl_foruread_disuse_ix")
+ @@index([forumid, userid], map: "mdl_foruread_foruse_ix")
+ @@index([postid, userid], map: "mdl_foruread_posuse_ix")
+ @@index([userid], map: "mdl_foruread_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_forum_subscriptions {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ forum BigInt @default(0)
+
+ @@unique([userid, forum], map: "mdl_forusubs_usefor_uix")
+ @@index([forum], map: "mdl_forusubs_for_ix")
+ @@index([userid], map: "mdl_forusubs_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_forum_track_prefs {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ forumid BigInt @default(0)
+
+ @@index([userid, forumid], map: "mdl_forutracpref_usefor_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_glossary {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ allowduplicatedentries Int @default(0) @db.TinyInt
+ displayformat String @default("dictionary") @db.VarChar(50)
+ mainglossary Int @default(0) @db.TinyInt
+ showspecial Int @default(1) @db.TinyInt
+ showalphabet Int @default(1) @db.TinyInt
+ showall Int @default(1) @db.TinyInt
+ allowcomments Int @default(0) @db.TinyInt
+ allowprintview Int @default(1) @db.TinyInt
+ usedynalink Int @default(1) @db.TinyInt
+ defaultapproval Int @default(1) @db.TinyInt
+ approvaldisplayformat String @default("default") @db.VarChar(50)
+ globalglossary Int @default(0) @db.TinyInt
+ entbypage Int @default(10) @db.SmallInt
+ editalways Int @default(0) @db.TinyInt
+ rsstype Int @default(0) @db.TinyInt
+ rssarticles Int @default(0) @db.TinyInt
+ assessed BigInt @default(0)
+ assesstimestart BigInt @default(0)
+ assesstimefinish BigInt @default(0)
+ scale BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ completionentries Int @default(0)
+
+ @@index([course], map: "mdl_glos_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_glossary_alias {
+ id BigInt @id @default(autoincrement())
+ entryid BigInt @default(0)
+ alias String @default("") @db.VarChar(255)
+
+ @@index([entryid], map: "mdl_glosalia_ent_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_glossary_categories {
+ id BigInt @id @default(autoincrement())
+ glossaryid BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ usedynalink Int @default(1) @db.TinyInt
+
+ @@index([glossaryid], map: "mdl_gloscate_glo_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_glossary_entries {
+ id BigInt @id @default(autoincrement())
+ glossaryid BigInt @default(0)
+ userid BigInt @default(0)
+ concept String @default("") @db.VarChar(255)
+ definition String @db.LongText
+ definitionformat Int @default(0) @db.TinyInt
+ definitiontrust Int @default(0) @db.TinyInt
+ attachment String @default("") @db.VarChar(100)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ teacherentry Int @default(0) @db.TinyInt
+ sourceglossaryid BigInt @default(0)
+ usedynalink Int @default(1) @db.TinyInt
+ casesensitive Int @default(0) @db.TinyInt
+ fullmatch Int @default(1) @db.TinyInt
+ approved Int @default(1) @db.TinyInt
+
+ @@index([concept], map: "mdl_glosentr_con_ix")
+ @@index([glossaryid], map: "mdl_glosentr_glo_ix")
+ @@index([userid], map: "mdl_glosentr_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_glossary_entries_categories {
+ id BigInt @id @default(autoincrement())
+ categoryid BigInt @default(0)
+ entryid BigInt @default(0)
+
+ @@index([categoryid], map: "mdl_glosentrcate_cat_ix")
+ @@index([entryid], map: "mdl_glosentrcate_ent_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_glossary_formats {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(50)
+ popupformatname String @default("") @db.VarChar(50)
+ visible Int @default(1) @db.TinyInt
+ showgroup Int @default(1) @db.TinyInt
+ showtabs String? @db.VarChar(100)
+ defaultmode String @default("") @db.VarChar(50)
+ defaulthook String @default("") @db.VarChar(50)
+ sortkey String @default("") @db.VarChar(50)
+ sortorder String @default("") @db.VarChar(50)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_grade_categories {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ parent BigInt?
+ depth BigInt @default(0)
+ path String? @db.VarChar(255)
+ fullname String @default("") @db.VarChar(255)
+ aggregation BigInt @default(0)
+ keephigh BigInt @default(0)
+ droplow BigInt @default(0)
+ aggregateonlygraded Boolean @default(false)
+ aggregateoutcomes Boolean @default(false)
+ timecreated BigInt
+ timemodified BigInt
+ hidden BigInt @default(0)
+
+ @@index([courseid], map: "mdl_gradcate_cou_ix")
+ @@index([parent], map: "mdl_gradcate_par_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_grade_categories_history {
+ id BigInt @id @default(autoincrement())
+ action BigInt @default(0)
+ oldid BigInt
+ source String? @db.VarChar(255)
+ timemodified BigInt?
+ loggeduser BigInt?
+ courseid BigInt
+ parent BigInt?
+ depth BigInt @default(0)
+ path String? @db.VarChar(255)
+ fullname String @default("") @db.VarChar(255)
+ aggregation BigInt @default(0)
+ keephigh BigInt @default(0)
+ droplow BigInt @default(0)
+ aggregateonlygraded Boolean @default(false)
+ aggregateoutcomes Boolean @default(false)
+ aggregatesubcats Boolean @default(false)
+ hidden BigInt @default(0)
+
+ @@index([action], map: "mdl_gradcatehist_act_ix")
+ @@index([courseid], map: "mdl_gradcatehist_cou_ix")
+ @@index([loggeduser], map: "mdl_gradcatehist_log_ix")
+ @@index([oldid], map: "mdl_gradcatehist_old_ix")
+ @@index([parent], map: "mdl_gradcatehist_par_ix")
+ @@index([timemodified], map: "mdl_gradcatehist_tim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_grade_grades {
+ id BigInt @id @default(autoincrement())
+ itemid BigInt
+ userid BigInt
+ rawgrade Decimal? @db.Decimal(10, 5)
+ rawgrademax Decimal @default(100.00000) @db.Decimal(10, 5)
+ rawgrademin Decimal @default(0.00000) @db.Decimal(10, 5)
+ rawscaleid BigInt?
+ usermodified BigInt?
+ finalgrade Decimal? @db.Decimal(10, 5)
+ hidden BigInt @default(0)
+ locked BigInt @default(0)
+ locktime BigInt @default(0)
+ exported BigInt @default(0)
+ overridden BigInt @default(0)
+ excluded BigInt @default(0)
+ feedback String? @db.LongText
+ feedbackformat BigInt @default(0)
+ information String? @db.LongText
+ informationformat BigInt @default(0)
+ timecreated BigInt?
+ timemodified BigInt?
+ aggregationstatus String @default("unknown") @db.VarChar(10)
+ aggregationweight Decimal? @db.Decimal(10, 5)
+
+ @@unique([userid, itemid], map: "mdl_gradgrad_useite_uix")
+ @@index([itemid], map: "mdl_gradgrad_ite_ix")
+ @@index([locked, locktime], map: "mdl_gradgrad_locloc_ix")
+ @@index([rawscaleid], map: "mdl_gradgrad_raw_ix")
+ @@index([usermodified], map: "mdl_gradgrad_use2_ix")
+ @@index([userid], map: "mdl_gradgrad_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_grade_grades_history {
+ id BigInt @id @default(autoincrement())
+ action BigInt @default(0)
+ oldid BigInt
+ source String? @db.VarChar(255)
+ timemodified BigInt?
+ loggeduser BigInt?
+ itemid BigInt
+ userid BigInt
+ rawgrade Decimal? @db.Decimal(10, 5)
+ rawgrademax Decimal @default(100.00000) @db.Decimal(10, 5)
+ rawgrademin Decimal @default(0.00000) @db.Decimal(10, 5)
+ rawscaleid BigInt?
+ usermodified BigInt?
+ finalgrade Decimal? @db.Decimal(10, 5)
+ hidden BigInt @default(0)
+ locked BigInt @default(0)
+ locktime BigInt @default(0)
+ exported BigInt @default(0)
+ overridden BigInt @default(0)
+ excluded BigInt @default(0)
+ feedback String? @db.LongText
+ feedbackformat BigInt @default(0)
+ information String? @db.LongText
+ informationformat BigInt @default(0)
+
+ @@index([action], map: "mdl_gradgradhist_act_ix")
+ @@index([itemid], map: "mdl_gradgradhist_ite_ix")
+ @@index([loggeduser], map: "mdl_gradgradhist_log_ix")
+ @@index([oldid], map: "mdl_gradgradhist_old_ix")
+ @@index([rawscaleid], map: "mdl_gradgradhist_raw_ix")
+ @@index([timemodified], map: "mdl_gradgradhist_tim_ix")
+ @@index([usermodified], map: "mdl_gradgradhist_use2_ix")
+ @@index([userid], map: "mdl_gradgradhist_use_ix")
+ @@index([userid, itemid, timemodified], map: "mdl_gradgradhist_useitetim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_grade_import_newitem {
+ id BigInt @id @default(autoincrement())
+ itemname String @default("") @db.VarChar(255)
+ importcode BigInt
+ importer BigInt
+
+ @@index([importer], map: "mdl_gradimponewi_imp_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_grade_import_values {
+ id BigInt @id @default(autoincrement())
+ itemid BigInt?
+ newgradeitem BigInt?
+ userid BigInt
+ finalgrade Decimal? @db.Decimal(10, 5)
+ feedback String? @db.LongText
+ importcode BigInt
+ importer BigInt?
+ importonlyfeedback Boolean? @default(false)
+
+ @@index([importer], map: "mdl_gradimpovalu_imp_ix")
+ @@index([itemid], map: "mdl_gradimpovalu_ite_ix")
+ @@index([newgradeitem], map: "mdl_gradimpovalu_new_ix")
+ @@index([userid], map: "mdl_gradimpovalu_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_grade_items {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt?
+ categoryid BigInt?
+ itemname String? @db.VarChar(255)
+ itemtype String @default("") @db.VarChar(30)
+ itemmodule String? @db.VarChar(30)
+ iteminstance BigInt?
+ itemnumber BigInt?
+ iteminfo String? @db.LongText
+ idnumber String? @db.VarChar(255)
+ calculation String? @db.LongText
+ gradetype Int @default(1) @db.SmallInt
+ grademax Decimal @default(100.00000) @db.Decimal(10, 5)
+ grademin Decimal @default(0.00000) @db.Decimal(10, 5)
+ scaleid BigInt?
+ outcomeid BigInt?
+ gradepass Decimal @default(0.00000) @db.Decimal(10, 5)
+ multfactor Decimal @default(1.00000) @db.Decimal(10, 5)
+ plusfactor Decimal @default(0.00000) @db.Decimal(10, 5)
+ aggregationcoef Decimal @default(0.00000) @db.Decimal(10, 5)
+ aggregationcoef2 Decimal @default(0.00000) @db.Decimal(10, 5)
+ sortorder BigInt @default(0)
+ display BigInt @default(0)
+ decimals Boolean?
+ hidden BigInt @default(0)
+ locked BigInt @default(0)
+ locktime BigInt @default(0)
+ needsupdate BigInt @default(0)
+ weightoverride Boolean @default(false)
+ timecreated BigInt?
+ timemodified BigInt?
+
+ @@index([categoryid], map: "mdl_graditem_cat_ix")
+ @@index([courseid], map: "mdl_graditem_cou_ix")
+ @@index([gradetype], map: "mdl_graditem_gra_ix")
+ @@index([idnumber, courseid], map: "mdl_graditem_idncou_ix")
+ @@index([itemtype, itemmodule, iteminstance, courseid], map: "mdl_graditem_iteiteitecou_ix")
+ @@index([itemtype, needsupdate], map: "mdl_graditem_itenee_ix")
+ @@index([locked, locktime], map: "mdl_graditem_locloc_ix")
+ @@index([outcomeid], map: "mdl_graditem_out_ix")
+ @@index([scaleid], map: "mdl_graditem_sca_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_grade_items_history {
+ id BigInt @id @default(autoincrement())
+ action BigInt @default(0)
+ oldid BigInt
+ source String? @db.VarChar(255)
+ timemodified BigInt?
+ loggeduser BigInt?
+ courseid BigInt?
+ categoryid BigInt?
+ itemname String? @db.VarChar(255)
+ itemtype String @default("") @db.VarChar(30)
+ itemmodule String? @db.VarChar(30)
+ iteminstance BigInt?
+ itemnumber BigInt?
+ iteminfo String? @db.LongText
+ idnumber String? @db.VarChar(255)
+ calculation String? @db.LongText
+ gradetype Int @default(1) @db.SmallInt
+ grademax Decimal @default(100.00000) @db.Decimal(10, 5)
+ grademin Decimal @default(0.00000) @db.Decimal(10, 5)
+ scaleid BigInt?
+ outcomeid BigInt?
+ gradepass Decimal @default(0.00000) @db.Decimal(10, 5)
+ multfactor Decimal @default(1.00000) @db.Decimal(10, 5)
+ plusfactor Decimal @default(0.00000) @db.Decimal(10, 5)
+ aggregationcoef Decimal @default(0.00000) @db.Decimal(10, 5)
+ aggregationcoef2 Decimal @default(0.00000) @db.Decimal(10, 5)
+ sortorder BigInt @default(0)
+ hidden BigInt @default(0)
+ locked BigInt @default(0)
+ locktime BigInt @default(0)
+ needsupdate BigInt @default(0)
+ display BigInt @default(0)
+ decimals Boolean?
+ weightoverride Boolean @default(false)
+
+ @@index([action], map: "mdl_graditemhist_act_ix")
+ @@index([categoryid], map: "mdl_graditemhist_cat_ix")
+ @@index([courseid], map: "mdl_graditemhist_cou_ix")
+ @@index([loggeduser], map: "mdl_graditemhist_log_ix")
+ @@index([oldid], map: "mdl_graditemhist_old_ix")
+ @@index([outcomeid], map: "mdl_graditemhist_out_ix")
+ @@index([scaleid], map: "mdl_graditemhist_sca_ix")
+ @@index([timemodified], map: "mdl_graditemhist_tim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_grade_letters {
+ id BigInt @id @default(autoincrement())
+ contextid BigInt
+ lowerboundary Decimal @db.Decimal(10, 5)
+ letter String @default("") @db.VarChar(255)
+
+ @@unique([contextid, lowerboundary, letter], map: "mdl_gradlett_conlowlet_uix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_grade_outcomes {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt?
+ shortname String @default("") @db.VarChar(255)
+ fullname String @db.LongText
+ scaleid BigInt?
+ description String? @db.LongText
+ descriptionformat Int @default(0) @db.TinyInt
+ timecreated BigInt?
+ timemodified BigInt?
+ usermodified BigInt?
+
+ @@unique([courseid, shortname], map: "mdl_gradoutc_cousho_uix")
+ @@index([courseid], map: "mdl_gradoutc_cou_ix")
+ @@index([scaleid], map: "mdl_gradoutc_sca_ix")
+ @@index([usermodified], map: "mdl_gradoutc_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_grade_outcomes_courses {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ outcomeid BigInt
+
+ @@unique([courseid, outcomeid], map: "mdl_gradoutccour_couout_uix")
+ @@index([courseid], map: "mdl_gradoutccour_cou_ix")
+ @@index([outcomeid], map: "mdl_gradoutccour_out_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_grade_outcomes_history {
+ id BigInt @id @default(autoincrement())
+ action BigInt @default(0)
+ oldid BigInt
+ source String? @db.VarChar(255)
+ timemodified BigInt?
+ loggeduser BigInt?
+ courseid BigInt?
+ shortname String @default("") @db.VarChar(255)
+ fullname String @db.LongText
+ scaleid BigInt?
+ description String? @db.LongText
+ descriptionformat Int @default(0) @db.TinyInt
+
+ @@index([action], map: "mdl_gradoutchist_act_ix")
+ @@index([courseid], map: "mdl_gradoutchist_cou_ix")
+ @@index([loggeduser], map: "mdl_gradoutchist_log_ix")
+ @@index([oldid], map: "mdl_gradoutchist_old_ix")
+ @@index([scaleid], map: "mdl_gradoutchist_sca_ix")
+ @@index([timemodified], map: "mdl_gradoutchist_tim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_grade_settings {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ name String @default("") @db.VarChar(255)
+ value String? @db.LongText
+
+ @@unique([courseid, name], map: "mdl_gradsett_counam_uix")
+ @@index([courseid], map: "mdl_gradsett_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_grading_areas {
+ id BigInt @id @default(autoincrement())
+ contextid BigInt
+ component String @default("") @db.VarChar(100)
+ areaname String @default("") @db.VarChar(100)
+ activemethod String? @db.VarChar(100)
+
+ @@unique([contextid, component, areaname], map: "mdl_gradarea_concomare_uix")
+ @@index([contextid], map: "mdl_gradarea_con_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_grading_definitions {
+ id BigInt @id @default(autoincrement())
+ areaid BigInt
+ method String @default("") @db.VarChar(100)
+ name String @default("") @db.VarChar(255)
+ description String? @db.LongText
+ descriptionformat Int? @db.TinyInt
+ status BigInt @default(0)
+ copiedfromid BigInt?
+ timecreated BigInt
+ usercreated BigInt
+ timemodified BigInt
+ usermodified BigInt
+ timecopied BigInt? @default(0)
+ options String? @db.LongText
+
+ @@unique([areaid, method], map: "mdl_graddefi_aremet_uix")
+ @@index([areaid], map: "mdl_graddefi_are_ix")
+ @@index([usercreated], map: "mdl_graddefi_use2_ix")
+ @@index([usermodified], map: "mdl_graddefi_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_grading_instances {
+ id BigInt @id @default(autoincrement())
+ definitionid BigInt
+ raterid BigInt
+ itemid BigInt?
+ rawgrade Decimal? @db.Decimal(10, 5)
+ status BigInt @default(0)
+ feedback String? @db.LongText
+ feedbackformat Int? @db.TinyInt
+ timemodified BigInt
+
+ @@index([definitionid], map: "mdl_gradinst_def_ix")
+ @@index([raterid], map: "mdl_gradinst_rat_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_gradingform_guide_comments {
+ id BigInt @id @default(autoincrement())
+ definitionid BigInt
+ sortorder BigInt
+ description String? @db.LongText
+ descriptionformat Int? @db.TinyInt
+
+ @@index([definitionid], map: "mdl_gradguidcomm_def_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_gradingform_guide_criteria {
+ id BigInt @id @default(autoincrement())
+ definitionid BigInt
+ sortorder BigInt
+ shortname String @default("") @db.VarChar(255)
+ description String? @db.LongText
+ descriptionformat Int? @db.TinyInt
+ descriptionmarkers String? @db.LongText
+ descriptionmarkersformat Int? @db.TinyInt
+ maxscore Decimal @db.Decimal(10, 5)
+
+ @@index([definitionid], map: "mdl_gradguidcrit_def_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_gradingform_guide_fillings {
+ id BigInt @id @default(autoincrement())
+ instanceid BigInt
+ criterionid BigInt
+ remark String? @db.LongText
+ remarkformat Int? @db.TinyInt
+ score Decimal @db.Decimal(10, 5)
+
+ @@unique([instanceid, criterionid], map: "mdl_gradguidfill_inscri_uix")
+ @@index([criterionid], map: "mdl_gradguidfill_cri_ix")
+ @@index([instanceid], map: "mdl_gradguidfill_ins_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_gradingform_rubric_criteria {
+ id BigInt @id @default(autoincrement())
+ definitionid BigInt
+ sortorder BigInt
+ description String? @db.LongText
+ descriptionformat Int? @db.TinyInt
+
+ @@index([definitionid], map: "mdl_gradrubrcrit_def_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_gradingform_rubric_fillings {
+ id BigInt @id @default(autoincrement())
+ instanceid BigInt
+ criterionid BigInt
+ levelid BigInt?
+ remark String? @db.LongText
+ remarkformat Int? @db.TinyInt
+
+ @@unique([instanceid, criterionid], map: "mdl_gradrubrfill_inscri_uix")
+ @@index([criterionid], map: "mdl_gradrubrfill_cri_ix")
+ @@index([instanceid], map: "mdl_gradrubrfill_ins_ix")
+ @@index([levelid], map: "mdl_gradrubrfill_lev_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_gradingform_rubric_levels {
+ id BigInt @id @default(autoincrement())
+ criterionid BigInt
+ score Decimal @db.Decimal(10, 5)
+ definition String? @db.LongText
+ definitionformat BigInt?
+
+ @@index([criterionid], map: "mdl_gradrubrleve_cri_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_groupings {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ idnumber String @default("") @db.VarChar(100)
+ description String? @db.LongText
+ descriptionformat Int @default(0) @db.TinyInt
+ configdata String? @db.LongText
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([courseid], map: "mdl_grou_cou2_ix")
+ @@index([idnumber], map: "mdl_grou_idn2_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_groupings_groups {
+ id BigInt @id @default(autoincrement())
+ groupingid BigInt @default(0)
+ groupid BigInt @default(0)
+ timeadded BigInt @default(0)
+
+ @@index([groupid], map: "mdl_grougrou_gro2_ix")
+ @@index([groupingid], map: "mdl_grougrou_gro_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_groups {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ idnumber String @default("") @db.VarChar(100)
+ name String @default("") @db.VarChar(254)
+ description String? @db.LongText
+ descriptionformat Int @default(0) @db.TinyInt
+ enrolmentkey String? @db.VarChar(50)
+ picture BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([courseid], map: "mdl_grou_cou_ix")
+ @@index([idnumber], map: "mdl_grou_idn_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_groups_members {
+ id BigInt @id @default(autoincrement())
+ groupid BigInt @default(0)
+ userid BigInt @default(0)
+ timeadded BigInt @default(0)
+ component String @default("") @db.VarChar(100)
+ itemid BigInt @default(0)
+
+ @@unique([userid, groupid], map: "mdl_groumemb_usegro_uix")
+ @@index([groupid], map: "mdl_groumemb_gro_ix")
+ @@index([userid], map: "mdl_groumemb_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_h5p {
+ id BigInt @id @default(autoincrement())
+ jsoncontent String @db.LongText
+ mainlibraryid BigInt
+ displayoptions Int? @db.SmallInt
+ pathnamehash String @default("") @db.VarChar(40)
+ contenthash String @default("") @db.VarChar(40)
+ filtered String? @db.LongText
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([mainlibraryid], map: "mdl_h5p_mai_ix")
+ @@index([pathnamehash], map: "mdl_h5p_pat_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_h5p_contents_libraries {
+ id BigInt @id @default(autoincrement())
+ h5pid BigInt
+ libraryid BigInt
+ dependencytype String @default("") @db.VarChar(10)
+ dropcss Boolean
+ weight BigInt
+
+ @@index([h5pid], map: "mdl_h5pcontlibr_h5p_ix")
+ @@index([libraryid], map: "mdl_h5pcontlibr_lib_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_h5p_libraries {
+ id BigInt @id @default(autoincrement())
+ machinename String @default("") @db.VarChar(255)
+ title String @default("") @db.VarChar(255)
+ majorversion Int @db.SmallInt
+ minorversion Int @db.SmallInt
+ patchversion Int @db.SmallInt
+ runnable Boolean
+ fullscreen Boolean @default(false)
+ embedtypes String @default("") @db.VarChar(255)
+ preloadedjs String? @db.LongText
+ preloadedcss String? @db.LongText
+ droplibrarycss String? @db.LongText
+ semantics String? @db.LongText
+ addto String? @db.LongText
+ coremajor Int? @db.SmallInt
+ coreminor Int? @db.SmallInt
+ metadatasettings String? @db.LongText
+ tutorial String? @db.LongText
+ example String? @db.LongText
+ enabled Boolean? @default(true)
+
+ @@index([machinename, majorversion, minorversion, patchversion, runnable], map: "mdl_h5plibr_macmajminpatrun_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_h5p_libraries_cachedassets {
+ id BigInt @id @default(autoincrement())
+ libraryid BigInt
+ hash String @default("") @db.VarChar(255)
+
+ @@index([libraryid], map: "mdl_h5plibrcach_lib_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_h5p_library_dependencies {
+ id BigInt @id @default(autoincrement())
+ libraryid BigInt
+ requiredlibraryid BigInt
+ dependencytype String @default("") @db.VarChar(255)
+
+ @@index([libraryid], map: "mdl_h5plibrdepe_lib_ix")
+ @@index([requiredlibraryid], map: "mdl_h5plibrdepe_req_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_h5pactivity {
+ id BigInt @id @default(autoincrement())
+ course BigInt
+ name String @default("") @db.VarChar(255)
+ timecreated BigInt
+ timemodified BigInt
+ intro String? @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ grade BigInt? @default(0)
+ displayoptions Int @default(0) @db.SmallInt
+ enabletracking Boolean @default(true)
+ grademethod Int @default(1) @db.SmallInt
+ reviewmode Int? @default(1) @db.SmallInt
+
+ @@index([course], map: "mdl_h5pa_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_h5pactivity_attempts {
+ id BigInt @id @default(autoincrement())
+ h5pactivityid BigInt
+ userid BigInt
+ timecreated BigInt
+ timemodified BigInt
+ attempt Int @default(1) @db.MediumInt
+ rawscore BigInt? @default(0)
+ maxscore BigInt? @default(0)
+ scaled Decimal @default(0.00000) @db.Decimal(10, 5)
+ duration BigInt? @default(0)
+ completion Boolean?
+ success Boolean?
+
+ @@unique([h5pactivityid, userid, attempt], map: "mdl_h5paatte_h5puseatt_uix")
+ @@index([h5pactivityid], map: "mdl_h5paatte_h5p_ix")
+ @@index([h5pactivityid, timecreated], map: "mdl_h5paatte_h5ptim_ix")
+ @@index([h5pactivityid, userid], map: "mdl_h5paatte_h5puse_ix")
+ @@index([timecreated], map: "mdl_h5paatte_tim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_h5pactivity_attempts_results {
+ id BigInt @id @default(autoincrement())
+ attemptid BigInt
+ subcontent String? @db.VarChar(128)
+ timecreated BigInt
+ interactiontype String? @db.VarChar(128)
+ description String? @db.LongText
+ correctpattern String? @db.LongText
+ response String @db.LongText
+ additionals String? @db.LongText
+ rawscore BigInt @default(0)
+ maxscore BigInt @default(0)
+ duration BigInt? @default(0)
+ completion Boolean?
+ success Boolean?
+
+ @@index([attemptid], map: "mdl_h5paatteresu_att_ix")
+ @@index([attemptid, timecreated], map: "mdl_h5paatteresu_atttim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_imscp {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String? @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ revision BigInt @default(0)
+ keepold BigInt @default(-1)
+ structure String? @db.LongText
+ timemodified BigInt @default(0)
+
+ @@index([course], map: "mdl_imsc_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_infected_files {
+ id BigInt @id @default(autoincrement())
+ filename String @db.LongText
+ quarantinedfile String? @db.LongText
+ userid BigInt
+ reason String @db.LongText
+ timecreated BigInt @default(0)
+
+ @@index([userid], map: "mdl_infefile_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_label {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String @db.LongText
+ introformat Int? @default(0) @db.SmallInt
+ timemodified BigInt @default(0)
+
+ @@index([course], map: "mdl_labe_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_lesson {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String? @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ practice Int @default(0) @db.SmallInt
+ modattempts Int @default(0) @db.SmallInt
+ usepassword Int @default(0) @db.SmallInt
+ password String @default("") @db.VarChar(32)
+ dependency BigInt @default(0)
+ conditions String @db.LongText
+ grade BigInt @default(0)
+ custom Int @default(0) @db.SmallInt
+ ongoing Int @default(0) @db.SmallInt
+ usemaxgrade Int @default(0) @db.SmallInt
+ maxanswers Int @default(4) @db.SmallInt
+ maxattempts Int @default(5) @db.SmallInt
+ review Int @default(0) @db.SmallInt
+ nextpagedefault Int @default(0) @db.SmallInt
+ feedback Int @default(1) @db.SmallInt
+ minquestions Int @default(0) @db.SmallInt
+ maxpages Int @default(0) @db.SmallInt
+ timelimit BigInt @default(0)
+ retake Int @default(1) @db.SmallInt
+ activitylink BigInt @default(0)
+ mediafile String @default("") @db.VarChar(255)
+ mediaheight BigInt @default(100)
+ mediawidth BigInt @default(650)
+ mediaclose Int @default(0) @db.SmallInt
+ slideshow Int @default(0) @db.SmallInt
+ width BigInt @default(640)
+ height BigInt @default(480)
+ bgcolor String @default("#FFFFFF") @db.VarChar(7)
+ displayleft Int @default(0) @db.SmallInt
+ displayleftif Int @default(0) @db.SmallInt
+ progressbar Int @default(0) @db.SmallInt
+ available BigInt @default(0)
+ deadline BigInt @default(0)
+ timemodified BigInt @default(0)
+ completionendreached Boolean? @default(false)
+ completiontimespent BigInt? @default(0)
+ allowofflineattempts Boolean? @default(false)
+
+ @@index([course], map: "mdl_less_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_lesson_answers {
+ id BigInt @id @default(autoincrement())
+ lessonid BigInt @default(0)
+ pageid BigInt @default(0)
+ jumpto BigInt @default(0)
+ grade Int @default(0) @db.SmallInt
+ score BigInt @default(0)
+ flags Int @default(0) @db.SmallInt
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ answer String? @db.LongText
+ answerformat Int @default(0) @db.TinyInt
+ response String? @db.LongText
+ responseformat Int @default(0) @db.TinyInt
+
+ @@index([lessonid], map: "mdl_lessansw_les_ix")
+ @@index([pageid], map: "mdl_lessansw_pag_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_lesson_attempts {
+ id BigInt @id @default(autoincrement())
+ lessonid BigInt @default(0)
+ pageid BigInt @default(0)
+ userid BigInt @default(0)
+ answerid BigInt @default(0)
+ retry Int @default(0) @db.SmallInt
+ correct BigInt @default(0)
+ useranswer String? @db.LongText
+ timeseen BigInt @default(0)
+
+ @@index([answerid], map: "mdl_lessatte_ans_ix")
+ @@index([lessonid], map: "mdl_lessatte_les_ix")
+ @@index([pageid], map: "mdl_lessatte_pag_ix")
+ @@index([userid], map: "mdl_lessatte_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_lesson_branch {
+ id BigInt @id @default(autoincrement())
+ lessonid BigInt @default(0)
+ userid BigInt @default(0)
+ pageid BigInt @default(0)
+ retry BigInt @default(0)
+ flag Int @default(0) @db.SmallInt
+ timeseen BigInt @default(0)
+ nextpageid BigInt @default(0)
+
+ @@index([lessonid], map: "mdl_lessbran_les_ix")
+ @@index([pageid], map: "mdl_lessbran_pag_ix")
+ @@index([userid], map: "mdl_lessbran_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_lesson_grades {
+ id BigInt @id @default(autoincrement())
+ lessonid BigInt @default(0)
+ userid BigInt @default(0)
+ grade Float @default(0)
+ late Int @default(0) @db.SmallInt
+ completed BigInt @default(0)
+
+ @@index([lessonid], map: "mdl_lessgrad_les_ix")
+ @@index([userid], map: "mdl_lessgrad_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_lesson_overrides {
+ id BigInt @id @default(autoincrement())
+ lessonid BigInt @default(0)
+ groupid BigInt?
+ userid BigInt?
+ available BigInt?
+ deadline BigInt?
+ timelimit BigInt?
+ review Int? @db.SmallInt
+ maxattempts Int? @db.SmallInt
+ retake Int? @db.SmallInt
+ password String? @db.VarChar(32)
+
+ @@index([groupid], map: "mdl_lessover_gro_ix")
+ @@index([lessonid], map: "mdl_lessover_les_ix")
+ @@index([userid], map: "mdl_lessover_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_lesson_pages {
+ id BigInt @id @default(autoincrement())
+ lessonid BigInt @default(0)
+ prevpageid BigInt @default(0)
+ nextpageid BigInt @default(0)
+ qtype Int @default(0) @db.SmallInt
+ qoption Int @default(0) @db.SmallInt
+ layout Int @default(1) @db.SmallInt
+ display Int @default(1) @db.SmallInt
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ title String @default("") @db.VarChar(255)
+ contents String @db.LongText
+ contentsformat Int @default(0) @db.TinyInt
+
+ @@index([lessonid], map: "mdl_lesspage_les_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_lesson_timer {
+ id BigInt @id @default(autoincrement())
+ lessonid BigInt @default(0)
+ userid BigInt @default(0)
+ starttime BigInt @default(0)
+ lessontime BigInt @default(0)
+ completed Boolean? @default(false)
+ timemodifiedoffline BigInt @default(0)
+
+ @@index([lessonid], map: "mdl_lesstime_les_ix")
+ @@index([userid], map: "mdl_lesstime_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_license {
+ id BigInt @id @default(autoincrement())
+ shortname String? @db.VarChar(255)
+ fullname String? @db.LongText
+ source String? @db.VarChar(255)
+ enabled Boolean @default(true)
+ version BigInt @default(0)
+ custom Boolean @default(false)
+ sortorder Int @default(0) @db.MediumInt
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_lock_db {
+ id BigInt @id @default(autoincrement())
+ resourcekey String @unique(map: "mdl_lockdb_res_uix") @default("") @db.VarChar(255)
+ expires BigInt?
+ owner String? @db.VarChar(36)
+
+ @@index([expires], map: "mdl_lockdb_exp_ix")
+ @@index([owner], map: "mdl_lockdb_own_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_log {
+ id BigInt @id @default(autoincrement())
+ time BigInt @default(0)
+ userid BigInt @default(0)
+ ip String @default("") @db.VarChar(45)
+ course BigInt @default(0)
+ module String @default("") @db.VarChar(20)
+ cmid BigInt @default(0)
+ action String @default("") @db.VarChar(40)
+ url String @default("") @db.VarChar(100)
+ info String @default("") @db.VarChar(255)
+
+ @@index([action], map: "mdl_log_act_ix")
+ @@index([cmid], map: "mdl_log_cmi_ix")
+ @@index([course, module, action], map: "mdl_log_coumodact_ix")
+ @@index([time], map: "mdl_log_tim_ix")
+ @@index([userid, course], map: "mdl_log_usecou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_log_display {
+ id BigInt @id @default(autoincrement())
+ module String @default("") @db.VarChar(20)
+ action String @default("") @db.VarChar(40)
+ mtable String @default("") @db.VarChar(30)
+ field String @default("") @db.VarChar(200)
+ component String @default("") @db.VarChar(100)
+
+ @@unique([module, action], map: "mdl_logdisp_modact_uix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_log_queries {
+ id BigInt @id @default(autoincrement())
+ qtype Int @db.MediumInt
+ sqltext String @db.LongText
+ sqlparams String? @db.LongText
+ error Int @default(0) @db.MediumInt
+ info String? @db.LongText
+ backtrace String? @db.LongText
+ exectime Decimal @db.Decimal(10, 5)
+ timelogged BigInt
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_logstore_standard_log {
+ id BigInt @id @default(autoincrement())
+ eventname String @default("") @db.VarChar(255)
+ component String @default("") @db.VarChar(100)
+ action String @default("") @db.VarChar(100)
+ target String @default("") @db.VarChar(100)
+ objecttable String? @db.VarChar(50)
+ objectid BigInt?
+ crud String @default("") @db.VarChar(1)
+ edulevel Boolean
+ contextid BigInt
+ contextlevel BigInt
+ contextinstanceid BigInt
+ userid BigInt
+ courseid BigInt?
+ relateduserid BigInt?
+ anonymous Boolean @default(false)
+ other String? @db.LongText
+ timecreated BigInt
+ origin String? @db.VarChar(10)
+ ip String? @db.VarChar(45)
+ realuserid BigInt?
+
+ @@index([contextid], map: "mdl_logsstanlog_con_ix")
+ @@index([courseid], map: "mdl_logsstanlog_cou_ix")
+ @@index([courseid, anonymous, timecreated], map: "mdl_logsstanlog_couanotim_ix")
+ @@index([realuserid], map: "mdl_logsstanlog_rea_ix")
+ @@index([relateduserid], map: "mdl_logsstanlog_rel_ix")
+ @@index([timecreated], map: "mdl_logsstanlog_tim_ix")
+ @@index([userid], map: "mdl_logsstanlog_use_ix")
+ @@index([userid, contextlevel, contextinstanceid, crud, edulevel, timecreated], map: "mdl_logsstanlog_useconconcr_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_lti {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String? @db.LongText
+ introformat Int? @default(0) @db.SmallInt
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ typeid BigInt?
+ toolurl String @db.LongText
+ securetoolurl String? @db.LongText
+ instructorchoicesendname Boolean?
+ instructorchoicesendemailaddr Boolean?
+ instructorchoiceallowroster Boolean?
+ instructorchoiceallowsetting Boolean?
+ instructorcustomparameters String? @db.LongText
+ instructorchoiceacceptgrades Boolean?
+ grade BigInt @default(100)
+ launchcontainer Int @default(1) @db.TinyInt
+ resourcekey String? @db.VarChar(255)
+ password String? @db.VarChar(255)
+ debuglaunch Boolean @default(false)
+ showtitlelaunch Boolean @default(false)
+ showdescriptionlaunch Boolean @default(false)
+ servicesalt String? @db.VarChar(40)
+ icon String? @db.LongText
+ secureicon String? @db.LongText
+
+ @@index([course], map: "mdl_lti_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_lti_access_tokens {
+ id BigInt @id @default(autoincrement())
+ typeid BigInt
+ scope String @db.LongText
+ token String @unique(map: "mdl_ltiaccetoke_tok_uix") @default("") @db.VarChar(128)
+ validuntil BigInt
+ timecreated BigInt
+ lastaccess BigInt?
+
+ @@index([typeid], map: "mdl_ltiaccetoke_typ_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_lti_submission {
+ id BigInt @id @default(autoincrement())
+ ltiid BigInt
+ userid BigInt
+ datesubmitted BigInt
+ dateupdated BigInt
+ gradepercent Decimal @db.Decimal(10, 5)
+ originalgrade Decimal @db.Decimal(10, 5)
+ launchid BigInt
+ state Int @db.TinyInt
+
+ @@index([ltiid], map: "mdl_ltisubm_lti_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_lti_tool_proxies {
+ id BigInt @id @default(autoincrement())
+ name String @default("Tool Provider") @db.VarChar(255)
+ regurl String? @db.LongText
+ state Int @default(1) @db.TinyInt
+ guid String? @unique(map: "mdl_ltitoolprox_gui_uix") @db.VarChar(255)
+ secret String? @db.VarChar(255)
+ vendorcode String? @db.VarChar(255)
+ capabilityoffered String @db.LongText
+ serviceoffered String @db.LongText
+ toolproxy String? @db.LongText
+ createdby BigInt
+ timecreated BigInt
+ timemodified BigInt
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_lti_tool_settings {
+ id BigInt @id @default(autoincrement())
+ toolproxyid BigInt
+ typeid BigInt?
+ course BigInt?
+ coursemoduleid BigInt?
+ settings String @db.LongText
+ timecreated BigInt
+ timemodified BigInt
+
+ @@index([coursemoduleid], map: "mdl_ltitoolsett_cou2_ix")
+ @@index([course], map: "mdl_ltitoolsett_cou_ix")
+ @@index([toolproxyid], map: "mdl_ltitoolsett_too_ix")
+ @@index([typeid], map: "mdl_ltitoolsett_typ_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_lti_types {
+ id BigInt @id @default(autoincrement())
+ name String @default("basiclti Activity") @db.VarChar(255)
+ baseurl String @db.LongText
+ tooldomain String @default("") @db.VarChar(255)
+ state Int @default(2) @db.TinyInt
+ course BigInt
+ coursevisible Boolean @default(false)
+ ltiversion String @default("") @db.VarChar(10)
+ clientid String? @unique(map: "mdl_ltitype_cli_uix") @db.VarChar(255)
+ toolproxyid BigInt?
+ enabledcapability String? @db.LongText
+ parameter String? @db.LongText
+ icon String? @db.LongText
+ secureicon String? @db.LongText
+ createdby BigInt
+ timecreated BigInt
+ timemodified BigInt
+ description String? @db.LongText
+
+ @@index([course], map: "mdl_ltitype_cou_ix")
+ @@index([tooldomain], map: "mdl_ltitype_too_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_lti_types_config {
+ id BigInt @id @default(autoincrement())
+ typeid BigInt
+ name String @default("") @db.VarChar(100)
+ value String @db.LongText
+
+ @@index([typeid], map: "mdl_ltitypeconf_typ_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_ltiservice_gradebookservices {
+ id BigInt @id @default(autoincrement())
+ gradeitemid BigInt
+ courseid BigInt
+ toolproxyid BigInt?
+ typeid BigInt?
+ baseurl String? @db.LongText
+ ltilinkid BigInt?
+ resourceid String? @db.VarChar(512)
+ tag String? @db.VarChar(255)
+ subreviewurl String? @db.LongText
+ subreviewparams String? @db.LongText
+
+ @@index([gradeitemid, courseid], map: "mdl_ltisgrad_gracou_ix")
+ @@index([ltilinkid], map: "mdl_ltisgrad_lti_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_message {
+ id BigInt @id @default(autoincrement())
+ useridfrom BigInt @default(0)
+ useridto BigInt @default(0)
+ subject String? @db.LongText
+ fullmessage String? @db.LongText
+ fullmessageformat Int? @default(0) @db.SmallInt
+ fullmessagehtml String? @db.LongText
+ smallmessage String? @db.LongText
+ notification Boolean? @default(false)
+ contexturl String? @db.LongText
+ contexturlname String? @db.LongText
+ timecreated BigInt @default(0)
+ timeuserfromdeleted BigInt @default(0)
+ timeusertodeleted BigInt @default(0)
+ component String? @db.VarChar(100)
+ eventtype String? @db.VarChar(100)
+ customdata String? @db.LongText
+
+ @@index([useridto, timeusertodeleted, notification], map: "mdl_mess_usetimnot2_ix")
+ @@index([useridfrom, timeuserfromdeleted, notification], map: "mdl_mess_usetimnot_ix")
+ @@index([useridfrom, useridto, timeuserfromdeleted, timeusertodeleted], map: "mdl_mess_useusetimtim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_message_airnotifier_devices {
+ id BigInt @id @default(autoincrement())
+ userdeviceid BigInt @unique(map: "mdl_messairndevi_use_uix")
+ enable Boolean @default(true)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_message_contact_requests {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ requesteduserid BigInt
+ timecreated BigInt
+
+ @@unique([userid, requesteduserid], map: "mdl_messcontrequ_usereq_uix")
+ @@index([requesteduserid], map: "mdl_messcontrequ_req_ix")
+ @@index([userid], map: "mdl_messcontrequ_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_message_contacts {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ contactid BigInt
+ timecreated BigInt?
+
+ @@unique([userid, contactid], map: "mdl_messcont_usecon_uix")
+ @@index([contactid], map: "mdl_messcont_con_ix")
+ @@index([userid], map: "mdl_messcont_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_message_conversation_actions {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ conversationid BigInt
+ action BigInt
+ timecreated BigInt
+
+ @@index([conversationid], map: "mdl_messconvacti_con_ix")
+ @@index([userid], map: "mdl_messconvacti_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_message_conversation_members {
+ id BigInt @id @default(autoincrement())
+ conversationid BigInt
+ userid BigInt
+ timecreated BigInt
+
+ @@index([conversationid], map: "mdl_messconvmemb_con_ix")
+ @@index([userid], map: "mdl_messconvmemb_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_message_conversations {
+ id BigInt @id @default(autoincrement())
+ type BigInt @default(1)
+ name String? @db.VarChar(255)
+ convhash String? @db.VarChar(40)
+ component String? @db.VarChar(100)
+ itemtype String? @db.VarChar(100)
+ itemid BigInt?
+ contextid BigInt?
+ enabled Boolean @default(false)
+ timecreated BigInt
+ timemodified BigInt?
+
+ @@index([component, itemtype, itemid, contextid], map: "mdl_messconv_comiteitecon_ix")
+ @@index([contextid], map: "mdl_messconv_con2_ix")
+ @@index([convhash], map: "mdl_messconv_con_ix")
+ @@index([type], map: "mdl_messconv_typ_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_message_email_messages {
+ id BigInt @id @default(autoincrement())
+ useridto BigInt
+ conversationid BigInt
+ messageid BigInt
+
+ @@index([conversationid], map: "mdl_messemaimess_con_ix")
+ @@index([messageid], map: "mdl_messemaimess_mes_ix")
+ @@index([useridto], map: "mdl_messemaimess_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_message_popup {
+ id BigInt @id @default(autoincrement())
+ messageid BigInt
+ isread Boolean @default(false)
+
+ @@unique([messageid, isread], map: "mdl_messpopu_mesisr_uix")
+ @@index([isread], map: "mdl_messpopu_isr_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_message_popup_notifications {
+ id BigInt @id @default(autoincrement())
+ notificationid BigInt
+
+ @@index([notificationid], map: "mdl_messpopunoti_not_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_message_processors {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(166)
+ enabled Boolean @default(true)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_message_providers {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(100)
+ component String @default("") @db.VarChar(200)
+ capability String? @db.VarChar(255)
+
+ @@unique([component, name], map: "mdl_messprov_comnam_uix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_message_read {
+ id BigInt @id @default(autoincrement())
+ useridfrom BigInt @default(0)
+ useridto BigInt @default(0)
+ subject String? @db.LongText
+ fullmessage String? @db.LongText
+ fullmessageformat Int? @default(0) @db.SmallInt
+ fullmessagehtml String? @db.LongText
+ smallmessage String? @db.LongText
+ notification Boolean? @default(false)
+ contexturl String? @db.LongText
+ contexturlname String? @db.LongText
+ timecreated BigInt @default(0)
+ timeread BigInt @default(0)
+ timeuserfromdeleted BigInt @default(0)
+ timeusertodeleted BigInt @default(0)
+ component String? @db.VarChar(100)
+ eventtype String? @db.VarChar(100)
+
+ @@index([notification, timeread], map: "mdl_messread_nottim_ix")
+ @@index([useridto, timeusertodeleted, notification], map: "mdl_messread_usetimnot2_ix")
+ @@index([useridfrom, timeuserfromdeleted, notification], map: "mdl_messread_usetimnot_ix")
+ @@index([useridfrom, useridto, timeuserfromdeleted, timeusertodeleted], map: "mdl_messread_useusetimtim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_message_user_actions {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ messageid BigInt
+ action BigInt
+ timecreated BigInt
+
+ @@unique([userid, messageid, action], map: "mdl_messuseracti_usemesact_uix")
+ @@index([messageid], map: "mdl_messuseracti_mes_ix")
+ @@index([userid], map: "mdl_messuseracti_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_message_users_blocked {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ blockeduserid BigInt
+ timecreated BigInt?
+
+ @@unique([userid, blockeduserid], map: "mdl_messuserbloc_useblo_uix")
+ @@index([blockeduserid], map: "mdl_messuserbloc_blo_ix")
+ @@index([userid], map: "mdl_messuserbloc_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_messageinbound_datakeys {
+ id BigInt @id @default(autoincrement())
+ handler BigInt
+ datavalue BigInt
+ datakey String? @db.VarChar(64)
+ timecreated BigInt
+ expires BigInt?
+
+ @@unique([handler, datavalue], map: "mdl_messdata_handat_uix")
+ @@index([handler], map: "mdl_messdata_han_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_messageinbound_handlers {
+ id BigInt @id @default(autoincrement())
+ component String @default("") @db.VarChar(100)
+ classname String @unique(map: "mdl_messhand_cla_uix") @default("") @db.VarChar(255)
+ defaultexpiration BigInt @default(86400)
+ validateaddress Boolean @default(true)
+ enabled Boolean @default(false)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_messageinbound_messagelist {
+ id BigInt @id @default(autoincrement())
+ messageid String @db.LongText
+ userid BigInt
+ address String @db.LongText
+ timecreated BigInt
+
+ @@index([userid], map: "mdl_messmess_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_messages {
+ id BigInt @id @default(autoincrement())
+ useridfrom BigInt
+ conversationid BigInt
+ subject String? @db.LongText
+ fullmessage String? @db.LongText
+ fullmessageformat Boolean @default(false)
+ fullmessagehtml String? @db.LongText
+ smallmessage String? @db.LongText
+ timecreated BigInt
+ fullmessagetrust Int @default(0) @db.TinyInt
+ customdata String? @db.LongText
+
+ @@index([conversationid], map: "mdl_mess_con_ix")
+ @@index([conversationid, timecreated], map: "mdl_mess_contim_ix")
+ @@index([useridfrom], map: "mdl_mess_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_mnet_application {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(50)
+ display_name String @default("") @db.VarChar(50)
+ xmlrpc_server_url String @default("") @db.VarChar(255)
+ sso_land_url String @default("") @db.VarChar(255)
+ sso_jump_url String @default("") @db.VarChar(255)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_mnet_host {
+ id BigInt @id @default(autoincrement())
+ deleted Boolean @default(false)
+ wwwroot String @default("") @db.VarChar(255)
+ ip_address String @default("") @db.VarChar(45)
+ name String @default("") @db.VarChar(80)
+ public_key String @db.LongText
+ public_key_expires BigInt @default(0)
+ transport Int @default(0) @db.TinyInt
+ portno Int @default(0) @db.MediumInt
+ last_connect_time BigInt @default(0)
+ last_log_id BigInt @default(0)
+ force_theme Boolean @default(false)
+ theme String? @db.VarChar(100)
+ applicationid BigInt @default(1)
+ sslverification Boolean @default(false)
+
+ @@index([applicationid], map: "mdl_mnethost_app_ix")
+ @@index([last_log_id], map: "mdl_mnethost_las_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_mnet_host2service {
+ id BigInt @id @default(autoincrement())
+ hostid BigInt @default(0)
+ serviceid BigInt @default(0)
+ publish Boolean @default(false)
+ subscribe Boolean @default(false)
+
+ @@unique([hostid, serviceid], map: "mdl_mnethost_hosser_uix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_mnet_log {
+ id BigInt @id @default(autoincrement())
+ hostid BigInt @default(0)
+ remoteid BigInt @default(0)
+ time BigInt @default(0)
+ userid BigInt @default(0)
+ ip String @default("") @db.VarChar(45)
+ course BigInt @default(0)
+ coursename String @default("") @db.VarChar(40)
+ module String @default("") @db.VarChar(20)
+ cmid BigInt @default(0)
+ action String @default("") @db.VarChar(40)
+ url String @default("") @db.VarChar(100)
+ info String @default("") @db.VarChar(255)
+
+ @@index([hostid, userid, course], map: "mdl_mnetlog_hosusecou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_mnet_remote_rpc {
+ id BigInt @id @default(autoincrement())
+ functionname String @default("") @db.VarChar(40)
+ xmlrpcpath String @default("") @db.VarChar(80)
+ plugintype String @default("") @db.VarChar(20)
+ pluginname String @default("") @db.VarChar(20)
+ enabled Boolean
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_mnet_remote_service2rpc {
+ id BigInt @id @default(autoincrement())
+ serviceid BigInt @default(0)
+ rpcid BigInt @default(0)
+
+ @@unique([rpcid, serviceid], map: "mdl_mnetremoserv_rpcser_uix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_mnet_rpc {
+ id BigInt @id @default(autoincrement())
+ functionname String @default("") @db.VarChar(40)
+ xmlrpcpath String @default("") @db.VarChar(80)
+ plugintype String @default("") @db.VarChar(20)
+ pluginname String @default("") @db.VarChar(20)
+ enabled Boolean @default(false)
+ help String @db.LongText
+ profile String @db.LongText
+ filename String @default("") @db.VarChar(100)
+ classname String? @db.VarChar(150)
+ static Boolean?
+
+ @@index([enabled, xmlrpcpath], map: "mdl_mnetrpc_enaxml_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_mnet_service {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(40)
+ description String @default("") @db.VarChar(40)
+ apiversion String @default("") @db.VarChar(10)
+ offer Boolean @default(false)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_mnet_service2rpc {
+ id BigInt @id @default(autoincrement())
+ serviceid BigInt @default(0)
+ rpcid BigInt @default(0)
+
+ @@unique([rpcid, serviceid], map: "mdl_mnetserv_rpcser_uix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_mnet_session {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ username String @default("") @db.VarChar(100)
+ token String @unique(map: "mdl_mnetsess_tok_uix") @default("") @db.VarChar(40)
+ mnethostid BigInt @default(0)
+ useragent String @default("") @db.VarChar(40)
+ confirm_timeout BigInt @default(0)
+ session_id String @default("") @db.VarChar(40)
+ expires BigInt @default(0)
+
+ @@index([mnethostid], map: "mdl_mnetsess_mne_ix")
+ @@index([userid], map: "mdl_mnetsess_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_mnet_sso_access_control {
+ id BigInt @id @default(autoincrement())
+ username String @default("") @db.VarChar(100)
+ mnet_host_id BigInt @default(0)
+ accessctrl String @default("allow") @db.VarChar(20)
+
+ @@unique([mnet_host_id, username], map: "mdl_mnetssoaccecont_mneuse_uix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_mnetservice_enrol_courses {
+ id BigInt @id @default(autoincrement())
+ hostid BigInt
+ remoteid BigInt
+ categoryid BigInt
+ categoryname String @default("") @db.VarChar(255)
+ sortorder BigInt @default(0)
+ fullname String @default("") @db.VarChar(254)
+ shortname String @default("") @db.VarChar(100)
+ idnumber String @default("") @db.VarChar(100)
+ summary String @db.LongText
+ summaryformat Int? @default(0) @db.SmallInt
+ startdate BigInt
+ roleid BigInt
+ rolename String @default("") @db.VarChar(255)
+
+ @@unique([hostid, remoteid], map: "mdl_mnetenrocour_hosrem_uix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_mnetservice_enrol_enrolments {
+ id BigInt @id @default(autoincrement())
+ hostid BigInt
+ userid BigInt
+ remotecourseid BigInt
+ rolename String @default("") @db.VarChar(255)
+ enroltime BigInt @default(0)
+ enroltype String @default("") @db.VarChar(20)
+
+ @@index([hostid], map: "mdl_mnetenroenro_hos_ix")
+ @@index([userid], map: "mdl_mnetenroenro_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_modules {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(20)
+ cron BigInt @default(0)
+ lastcron BigInt @default(0)
+ search String @default("") @db.VarChar(255)
+ visible Boolean @default(true)
+
+ @@index([name], map: "mdl_modu_nam_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_my_pages {
+ id BigInt @id @default(autoincrement())
+ userid BigInt? @default(0)
+ name String @default("") @db.VarChar(200)
+ private Boolean @default(true)
+ sortorder Int @default(0) @db.MediumInt
+
+ @@index([userid, private], map: "mdl_mypage_usepri_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_notifications {
+ id BigInt @id @default(autoincrement())
+ useridfrom BigInt
+ useridto BigInt
+ subject String? @db.LongText
+ fullmessage String? @db.LongText
+ fullmessageformat Boolean @default(false)
+ fullmessagehtml String? @db.LongText
+ smallmessage String? @db.LongText
+ component String? @db.VarChar(100)
+ eventtype String? @db.VarChar(100)
+ contexturl String? @db.LongText
+ contexturlname String? @db.LongText
+ timeread BigInt?
+ timecreated BigInt
+ customdata String? @db.LongText
+
+ @@index([useridto], map: "mdl_noti_use2_ix")
+ @@index([useridfrom], map: "mdl_noti_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_oauth2_access_token {
+ id BigInt @id @default(autoincrement())
+ timecreated BigInt
+ timemodified BigInt
+ usermodified BigInt
+ issuerid BigInt @unique(map: "mdl_oautaccetoke_iss_uix")
+ token String @db.LongText
+ expires BigInt
+ scope String @db.LongText
+
+ @@index([usermodified], map: "mdl_oautaccetoke_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_oauth2_endpoint {
+ id BigInt @id @default(autoincrement())
+ timecreated BigInt
+ timemodified BigInt
+ usermodified BigInt
+ name String @default("") @db.VarChar(255)
+ url String @db.LongText
+ issuerid BigInt
+
+ @@index([issuerid], map: "mdl_oautendp_iss_ix")
+ @@index([usermodified], map: "mdl_oautendp_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_oauth2_issuer {
+ id BigInt @id @default(autoincrement())
+ timecreated BigInt
+ timemodified BigInt
+ usermodified BigInt
+ name String @default("") @db.VarChar(255)
+ image String @db.LongText
+ baseurl String @db.LongText
+ clientid String @db.LongText
+ clientsecret String @db.LongText
+ loginscopes String @db.LongText
+ loginscopesoffline String @db.LongText
+ loginparams String @db.LongText
+ loginparamsoffline String @db.LongText
+ alloweddomains String @db.LongText
+ scopessupported String? @db.LongText
+ enabled Int @default(1) @db.TinyInt
+ showonloginpage Int @default(1) @db.TinyInt
+ basicauth Int @default(0) @db.TinyInt
+ sortorder BigInt
+ requireconfirmation Int @default(1) @db.TinyInt
+ servicetype String? @db.VarChar(255)
+ loginpagename String? @db.VarChar(255)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_oauth2_refresh_token {
+ id BigInt @id @default(autoincrement())
+ timecreated BigInt
+ timemodified BigInt
+ userid BigInt
+ issuerid BigInt
+ token String @db.LongText
+ scopehash String @default("") @db.VarChar(40)
+
+ @@unique([userid, issuerid, scopehash], map: "mdl_oautrefrtoke_useisssco_uix")
+ @@index([issuerid], map: "mdl_oautrefrtoke_iss_ix")
+ @@index([userid], map: "mdl_oautrefrtoke_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_oauth2_system_account {
+ id BigInt @id @default(autoincrement())
+ timecreated BigInt
+ timemodified BigInt
+ usermodified BigInt
+ issuerid BigInt @unique(map: "mdl_oautsystacco_iss_uix")
+ refreshtoken String @db.LongText
+ grantedscopes String @db.LongText
+ email String? @db.LongText
+ username String @db.LongText
+
+ @@index([usermodified], map: "mdl_oautsystacco_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_oauth2_user_field_mapping {
+ id BigInt @id @default(autoincrement())
+ timemodified BigInt
+ timecreated BigInt
+ usermodified BigInt
+ issuerid BigInt
+ externalfield String @default("") @db.VarChar(500)
+ internalfield String @default("") @db.VarChar(64)
+
+ @@unique([issuerid, internalfield], map: "mdl_oautuserfielmapp_issin_uix")
+ @@index([issuerid], map: "mdl_oautuserfielmapp_iss_ix")
+ @@index([usermodified], map: "mdl_oautuserfielmapp_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_page {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String? @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ content String? @db.LongText
+ contentformat Int @default(0) @db.SmallInt
+ legacyfiles Int @default(0) @db.SmallInt
+ legacyfileslast BigInt?
+ display Int @default(0) @db.SmallInt
+ displayoptions String? @db.LongText
+ revision BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([course], map: "mdl_page_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_paygw_paypal {
+ id BigInt @id @default(autoincrement())
+ paymentid BigInt @unique(map: "mdl_paygpayp_pay_uix")
+ pp_orderid String @default("The ID of the order in PayPal") @db.VarChar(255)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_payment_accounts {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(255)
+ idnumber String? @db.VarChar(100)
+ contextid BigInt
+ enabled Boolean @default(false)
+ archived Boolean @default(false)
+ timecreated BigInt?
+ timemodified BigInt?
+
+ @@index([contextid], map: "mdl_paymacco_con_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_payment_gateways {
+ id BigInt @id @default(autoincrement())
+ accountid BigInt
+ gateway String @default("") @db.VarChar(100)
+ enabled Boolean @default(true)
+ config String? @db.LongText
+ timecreated BigInt
+ timemodified BigInt
+
+ @@index([accountid], map: "mdl_paymgate_acc_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_payments {
+ id BigInt @id @default(autoincrement())
+ component String @default("") @db.VarChar(100)
+ paymentarea String @default("") @db.VarChar(50)
+ itemid BigInt
+ userid BigInt
+ amount String @default("") @db.VarChar(20)
+ currency String @default("") @db.VarChar(3)
+ accountid BigInt
+ gateway String @default("") @db.VarChar(100)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([accountid], map: "mdl_paym_acc_ix")
+ @@index([component, paymentarea, itemid], map: "mdl_paym_compayite_ix")
+ @@index([gateway], map: "mdl_paym_gat_ix")
+ @@index([userid], map: "mdl_paym_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_portfolio_instance {
+ id BigInt @id @default(autoincrement())
+ plugin String @default("") @db.VarChar(50)
+ name String @default("") @db.VarChar(255)
+ visible Boolean @default(true)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_portfolio_instance_config {
+ id BigInt @id @default(autoincrement())
+ instance BigInt
+ name String @default("") @db.VarChar(255)
+ value String? @db.LongText
+
+ @@index([instance], map: "mdl_portinstconf_ins_ix")
+ @@index([name], map: "mdl_portinstconf_nam_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_portfolio_instance_user {
+ id BigInt @id @default(autoincrement())
+ instance BigInt
+ userid BigInt
+ name String @default("") @db.VarChar(255)
+ value String? @db.LongText
+
+ @@index([instance], map: "mdl_portinstuser_ins_ix")
+ @@index([userid], map: "mdl_portinstuser_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_portfolio_log {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ time BigInt
+ portfolio BigInt
+ caller_class String @default("") @db.VarChar(150)
+ caller_file String @default("") @db.VarChar(255)
+ caller_component String? @db.VarChar(255)
+ caller_sha1 String @default("") @db.VarChar(255)
+ tempdataid BigInt @default(0)
+ returnurl String @default("") @db.VarChar(255)
+ continueurl String @default("") @db.VarChar(255)
+
+ @@index([portfolio], map: "mdl_portlog_por_ix")
+ @@index([tempdataid], map: "mdl_portlog_tem_ix")
+ @@index([userid], map: "mdl_portlog_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_portfolio_mahara_queue {
+ id BigInt @id @default(autoincrement())
+ transferid BigInt
+ token String @default("") @db.VarChar(50)
+
+ @@index([token], map: "mdl_portmahaqueu_tok_ix")
+ @@index([transferid], map: "mdl_portmahaqueu_tra_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_portfolio_tempdata {
+ id BigInt @id @default(autoincrement())
+ data String? @db.LongText
+ expirytime BigInt
+ userid BigInt
+ instance BigInt? @default(0)
+ queued Boolean @default(false)
+
+ @@index([instance], map: "mdl_porttemp_ins_ix")
+ @@index([userid], map: "mdl_porttemp_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_post {
+ id BigInt @id @default(autoincrement())
+ module String @default("") @db.VarChar(20)
+ userid BigInt @default(0)
+ courseid BigInt @default(0)
+ groupid BigInt @default(0)
+ moduleid BigInt @default(0)
+ coursemoduleid BigInt @default(0)
+ subject String @default("") @db.VarChar(128)
+ summary String? @db.LongText
+ content String? @db.LongText
+ uniquehash String @default("") @db.VarChar(255)
+ rating BigInt @default(0)
+ format BigInt @default(0)
+ summaryformat Int @default(0) @db.TinyInt
+ attachment String? @db.VarChar(100)
+ publishstate String @default("draft") @db.VarChar(20)
+ lastmodified BigInt @default(0)
+ created BigInt @default(0)
+ usermodified BigInt?
+
+ @@unique([id, userid], map: "mdl_post_iduse_uix")
+ @@index([coursemoduleid], map: "mdl_post_cou2_ix")
+ @@index([courseid], map: "mdl_post_cou_ix")
+ @@index([lastmodified], map: "mdl_post_las_ix")
+ @@index([module], map: "mdl_post_mod_ix")
+ @@index([subject], map: "mdl_post_sub_ix")
+ @@index([usermodified], map: "mdl_post_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_profiling {
+ id BigInt @id @default(autoincrement())
+ runid String @unique(map: "mdl_prof_run_uix") @default("") @db.VarChar(32)
+ url String @default("") @db.VarChar(255)
+ data String @db.LongText
+ totalexecutiontime BigInt
+ totalcputime BigInt
+ totalcalls BigInt
+ totalmemory BigInt
+ runreference Int @default(0) @db.TinyInt
+ runcomment String @default("") @db.VarChar(255)
+ timecreated BigInt
+
+ @@index([timecreated, runreference], map: "mdl_prof_timrun_ix")
+ @@index([url, runreference], map: "mdl_prof_urlrun_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_qtype_ddimageortext {
+ id BigInt @id @default(autoincrement())
+ questionid BigInt @default(0)
+ shuffleanswers Int @default(1) @db.SmallInt
+ correctfeedback String @db.LongText
+ correctfeedbackformat Int @default(0) @db.TinyInt
+ partiallycorrectfeedback String @db.LongText
+ partiallycorrectfeedbackformat Int @default(0) @db.TinyInt
+ incorrectfeedback String @db.LongText
+ incorrectfeedbackformat Int @default(0) @db.TinyInt
+ shownumcorrect Int @default(0) @db.TinyInt
+
+ @@index([questionid], map: "mdl_qtypddim_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_qtype_ddimageortext_drags {
+ id BigInt @id @default(autoincrement())
+ questionid BigInt @default(0)
+ no BigInt @default(0)
+ draggroup BigInt @default(0)
+ infinite Int @default(0) @db.SmallInt
+ label String @db.LongText
+
+ @@index([questionid], map: "mdl_qtypddimdrag_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_qtype_ddimageortext_drops {
+ id BigInt @id @default(autoincrement())
+ questionid BigInt @default(0)
+ no BigInt @default(0)
+ xleft BigInt @default(0)
+ ytop BigInt @default(0)
+ choice BigInt @default(0)
+ label String @db.LongText
+
+ @@index([questionid], map: "mdl_qtypddimdrop_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_qtype_ddmarker {
+ id BigInt @id @default(autoincrement())
+ questionid BigInt @default(0)
+ shuffleanswers Int @default(1) @db.SmallInt
+ correctfeedback String @db.LongText
+ correctfeedbackformat Int @default(0) @db.TinyInt
+ partiallycorrectfeedback String @db.LongText
+ partiallycorrectfeedbackformat Int @default(0) @db.TinyInt
+ incorrectfeedback String @db.LongText
+ incorrectfeedbackformat Int @default(0) @db.TinyInt
+ shownumcorrect Int @default(0) @db.TinyInt
+ showmisplaced Int @default(0) @db.SmallInt
+
+ @@index([questionid], map: "mdl_qtypddma_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_qtype_ddmarker_drags {
+ id BigInt @id @default(autoincrement())
+ questionid BigInt @default(0)
+ no BigInt @default(0)
+ label String @db.LongText
+ infinite Int @default(0) @db.SmallInt
+ noofdrags BigInt @default(1)
+
+ @@index([questionid], map: "mdl_qtypddmadrag_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_qtype_ddmarker_drops {
+ id BigInt @id @default(autoincrement())
+ questionid BigInt @default(0)
+ no BigInt @default(0)
+ shape String? @db.VarChar(255)
+ coords String @db.LongText
+ choice BigInt @default(0)
+
+ @@index([questionid], map: "mdl_qtypddmadrop_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_qtype_essay_options {
+ id BigInt @id @default(autoincrement())
+ questionid BigInt @unique(map: "mdl_qtypessaopti_que_uix")
+ responseformat String @default("editor") @db.VarChar(16)
+ responserequired Int @default(1) @db.TinyInt
+ responsefieldlines Int @default(15) @db.SmallInt
+ minwordlimit BigInt?
+ maxwordlimit BigInt?
+ attachments Int @default(0) @db.SmallInt
+ attachmentsrequired Int @default(0) @db.SmallInt
+ graderinfo String? @db.LongText
+ graderinfoformat Int @default(0) @db.SmallInt
+ responsetemplate String? @db.LongText
+ responsetemplateformat Int @default(0) @db.SmallInt
+ maxbytes BigInt @default(0)
+ filetypeslist String? @db.LongText
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_qtype_match_options {
+ id BigInt @id @default(autoincrement())
+ questionid BigInt @unique(map: "mdl_qtypmatcopti_que_uix") @default(0)
+ shuffleanswers Int @default(1) @db.SmallInt
+ correctfeedback String @db.LongText
+ correctfeedbackformat Int @default(0) @db.TinyInt
+ partiallycorrectfeedback String @db.LongText
+ partiallycorrectfeedbackformat Int @default(0) @db.TinyInt
+ incorrectfeedback String @db.LongText
+ incorrectfeedbackformat Int @default(0) @db.TinyInt
+ shownumcorrect Int @default(0) @db.TinyInt
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_qtype_match_subquestions {
+ id BigInt @id @default(autoincrement())
+ questionid BigInt @default(0)
+ questiontext String @db.LongText
+ questiontextformat Int @default(0) @db.TinyInt
+ answertext String @default("") @db.VarChar(255)
+
+ @@index([questionid], map: "mdl_qtypmatcsubq_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_qtype_multichoice_options {
+ id BigInt @id @default(autoincrement())
+ questionid BigInt @unique(map: "mdl_qtypmultopti_que_uix") @default(0)
+ layout Int @default(0) @db.SmallInt
+ single Int @default(0) @db.SmallInt
+ shuffleanswers Int @default(1) @db.SmallInt
+ correctfeedback String @db.LongText
+ correctfeedbackformat Int @default(0) @db.TinyInt
+ partiallycorrectfeedback String @db.LongText
+ partiallycorrectfeedbackformat Int @default(0) @db.TinyInt
+ incorrectfeedback String @db.LongText
+ incorrectfeedbackformat Int @default(0) @db.TinyInt
+ answernumbering String @default("abc") @db.VarChar(10)
+ shownumcorrect Int @default(0) @db.TinyInt
+ showstandardinstruction Int @default(1) @db.TinyInt
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_qtype_randomsamatch_options {
+ id BigInt @id @default(autoincrement())
+ questionid BigInt @unique(map: "mdl_qtyprandopti_que_uix") @default(0)
+ choose BigInt @default(4)
+ subcats Int @default(1) @db.TinyInt
+ correctfeedback String @db.LongText
+ correctfeedbackformat Int @default(0) @db.TinyInt
+ partiallycorrectfeedback String @db.LongText
+ partiallycorrectfeedbackformat Int @default(0) @db.TinyInt
+ incorrectfeedback String @db.LongText
+ incorrectfeedbackformat Int @default(0) @db.TinyInt
+ shownumcorrect Int @default(0) @db.TinyInt
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_qtype_shortanswer_options {
+ id BigInt @id @default(autoincrement())
+ questionid BigInt @unique(map: "mdl_qtypshoropti_que_uix") @default(0)
+ usecase Int @default(0) @db.TinyInt
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question {
+ id BigInt @id @default(autoincrement())
+ parent BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ questiontext String @db.LongText
+ questiontextformat Int @default(0) @db.TinyInt
+ generalfeedback String @db.LongText
+ generalfeedbackformat Int @default(0) @db.TinyInt
+ defaultmark Decimal @default(1.0000000) @db.Decimal(12, 7)
+ penalty Decimal @default(0.3333333) @db.Decimal(12, 7)
+ qtype String @default("") @db.VarChar(20)
+ length BigInt @default(1)
+ stamp String @default("") @db.VarChar(255)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ createdby BigInt?
+ modifiedby BigInt?
+
+ @@index([createdby], map: "mdl_ques_cre_ix")
+ @@index([modifiedby], map: "mdl_ques_mod_ix")
+ @@index([parent], map: "mdl_ques_par_ix")
+ @@index([qtype], map: "mdl_ques_qty_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_answers {
+ id BigInt @id @default(autoincrement())
+ question BigInt @default(0)
+ answer String @db.LongText
+ answerformat Int @default(0) @db.TinyInt
+ fraction Decimal @default(0.0000000) @db.Decimal(12, 7)
+ feedback String @db.LongText
+ feedbackformat Int @default(0) @db.TinyInt
+
+ @@index([question], map: "mdl_quesansw_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_attempt_step_data {
+ id BigInt @id @default(autoincrement())
+ attemptstepid BigInt
+ name String @default("") @db.VarChar(32)
+ value String? @db.LongText
+
+ @@index([attemptstepid], map: "mdl_quesattestepdata_att_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_attempt_steps {
+ id BigInt @id @default(autoincrement())
+ questionattemptid BigInt
+ sequencenumber BigInt
+ state String @default("") @db.VarChar(13)
+ fraction Decimal? @db.Decimal(12, 7)
+ timecreated BigInt
+ userid BigInt?
+
+ @@unique([questionattemptid, sequencenumber], map: "mdl_quesattestep_queseq_uix")
+ @@index([questionattemptid], map: "mdl_quesattestep_que_ix")
+ @@index([userid], map: "mdl_quesattestep_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_attempts {
+ id BigInt @id @default(autoincrement())
+ questionusageid BigInt
+ slot BigInt
+ behaviour String @default("") @db.VarChar(32)
+ questionid BigInt
+ variant BigInt @default(1)
+ maxmark Decimal @db.Decimal(12, 7)
+ minfraction Decimal @db.Decimal(12, 7)
+ maxfraction Decimal @default(1.0000000) @db.Decimal(12, 7)
+ flagged Boolean @default(false)
+ questionsummary String? @db.LongText
+ rightanswer String? @db.LongText
+ responsesummary String? @db.LongText
+ timemodified BigInt
+
+ @@unique([questionusageid, slot], map: "mdl_quesatte_queslo_uix")
+ @@index([behaviour], map: "mdl_quesatte_beh_ix")
+ @@index([questionusageid], map: "mdl_quesatte_que2_ix")
+ @@index([questionid], map: "mdl_quesatte_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_bank_entries {
+ id BigInt @id @default(autoincrement())
+ questioncategoryid BigInt @default(0)
+ idnumber String? @db.VarChar(100)
+ ownerid BigInt?
+
+ @@unique([questioncategoryid, idnumber], map: "mdl_quesbankentr_queidn_uix")
+ @@index([ownerid], map: "mdl_quesbankentr_own_ix")
+ @@index([questioncategoryid], map: "mdl_quesbankentr_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_calculated {
+ id BigInt @id @default(autoincrement())
+ question BigInt @default(0)
+ answer BigInt @default(0)
+ tolerance String @default("0.0") @db.VarChar(20)
+ tolerancetype BigInt @default(1)
+ correctanswerlength BigInt @default(2)
+ correctanswerformat BigInt @default(2)
+
+ @@index([answer], map: "mdl_quescalc_ans_ix")
+ @@index([question], map: "mdl_quescalc_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_calculated_options {
+ id BigInt @id @default(autoincrement())
+ question BigInt @default(0)
+ synchronize Int @default(0) @db.TinyInt
+ single Int @default(0) @db.SmallInt
+ shuffleanswers Int @default(0) @db.SmallInt
+ correctfeedback String? @db.LongText
+ correctfeedbackformat Int @default(0) @db.TinyInt
+ partiallycorrectfeedback String? @db.LongText
+ partiallycorrectfeedbackformat Int @default(0) @db.TinyInt
+ incorrectfeedback String? @db.LongText
+ incorrectfeedbackformat Int @default(0) @db.TinyInt
+ answernumbering String @default("abc") @db.VarChar(10)
+ shownumcorrect Int @default(0) @db.TinyInt
+
+ @@index([question], map: "mdl_quescalcopti_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_categories {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(255)
+ contextid BigInt @default(0)
+ info String @db.LongText
+ infoformat Int @default(0) @db.TinyInt
+ stamp String @default("") @db.VarChar(255)
+ parent BigInt @default(0)
+ sortorder BigInt @default(999)
+ idnumber String? @db.VarChar(100)
+
+ @@unique([contextid, idnumber], map: "mdl_quescate_conidn_uix")
+ @@unique([contextid, stamp], map: "mdl_quescate_consta_uix")
+ @@index([contextid], map: "mdl_quescate_con_ix")
+ @@index([parent], map: "mdl_quescate_par_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_dataset_definitions {
+ id BigInt @id @default(autoincrement())
+ category BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ type BigInt @default(0)
+ options String @default("") @db.VarChar(255)
+ itemcount BigInt @default(0)
+
+ @@index([category], map: "mdl_quesdatadefi_cat_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_dataset_items {
+ id BigInt @id @default(autoincrement())
+ definition BigInt @default(0)
+ itemnumber BigInt @default(0)
+ value String @default("") @db.VarChar(255)
+
+ @@index([definition], map: "mdl_quesdataitem_def_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_datasets {
+ id BigInt @id @default(autoincrement())
+ question BigInt @default(0)
+ datasetdefinition BigInt @default(0)
+
+ @@index([datasetdefinition], map: "mdl_quesdata_dat_ix")
+ @@index([question], map: "mdl_quesdata_que_ix")
+ @@index([question, datasetdefinition], map: "mdl_quesdata_quedat_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_ddwtos {
+ id BigInt @id @default(autoincrement())
+ questionid BigInt @default(0)
+ shuffleanswers Int @default(1) @db.SmallInt
+ correctfeedback String @db.LongText
+ correctfeedbackformat Int @default(0) @db.TinyInt
+ partiallycorrectfeedback String @db.LongText
+ partiallycorrectfeedbackformat Int @default(0) @db.TinyInt
+ incorrectfeedback String @db.LongText
+ incorrectfeedbackformat Int @default(0) @db.TinyInt
+ shownumcorrect Int @default(0) @db.TinyInt
+
+ @@index([questionid], map: "mdl_quesddwt_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_gapselect {
+ id BigInt @id @default(autoincrement())
+ questionid BigInt @default(0)
+ shuffleanswers Int @default(1) @db.SmallInt
+ correctfeedback String @db.LongText
+ correctfeedbackformat Int @default(0) @db.TinyInt
+ partiallycorrectfeedback String @db.LongText
+ partiallycorrectfeedbackformat Int @default(0) @db.TinyInt
+ incorrectfeedback String @db.LongText
+ incorrectfeedbackformat Int @default(0) @db.TinyInt
+ shownumcorrect Int @default(0) @db.TinyInt
+
+ @@index([questionid], map: "mdl_quesgaps_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_hints {
+ id BigInt @id @default(autoincrement())
+ questionid BigInt
+ hint String @db.LongText
+ hintformat Int @default(0) @db.SmallInt
+ shownumcorrect Boolean?
+ clearwrong Boolean?
+ options String? @db.VarChar(255)
+
+ @@index([questionid], map: "mdl_queshint_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_multianswer {
+ id BigInt @id @default(autoincrement())
+ question BigInt @default(0)
+ sequence String @db.LongText
+
+ @@index([question], map: "mdl_quesmult_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_numerical {
+ id BigInt @id @default(autoincrement())
+ question BigInt @default(0)
+ answer BigInt @default(0)
+ tolerance String @default("0.0") @db.VarChar(255)
+
+ @@index([answer], map: "mdl_quesnume_ans_ix")
+ @@index([question], map: "mdl_quesnume_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_numerical_options {
+ id BigInt @id @default(autoincrement())
+ question BigInt @default(0)
+ showunits Int @default(0) @db.SmallInt
+ unitsleft Int @default(0) @db.SmallInt
+ unitgradingtype Int @default(0) @db.SmallInt
+ unitpenalty Decimal @default(0.1000000) @db.Decimal(12, 7)
+
+ @@index([question], map: "mdl_quesnumeopti_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_numerical_units {
+ id BigInt @id @default(autoincrement())
+ question BigInt @default(0)
+ multiplier Decimal @default(1.0000000000000000000) @db.Decimal(38, 19)
+ unit String @default("") @db.VarChar(50)
+
+ @@unique([question, unit], map: "mdl_quesnumeunit_queuni_uix")
+ @@index([question], map: "mdl_quesnumeunit_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_references {
+ id BigInt @id @default(autoincrement())
+ usingcontextid BigInt @default(0)
+ component String? @db.VarChar(100)
+ questionarea String? @db.VarChar(50)
+ itemid BigInt?
+ questionbankentryid BigInt @default(0)
+ version BigInt?
+
+ @@unique([usingcontextid, component, questionarea, itemid], map: "mdl_quesrefe_usicomqueite_uix")
+ @@index([questionbankentryid], map: "mdl_quesrefe_que_ix")
+ @@index([usingcontextid], map: "mdl_quesrefe_usi_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_response_analysis {
+ id BigInt @id @default(autoincrement())
+ hashcode String @default("") @db.VarChar(40)
+ whichtries String @default("") @db.VarChar(255)
+ timemodified BigInt
+ questionid BigInt
+ variant BigInt?
+ subqid String @default("") @db.VarChar(100)
+ aid String? @db.VarChar(100)
+ response String? @db.LongText
+ credit Decimal @db.Decimal(15, 5)
+
+ @@index([questionid], map: "mdl_quesrespanal_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_response_count {
+ id BigInt @id @default(autoincrement())
+ analysisid BigInt
+ try BigInt
+ rcount BigInt
+
+ @@index([analysisid], map: "mdl_quesrespcoun_ana_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_set_references {
+ id BigInt @id @default(autoincrement())
+ usingcontextid BigInt @default(0)
+ component String? @db.VarChar(100)
+ questionarea String? @db.VarChar(50)
+ itemid BigInt?
+ questionscontextid BigInt @default(0)
+ filtercondition String? @db.LongText
+
+ @@unique([usingcontextid, component, questionarea, itemid], map: "mdl_quessetrefe_usicomquei_uix")
+ @@index([questionscontextid], map: "mdl_quessetrefe_que_ix")
+ @@index([usingcontextid], map: "mdl_quessetrefe_usi_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_statistics {
+ id BigInt @id @default(autoincrement())
+ hashcode String @default("") @db.VarChar(40)
+ timemodified BigInt
+ questionid BigInt
+ slot BigInt?
+ subquestion Int @db.SmallInt
+ variant BigInt?
+ s BigInt @default(0)
+ effectiveweight Decimal? @db.Decimal(15, 5)
+ negcovar Int @default(0) @db.TinyInt
+ discriminationindex Decimal? @db.Decimal(15, 5)
+ discriminativeefficiency Decimal? @db.Decimal(15, 5)
+ sd Decimal? @db.Decimal(15, 10)
+ facility Decimal? @db.Decimal(15, 10)
+ subquestions String? @db.LongText
+ maxmark Decimal? @db.Decimal(12, 7)
+ positions String? @db.LongText
+ randomguessscore Decimal? @db.Decimal(12, 7)
+
+ @@index([questionid], map: "mdl_quesstat_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_truefalse {
+ id BigInt @id @default(autoincrement())
+ question BigInt @default(0)
+ trueanswer BigInt @default(0)
+ falseanswer BigInt @default(0)
+ showstandardinstruction Int @default(1) @db.TinyInt
+
+ @@index([question], map: "mdl_questrue_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_usages {
+ id BigInt @id @default(autoincrement())
+ contextid BigInt
+ component String @default("") @db.VarChar(255)
+ preferredbehaviour String @default("") @db.VarChar(32)
+
+ @@index([contextid], map: "mdl_quesusag_con_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_question_versions {
+ id BigInt @id @default(autoincrement())
+ questionbankentryid BigInt @default(0)
+ version BigInt @default(1)
+ questionid BigInt @default(0)
+ status String @default("ready") @db.VarChar(10)
+
+ @@index([questionid], map: "mdl_quesvers_que2_ix")
+ @@index([questionbankentryid], map: "mdl_quesvers_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_questionnaire {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ qtype BigInt @default(0)
+ respondenttype String @default("fullname") @db.VarChar(9)
+ resp_eligible String @default("all") @db.VarChar(8)
+ resp_view Int @default(0) @db.TinyInt
+ notifications Boolean @default(false)
+ opendate BigInt @default(0)
+ closedate BigInt @default(0)
+ resume Int @default(0) @db.TinyInt
+ navigate Int @default(0) @db.TinyInt
+ grade BigInt @default(0)
+ sid BigInt @default(0)
+ timemodified BigInt @default(0)
+ completionsubmit Boolean @default(false)
+ autonum Int @default(3) @db.TinyInt
+ progressbar Boolean @default(false)
+
+ @@index([course], map: "mdl_ques_cou_ix")
+ @@index([resp_view], map: "mdl_ques_res_ix")
+ @@index([sid], map: "mdl_ques_sid_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_questionnaire_dependency {
+ id BigInt @id @default(autoincrement())
+ questionid BigInt @default(0)
+ surveyid BigInt
+ dependquestionid BigInt @default(0)
+ dependchoiceid BigInt @default(0)
+ dependlogic Int @default(0) @db.TinyInt
+ dependandor String @default("") @db.VarChar(4)
+
+ @@index([questionid], map: "mdl_quesdepe_que_ix")
+ @@index([surveyid], map: "mdl_quesdepe_sur_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_questionnaire_fb_sections {
+ id BigInt @id @default(autoincrement())
+ surveyid BigInt @default(0)
+ section Int? @db.TinyInt
+ scorecalculation String? @db.LongText
+ sectionlabel String? @db.VarChar(50)
+ sectionheading String? @db.LongText
+ sectionheadingformat Int? @default(1) @db.TinyInt
+
+ @@index([surveyid], map: "mdl_quesfbsect_sur_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_questionnaire_feedback {
+ id BigInt @id @default(autoincrement())
+ sectionid BigInt @default(0)
+ feedbacklabel String? @db.VarChar(50)
+ feedbacktext String? @db.LongText
+ feedbacktextformat Int? @default(1) @db.TinyInt
+ minscore Decimal? @default(0.00000) @db.Decimal(10, 5)
+ maxscore Decimal? @default(101.00000) @db.Decimal(10, 5)
+
+ @@index([sectionid], map: "mdl_quesfeed_sec_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_questionnaire_quest_choice {
+ id BigInt @id @default(autoincrement())
+ question_id BigInt @default(0)
+ content String @db.LongText
+ value String? @db.LongText
+
+ @@index([question_id], map: "mdl_quesqueschoi_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_questionnaire_question {
+ id BigInt @id @default(autoincrement())
+ surveyid BigInt @default(0)
+ name String? @db.VarChar(30)
+ type_id BigInt @default(0)
+ result_id BigInt?
+ length BigInt @default(0)
+ precise BigInt @default(0)
+ position BigInt @default(0)
+ content String @db.LongText
+ required String @default("n") @db.VarChar(1)
+ deleted String @default("n") @db.VarChar(1)
+ extradata String? @db.LongText
+
+ @@index([surveyid, deleted], map: "mdl_quesques_surdel_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_questionnaire_question_type {
+ id BigInt @id @default(autoincrement())
+ typeid BigInt @unique(map: "mdl_quesquestype_typ_uix") @default(0)
+ type String @default("") @db.VarChar(32)
+ has_choices String @default("y") @db.VarChar(1)
+ response_table String? @db.VarChar(32)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_questionnaire_resp_multiple {
+ id BigInt @id @default(autoincrement())
+ response_id BigInt @default(0)
+ question_id BigInt @default(0)
+ choice_id BigInt @default(0)
+
+ @@index([response_id, question_id, choice_id], map: "mdl_quesrespmult_resquecho_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_questionnaire_resp_single {
+ id BigInt @id @default(autoincrement())
+ response_id BigInt @default(0)
+ question_id BigInt @default(0)
+ choice_id BigInt @default(0)
+
+ @@index([response_id, question_id], map: "mdl_quesrespsing_resque_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_questionnaire_response {
+ id BigInt @id @default(autoincrement())
+ questionnaireid BigInt @default(0)
+ submitted BigInt @default(0)
+ complete String @default("n") @db.VarChar(1)
+ grade BigInt @default(0)
+ userid BigInt?
+
+ @@index([questionnaireid], map: "mdl_quesresp_que_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_questionnaire_response_bool {
+ id BigInt @id @default(autoincrement())
+ response_id BigInt @default(0)
+ question_id BigInt @default(0)
+ choice_id String @default("y") @db.VarChar(1)
+
+ @@index([response_id, question_id], map: "mdl_quesrespbool_resque_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_questionnaire_response_date {
+ id BigInt @id @default(autoincrement())
+ response_id BigInt @default(0)
+ question_id BigInt @default(0)
+ response String? @db.LongText
+
+ @@index([response_id, question_id], map: "mdl_quesrespdate_resque_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_questionnaire_response_other {
+ id BigInt @id @default(autoincrement())
+ response_id BigInt @default(0)
+ question_id BigInt @default(0)
+ choice_id BigInt @default(0)
+ response String? @db.LongText
+
+ @@index([response_id, question_id, choice_id], map: "mdl_quesrespothe_resquecho_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_questionnaire_response_rank {
+ id BigInt @id @default(autoincrement())
+ response_id BigInt @default(0)
+ question_id BigInt @default(0)
+ choice_id BigInt @default(0)
+ rankvalue BigInt @default(0)
+
+ @@index([response_id, question_id, choice_id], map: "mdl_quesresprank_resquecho_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_questionnaire_response_text {
+ id BigInt @id @default(autoincrement())
+ response_id BigInt @default(0)
+ question_id BigInt @default(0)
+ response String? @db.LongText
+
+ @@index([response_id, question_id], map: "mdl_quesresptext_resque_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_questionnaire_survey {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(255)
+ courseid BigInt?
+ realm String @default("") @db.VarChar(64)
+ status BigInt @default(0)
+ title String @default("") @db.VarChar(255)
+ email String? @db.VarChar(255)
+ subtitle String? @db.LongText
+ info String? @db.LongText
+ theme String? @db.VarChar(64)
+ thanks_page String? @db.VarChar(255)
+ thank_head String? @db.VarChar(255)
+ thank_body String? @db.LongText
+ feedbacksections Int? @default(0) @db.TinyInt
+ feedbacknotes String? @db.LongText
+ feedbackscores Boolean? @default(false)
+ chart_type String? @db.VarChar(64)
+
+ @@index([courseid], map: "mdl_quessurv_cou_ix")
+ @@index([name], map: "mdl_quessurv_nam_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_quiz {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ timeopen BigInt @default(0)
+ timeclose BigInt @default(0)
+ timelimit BigInt @default(0)
+ overduehandling String @default("autoabandon") @db.VarChar(16)
+ graceperiod BigInt @default(0)
+ preferredbehaviour String @default("") @db.VarChar(32)
+ canredoquestions Int @default(0) @db.SmallInt
+ attempts Int @default(0) @db.MediumInt
+ attemptonlast Int @default(0) @db.SmallInt
+ grademethod Int @default(1) @db.SmallInt
+ decimalpoints Int @default(2) @db.SmallInt
+ questiondecimalpoints Int @default(-1) @db.SmallInt
+ reviewattempt Int @default(0) @db.MediumInt
+ reviewcorrectness Int @default(0) @db.MediumInt
+ reviewmarks Int @default(0) @db.MediumInt
+ reviewspecificfeedback Int @default(0) @db.MediumInt
+ reviewgeneralfeedback Int @default(0) @db.MediumInt
+ reviewrightanswer Int @default(0) @db.MediumInt
+ reviewoverallfeedback Int @default(0) @db.MediumInt
+ questionsperpage BigInt @default(0)
+ navmethod String @default("free") @db.VarChar(16)
+ shuffleanswers Int @default(0) @db.SmallInt
+ sumgrades Decimal @default(0.00000) @db.Decimal(10, 5)
+ grade Decimal @default(0.00000) @db.Decimal(10, 5)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ password String @default("") @db.VarChar(255)
+ subnet String @default("") @db.VarChar(255)
+ browsersecurity String @default("") @db.VarChar(32)
+ delay1 BigInt @default(0)
+ delay2 BigInt @default(0)
+ showuserpicture Int @default(0) @db.SmallInt
+ showblocks Int @default(0) @db.SmallInt
+ completionattemptsexhausted Boolean? @default(false)
+ completionminattempts BigInt @default(0)
+ allowofflineattempts Boolean? @default(false)
+
+ @@index([course], map: "mdl_quiz_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_quiz_attempts {
+ id BigInt @id @default(autoincrement())
+ quiz BigInt @default(0)
+ userid BigInt @default(0)
+ attempt Int @default(0) @db.MediumInt
+ uniqueid BigInt @unique(map: "mdl_quizatte_uni_uix") @default(0)
+ layout String @db.LongText
+ currentpage BigInt @default(0)
+ preview Int @default(0) @db.SmallInt
+ state String @default("inprogress") @db.VarChar(16)
+ timestart BigInt @default(0)
+ timefinish BigInt @default(0)
+ timemodified BigInt @default(0)
+ timemodifiedoffline BigInt @default(0)
+ timecheckstate BigInt? @default(0)
+ sumgrades Decimal? @db.Decimal(10, 5)
+ gradednotificationsenttime BigInt?
+
+ @@unique([quiz, userid, attempt], map: "mdl_quizatte_quiuseatt_uix")
+ @@index([quiz], map: "mdl_quizatte_qui_ix")
+ @@index([state, timecheckstate], map: "mdl_quizatte_statim_ix")
+ @@index([userid], map: "mdl_quizatte_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_quiz_feedback {
+ id BigInt @id @default(autoincrement())
+ quizid BigInt @default(0)
+ feedbacktext String @db.LongText
+ feedbacktextformat Int @default(0) @db.TinyInt
+ mingrade Decimal @default(0.00000) @db.Decimal(10, 5)
+ maxgrade Decimal @default(0.00000) @db.Decimal(10, 5)
+
+ @@index([quizid], map: "mdl_quizfeed_qui_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_quiz_grades {
+ id BigInt @id @default(autoincrement())
+ quiz BigInt @default(0)
+ userid BigInt @default(0)
+ grade Decimal @default(0.00000) @db.Decimal(10, 5)
+ timemodified BigInt @default(0)
+
+ @@index([quiz], map: "mdl_quizgrad_qui_ix")
+ @@index([userid], map: "mdl_quizgrad_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_quiz_overrides {
+ id BigInt @id @default(autoincrement())
+ quiz BigInt @default(0)
+ groupid BigInt?
+ userid BigInt?
+ timeopen BigInt?
+ timeclose BigInt?
+ timelimit BigInt?
+ attempts Int? @db.MediumInt
+ password String? @db.VarChar(255)
+
+ @@index([groupid], map: "mdl_quizover_gro_ix")
+ @@index([quiz], map: "mdl_quizover_qui_ix")
+ @@index([userid], map: "mdl_quizover_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_quiz_overview_regrades {
+ id BigInt @id @default(autoincrement())
+ questionusageid BigInt
+ slot BigInt
+ newfraction Decimal? @db.Decimal(12, 7)
+ oldfraction Decimal? @db.Decimal(12, 7)
+ regraded Int @db.SmallInt
+ timemodified BigInt
+
+ @@index([questionusageid, slot], map: "mdl_quizoverregr_queslo_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_quiz_reports {
+ id BigInt @id @default(autoincrement())
+ name String? @unique(map: "mdl_quizrepo_nam_uix") @db.VarChar(255)
+ displayorder BigInt
+ capability String? @db.VarChar(255)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_quiz_sections {
+ id BigInt @id @default(autoincrement())
+ quizid BigInt
+ firstslot BigInt
+ heading String? @db.VarChar(1333)
+ shufflequestions Int @default(0) @db.SmallInt
+
+ @@unique([quizid, firstslot], map: "mdl_quizsect_quifir_uix")
+ @@index([quizid], map: "mdl_quizsect_qui_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_quiz_slots {
+ id BigInt @id @default(autoincrement())
+ slot BigInt
+ quizid BigInt @default(0)
+ page BigInt
+ requireprevious Int @default(0) @db.SmallInt
+ maxmark Decimal @default(0.0000000) @db.Decimal(12, 7)
+
+ @@unique([quizid, slot], map: "mdl_quizslot_quislo_uix")
+ @@index([quizid], map: "mdl_quizslot_qui_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_quiz_statistics {
+ id BigInt @id @default(autoincrement())
+ hashcode String @default("") @db.VarChar(40)
+ whichattempts Int @db.SmallInt
+ timemodified BigInt
+ firstattemptscount BigInt
+ highestattemptscount BigInt
+ lastattemptscount BigInt
+ allattemptscount BigInt
+ firstattemptsavg Decimal? @db.Decimal(15, 5)
+ highestattemptsavg Decimal? @db.Decimal(15, 5)
+ lastattemptsavg Decimal? @db.Decimal(15, 5)
+ allattemptsavg Decimal? @db.Decimal(15, 5)
+ median Decimal? @db.Decimal(15, 5)
+ standarddeviation Decimal? @db.Decimal(15, 5)
+ skewness Decimal? @db.Decimal(15, 10)
+ kurtosis Decimal? @db.Decimal(15, 5)
+ cic Decimal? @db.Decimal(15, 10)
+ errorratio Decimal? @db.Decimal(15, 10)
+ standarderror Decimal? @db.Decimal(15, 10)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_quizaccess_seb_quizsettings {
+ id BigInt @id @default(autoincrement())
+ quizid BigInt @unique(map: "mdl_quizsebquiz_qui_uix")
+ cmid BigInt @unique(map: "mdl_quizsebquiz_cmi_uix")
+ templateid BigInt
+ requiresafeexambrowser Boolean
+ showsebtaskbar Boolean?
+ showwificontrol Boolean?
+ showreloadbutton Boolean?
+ showtime Boolean?
+ showkeyboardlayout Boolean?
+ allowuserquitseb Boolean?
+ quitpassword String? @db.LongText
+ linkquitseb String? @db.LongText
+ userconfirmquit Boolean?
+ enableaudiocontrol Boolean?
+ muteonstartup Boolean?
+ allowspellchecking Boolean?
+ allowreloadinexam Boolean?
+ activateurlfiltering Boolean?
+ filterembeddedcontent Boolean?
+ expressionsallowed String? @db.LongText
+ regexallowed String? @db.LongText
+ expressionsblocked String? @db.LongText
+ regexblocked String? @db.LongText
+ allowedbrowserexamkeys String? @db.LongText
+ showsebdownloadlink Boolean?
+ usermodified BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([templateid], map: "mdl_quizsebquiz_tem_ix")
+ @@index([usermodified], map: "mdl_quizsebquiz_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_quizaccess_seb_template {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(255)
+ description String @db.LongText
+ content String @db.LongText
+ enabled Boolean
+ sortorder BigInt
+ usermodified BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([usermodified], map: "mdl_quizsebtemp_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_rating {
+ id BigInt @id @default(autoincrement())
+ contextid BigInt
+ component String @default("") @db.VarChar(100)
+ ratingarea String @default("") @db.VarChar(50)
+ itemid BigInt
+ scaleid BigInt
+ rating BigInt
+ userid BigInt
+ timecreated BigInt
+ timemodified BigInt
+
+ @@index([component, ratingarea, contextid, itemid], map: "mdl_rati_comratconite_ix")
+ @@index([contextid], map: "mdl_rati_con_ix")
+ @@index([scaleid], map: "mdl_rati_sca_ix")
+ @@index([userid], map: "mdl_rati_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_registration_hubs {
+ id BigInt @id @default(autoincrement())
+ token String @default("") @db.VarChar(255)
+ hubname String @default("") @db.VarChar(255)
+ huburl String @default("") @db.VarChar(255)
+ confirmed Boolean @default(false)
+ secret String? @db.VarChar(255)
+ timemodified BigInt @default(0)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_reportbuilder_audience {
+ id BigInt @id @default(autoincrement())
+ reportid BigInt
+ heading String? @db.VarChar(255)
+ classname String @default("") @db.VarChar(255)
+ configdata String @db.LongText
+ usercreated BigInt @default(0)
+ usermodified BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([reportid], map: "mdl_repoaudi_rep_ix")
+ @@index([usermodified], map: "mdl_repoaudi_use2_ix")
+ @@index([usercreated], map: "mdl_repoaudi_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_reportbuilder_column {
+ id BigInt @id @default(autoincrement())
+ reportid BigInt @default(0)
+ uniqueidentifier String @default("") @db.VarChar(255)
+ aggregation String? @db.VarChar(32)
+ heading String? @db.VarChar(255)
+ columnorder BigInt
+ sortenabled Boolean @default(false)
+ sortdirection Boolean
+ sortorder BigInt?
+ usercreated BigInt @default(0)
+ usermodified BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([reportid], map: "mdl_repocolu_rep_ix")
+ @@index([usermodified], map: "mdl_repocolu_use2_ix")
+ @@index([usercreated], map: "mdl_repocolu_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_reportbuilder_filter {
+ id BigInt @id @default(autoincrement())
+ reportid BigInt @default(0)
+ uniqueidentifier String @default("") @db.VarChar(255)
+ heading String? @db.VarChar(255)
+ iscondition Boolean @default(false)
+ filterorder BigInt
+ usercreated BigInt @default(0)
+ usermodified BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([reportid], map: "mdl_repofilt_rep_ix")
+ @@index([usermodified], map: "mdl_repofilt_use2_ix")
+ @@index([usercreated], map: "mdl_repofilt_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_reportbuilder_report {
+ id BigInt @id @default(autoincrement())
+ name String? @db.VarChar(255)
+ source String @default("") @db.VarChar(255)
+ type Int @default(0) @db.TinyInt
+ uniquerows Boolean @default(false)
+ conditiondata String? @db.LongText
+ settingsdata String? @db.LongText
+ contextid BigInt
+ component String @default("") @db.VarChar(100)
+ area String @default("") @db.VarChar(100)
+ itemid BigInt @default(0)
+ usercreated BigInt @default(0)
+ usermodified BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([contextid], map: "mdl_reporepo_con_ix")
+ @@index([usermodified], map: "mdl_reporepo_use2_ix")
+ @@index([usercreated], map: "mdl_reporepo_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_reportbuilder_schedule {
+ id BigInt @id @default(autoincrement())
+ reportid BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ enabled Boolean @default(true)
+ audiences String @db.LongText
+ format String @default("") @db.VarChar(255)
+ subject String @default("") @db.VarChar(255)
+ message String @db.LongText
+ messageformat BigInt
+ userviewas BigInt @default(0)
+ timescheduled BigInt @default(0)
+ recurrence BigInt @default(0)
+ reportempty BigInt @default(0)
+ timelastsent BigInt @default(0)
+ timenextsend BigInt @default(0)
+ usercreated BigInt @default(0)
+ usermodified BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([reportid], map: "mdl_reposche_rep_ix")
+ @@index([usercreated], map: "mdl_reposche_use2_ix")
+ @@index([usermodified], map: "mdl_reposche_use3_ix")
+ @@index([userviewas], map: "mdl_reposche_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_repository {
+ id BigInt @id @default(autoincrement())
+ type String @default("") @db.VarChar(255)
+ visible Boolean? @default(true)
+ sortorder BigInt @default(0)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_repository_instance_config {
+ id BigInt @id @default(autoincrement())
+ instanceid BigInt
+ name String @default("") @db.VarChar(255)
+ value String? @db.LongText
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_repository_instances {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(255)
+ typeid BigInt
+ userid BigInt @default(0)
+ contextid BigInt
+ username String? @db.VarChar(255)
+ password String? @db.VarChar(255)
+ timecreated BigInt?
+ timemodified BigInt?
+ readonly Boolean @default(false)
+
+ @@index([contextid], map: "mdl_repoinst_con_ix")
+ @@index([userid], map: "mdl_repoinst_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_repository_onedrive_access {
+ id BigInt @id @default(autoincrement())
+ timemodified BigInt
+ timecreated BigInt
+ usermodified BigInt
+ permissionid String @default("") @db.VarChar(255)
+ itemid String @default("") @db.VarChar(255)
+
+ @@index([usermodified], map: "mdl_repoonedacce_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_resource {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String? @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ tobemigrated Int @default(0) @db.SmallInt
+ legacyfiles Int @default(0) @db.SmallInt
+ legacyfileslast BigInt?
+ display Int @default(0) @db.SmallInt
+ displayoptions String? @db.LongText
+ filterfiles Int @default(0) @db.SmallInt
+ revision BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([course], map: "mdl_reso_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_resource_old {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ type String @default("") @db.VarChar(30)
+ reference String @default("") @db.VarChar(255)
+ intro String? @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ alltext String @db.LongText
+ popup String @db.LongText
+ options String @default("") @db.VarChar(255)
+ timemodified BigInt @default(0)
+ oldid BigInt @unique(map: "mdl_resoold_old_uix")
+ cmid BigInt?
+ newmodule String? @db.VarChar(50)
+ newid BigInt?
+ migrated BigInt @default(0)
+
+ @@index([cmid], map: "mdl_resoold_cmi_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_role {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(255)
+ shortname String @unique(map: "mdl_role_sho_uix") @default("") @db.VarChar(100)
+ description String @db.LongText
+ sortorder BigInt @unique(map: "mdl_role_sor_uix") @default(0)
+ archetype String @default("") @db.VarChar(30)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_role_allow_assign {
+ id BigInt @id @default(autoincrement())
+ roleid BigInt @default(0)
+ allowassign BigInt @default(0)
+
+ @@unique([roleid, allowassign], map: "mdl_rolealloassi_rolall_uix")
+ @@index([allowassign], map: "mdl_rolealloassi_all_ix")
+ @@index([roleid], map: "mdl_rolealloassi_rol_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_role_allow_override {
+ id BigInt @id @default(autoincrement())
+ roleid BigInt @default(0)
+ allowoverride BigInt @default(0)
+
+ @@unique([roleid, allowoverride], map: "mdl_rolealloover_rolall_uix")
+ @@index([allowoverride], map: "mdl_rolealloover_all_ix")
+ @@index([roleid], map: "mdl_rolealloover_rol_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_role_allow_switch {
+ id BigInt @id @default(autoincrement())
+ roleid BigInt
+ allowswitch BigInt
+
+ @@unique([roleid, allowswitch], map: "mdl_rolealloswit_rolall_uix")
+ @@index([allowswitch], map: "mdl_rolealloswit_all_ix")
+ @@index([roleid], map: "mdl_rolealloswit_rol_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_role_allow_view {
+ id BigInt @id @default(autoincrement())
+ roleid BigInt
+ allowview BigInt
+
+ @@unique([roleid, allowview], map: "mdl_rolealloview_rolall_uix")
+ @@index([allowview], map: "mdl_rolealloview_all_ix")
+ @@index([roleid], map: "mdl_rolealloview_rol_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_role_assignments {
+ id BigInt @id @default(autoincrement())
+ roleid BigInt @default(0)
+ contextid BigInt @default(0)
+ userid BigInt @default(0)
+ timemodified BigInt @default(0)
+ modifierid BigInt @default(0)
+ component String @default("") @db.VarChar(100)
+ itemid BigInt @default(0)
+ sortorder BigInt @default(0)
+
+ @@index([component, itemid, userid], map: "mdl_roleassi_comiteuse_ix")
+ @@index([contextid], map: "mdl_roleassi_con_ix")
+ @@index([roleid], map: "mdl_roleassi_rol_ix")
+ @@index([roleid, contextid], map: "mdl_roleassi_rolcon_ix")
+ @@index([sortorder], map: "mdl_roleassi_sor_ix")
+ @@index([userid], map: "mdl_roleassi_use_ix")
+ @@index([userid, contextid, roleid], map: "mdl_roleassi_useconrol_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_role_capabilities {
+ id BigInt @id @default(autoincrement())
+ contextid BigInt @default(0)
+ roleid BigInt @default(0)
+ capability String @default("") @db.VarChar(255)
+ permission BigInt @default(0)
+ timemodified BigInt @default(0)
+ modifierid BigInt @default(0)
+
+ @@unique([roleid, contextid, capability], map: "mdl_rolecapa_rolconcap_uix")
+ @@index([capability], map: "mdl_rolecapa_cap_ix")
+ @@index([contextid], map: "mdl_rolecapa_con_ix")
+ @@index([modifierid], map: "mdl_rolecapa_mod_ix")
+ @@index([roleid], map: "mdl_rolecapa_rol_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_role_context_levels {
+ id BigInt @id @default(autoincrement())
+ roleid BigInt
+ contextlevel BigInt
+
+ @@unique([contextlevel, roleid], map: "mdl_rolecontleve_conrol_uix")
+ @@index([roleid], map: "mdl_rolecontleve_rol_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_role_names {
+ id BigInt @id @default(autoincrement())
+ roleid BigInt @default(0)
+ contextid BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+
+ @@unique([roleid, contextid], map: "mdl_rolename_rolcon_uix")
+ @@index([contextid], map: "mdl_rolename_con_ix")
+ @@index([roleid], map: "mdl_rolename_rol_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_scale {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt @default(0)
+ userid BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ scale String @db.LongText
+ description String @db.LongText
+ descriptionformat Int @default(0) @db.TinyInt
+ timemodified BigInt @default(0)
+
+ @@index([courseid], map: "mdl_scal_cou_ix")
+ @@index([userid], map: "mdl_scal_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_scale_history {
+ id BigInt @id @default(autoincrement())
+ action BigInt @default(0)
+ oldid BigInt
+ source String? @db.VarChar(255)
+ timemodified BigInt?
+ loggeduser BigInt?
+ courseid BigInt @default(0)
+ userid BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ scale String @db.LongText
+ description String @db.LongText
+
+ @@index([action], map: "mdl_scalhist_act_ix")
+ @@index([courseid], map: "mdl_scalhist_cou_ix")
+ @@index([loggeduser], map: "mdl_scalhist_log_ix")
+ @@index([oldid], map: "mdl_scalhist_old_ix")
+ @@index([timemodified], map: "mdl_scalhist_tim_ix")
+ @@index([userid], map: "mdl_scalhist_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_scorm {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ scormtype String @default("local") @db.VarChar(50)
+ reference String @default("") @db.VarChar(255)
+ intro String @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ version String @default("") @db.VarChar(9)
+ maxgrade Float @default(0)
+ grademethod Int @default(0) @db.TinyInt
+ whatgrade BigInt @default(0)
+ maxattempt BigInt @default(1)
+ forcecompleted Boolean @default(false)
+ forcenewattempt Boolean @default(false)
+ lastattemptlock Boolean @default(false)
+ masteryoverride Boolean @default(true)
+ displayattemptstatus Boolean @default(true)
+ displaycoursestructure Boolean @default(false)
+ updatefreq Boolean @default(false)
+ sha1hash String? @db.VarChar(40)
+ md5hash String @default("") @db.VarChar(32)
+ revision BigInt @default(0)
+ launch BigInt @default(0)
+ skipview Boolean @default(true)
+ hidebrowse Boolean @default(false)
+ hidetoc Boolean @default(false)
+ nav Boolean @default(true)
+ navpositionleft BigInt? @default(-100)
+ navpositiontop BigInt? @default(-100)
+ auto Boolean @default(false)
+ popup Boolean @default(false)
+ options String @default("") @db.VarChar(255)
+ width BigInt @default(100)
+ height BigInt @default(600)
+ timeopen BigInt @default(0)
+ timeclose BigInt @default(0)
+ timemodified BigInt @default(0)
+ completionstatusrequired Boolean?
+ completionscorerequired BigInt?
+ completionstatusallscos Boolean?
+ autocommit Boolean @default(false)
+
+ @@index([course], map: "mdl_scor_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_scorm_aicc_session {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ scormid BigInt @default(0)
+ hacpsession String @default("") @db.VarChar(255)
+ scoid BigInt? @default(0)
+ scormmode String? @db.VarChar(50)
+ scormstatus String? @db.VarChar(255)
+ attempt BigInt?
+ lessonstatus String? @db.VarChar(255)
+ sessiontime String? @db.VarChar(255)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@index([scormid], map: "mdl_scoraiccsess_sco_ix")
+ @@index([userid], map: "mdl_scoraiccsess_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_scorm_scoes {
+ id BigInt @id @default(autoincrement())
+ scorm BigInt @default(0)
+ manifest String @default("") @db.VarChar(255)
+ organization String @default("") @db.VarChar(255)
+ parent String @default("") @db.VarChar(255)
+ identifier String @default("") @db.VarChar(255)
+ launch String @db.LongText
+ scormtype String @default("") @db.VarChar(5)
+ title String @default("") @db.VarChar(255)
+ sortorder BigInt @default(0)
+
+ @@index([scorm], map: "mdl_scorscoe_sco_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_scorm_scoes_data {
+ id BigInt @id @default(autoincrement())
+ scoid BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ value String @db.LongText
+
+ @@index([scoid], map: "mdl_scorscoedata_sco_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_scorm_scoes_track {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ scormid BigInt @default(0)
+ scoid BigInt @default(0)
+ attempt BigInt @default(1)
+ element String @default("") @db.VarChar(255)
+ value String @db.LongText
+ timemodified BigInt @default(0)
+
+ @@unique([userid, scormid, scoid, attempt, element], map: "mdl_scorscoetrac_usescosco_uix")
+ @@index([scoid], map: "mdl_scorscoetrac_sco2_ix")
+ @@index([scormid], map: "mdl_scorscoetrac_sco_ix")
+ @@index([userid], map: "mdl_scorscoetrac_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_scorm_seq_mapinfo {
+ id BigInt @id @default(autoincrement())
+ scoid BigInt @default(0)
+ objectiveid BigInt @default(0)
+ targetobjectiveid BigInt @default(0)
+ readsatisfiedstatus Boolean @default(true)
+ readnormalizedmeasure Boolean @default(true)
+ writesatisfiedstatus Boolean @default(false)
+ writenormalizedmeasure Boolean @default(false)
+
+ @@unique([scoid, id, objectiveid], map: "mdl_scorseqmapi_scoidobj_uix")
+ @@index([objectiveid], map: "mdl_scorseqmapi_obj_ix")
+ @@index([scoid], map: "mdl_scorseqmapi_sco_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_scorm_seq_objective {
+ id BigInt @id @default(autoincrement())
+ scoid BigInt @default(0)
+ primaryobj Boolean @default(false)
+ objectiveid String @default("") @db.VarChar(255)
+ satisfiedbymeasure Boolean @default(true)
+ minnormalizedmeasure Float @default(0.0000) @db.Float
+
+ @@unique([scoid, id], map: "mdl_scorseqobje_scoid_uix")
+ @@index([scoid], map: "mdl_scorseqobje_sco_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_scorm_seq_rolluprule {
+ id BigInt @id @default(autoincrement())
+ scoid BigInt @default(0)
+ childactivityset String @default("") @db.VarChar(15)
+ minimumcount BigInt @default(0)
+ minimumpercent Float @default(0.0000) @db.Float
+ conditioncombination String @default("all") @db.VarChar(3)
+ action String @default("") @db.VarChar(15)
+
+ @@unique([scoid, id], map: "mdl_scorseqroll_scoid_uix")
+ @@index([scoid], map: "mdl_scorseqroll_sco_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_scorm_seq_rolluprulecond {
+ id BigInt @id @default(autoincrement())
+ scoid BigInt @default(0)
+ rollupruleid BigInt @default(0)
+ operator String @default("noOp") @db.VarChar(5)
+ cond String @default("") @db.VarChar(25)
+
+ @@unique([scoid, rollupruleid, id], map: "mdl_scorseqroll_scorolid_uix")
+ @@index([rollupruleid], map: "mdl_scorseqroll_rol_ix")
+ @@index([scoid], map: "mdl_scorseqroll_sco2_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_scorm_seq_rulecond {
+ id BigInt @id @default(autoincrement())
+ scoid BigInt @default(0)
+ ruleconditionsid BigInt @default(0)
+ refrencedobjective String @default("") @db.VarChar(255)
+ measurethreshold Float @default(0.0000) @db.Float
+ operator String @default("noOp") @db.VarChar(5)
+ cond String @default("always") @db.VarChar(30)
+
+ @@unique([id, scoid, ruleconditionsid], map: "mdl_scorseqrule_idscorul_uix")
+ @@index([ruleconditionsid], map: "mdl_scorseqrule_rul_ix")
+ @@index([scoid], map: "mdl_scorseqrule_sco2_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_scorm_seq_ruleconds {
+ id BigInt @id @default(autoincrement())
+ scoid BigInt @default(0)
+ conditioncombination String @default("all") @db.VarChar(3)
+ ruletype Int @default(0) @db.TinyInt
+ action String @default("") @db.VarChar(25)
+
+ @@unique([scoid, id], map: "mdl_scorseqrule_scoid_uix")
+ @@index([scoid], map: "mdl_scorseqrule_sco_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_search_index_requests {
+ id BigInt @id @default(autoincrement())
+ contextid BigInt
+ searcharea String @default("") @db.VarChar(255)
+ timerequested BigInt
+ partialarea String @default("") @db.VarChar(255)
+ partialtime BigInt
+ indexpriority BigInt
+
+ @@index([contextid], map: "mdl_searinderequ_con_ix")
+ @@index([indexpriority, timerequested], map: "mdl_searinderequ_indtim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_search_simpledb_index {
+ id BigInt @id @default(autoincrement())
+ docid String @unique(map: "mdl_searsimpinde_doc_uix") @default("") @db.VarChar(255)
+ itemid BigInt
+ title String? @db.LongText
+ content String? @db.LongText
+ contextid BigInt
+ areaid String @default("") @db.VarChar(255)
+ type Boolean
+ courseid BigInt
+ owneruserid BigInt?
+ modified BigInt
+ userid BigInt?
+ description1 String? @db.LongText
+ description2 String? @db.LongText
+
+ @@index([areaid], map: "mdl_searsimpinde_are_ix")
+ @@index([contextid], map: "mdl_searsimpinde_con_ix")
+ @@index([courseid], map: "mdl_searsimpinde_cou_ix")
+ @@index([owneruserid, contextid], map: "mdl_searsimpinde_owncon_ix")
+ @@fulltext([title, content, description1, description2], map: "mdl_search_simpledb_index_index")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_sessions {
+ id BigInt @id @default(autoincrement())
+ state BigInt @default(0)
+ sid String @unique(map: "mdl_sess_sid_uix") @default("") @db.VarChar(128)
+ userid BigInt
+ sessdata String? @db.LongText
+ timecreated BigInt
+ timemodified BigInt
+ firstip String? @db.VarChar(45)
+ lastip String? @db.VarChar(45)
+
+ @@index([state], map: "mdl_sess_sta_ix")
+ @@index([timemodified], map: "mdl_sess_tim2_ix")
+ @@index([timecreated], map: "mdl_sess_tim_ix")
+ @@index([userid], map: "mdl_sess_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_stats_daily {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt @default(0)
+ timeend BigInt @default(0)
+ roleid BigInt @default(0)
+ stattype String @default("activity") @db.VarChar(20)
+ stat1 BigInt @default(0)
+ stat2 BigInt @default(0)
+
+ @@index([courseid], map: "mdl_statdail_cou_ix")
+ @@index([roleid], map: "mdl_statdail_rol_ix")
+ @@index([timeend], map: "mdl_statdail_tim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_stats_monthly {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt @default(0)
+ timeend BigInt @default(0)
+ roleid BigInt @default(0)
+ stattype String @default("activity") @db.VarChar(20)
+ stat1 BigInt @default(0)
+ stat2 BigInt @default(0)
+
+ @@index([courseid], map: "mdl_statmont_cou_ix")
+ @@index([roleid], map: "mdl_statmont_rol_ix")
+ @@index([timeend], map: "mdl_statmont_tim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_stats_user_daily {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt @default(0)
+ userid BigInt @default(0)
+ roleid BigInt @default(0)
+ timeend BigInt @default(0)
+ statsreads BigInt @default(0)
+ statswrites BigInt @default(0)
+ stattype String @default("") @db.VarChar(30)
+
+ @@index([courseid], map: "mdl_statuserdail_cou_ix")
+ @@index([roleid], map: "mdl_statuserdail_rol_ix")
+ @@index([timeend], map: "mdl_statuserdail_tim_ix")
+ @@index([userid], map: "mdl_statuserdail_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_stats_user_monthly {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt @default(0)
+ userid BigInt @default(0)
+ roleid BigInt @default(0)
+ timeend BigInt @default(0)
+ statsreads BigInt @default(0)
+ statswrites BigInt @default(0)
+ stattype String @default("") @db.VarChar(30)
+
+ @@index([courseid], map: "mdl_statusermont_cou_ix")
+ @@index([roleid], map: "mdl_statusermont_rol_ix")
+ @@index([timeend], map: "mdl_statusermont_tim_ix")
+ @@index([userid], map: "mdl_statusermont_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_stats_user_weekly {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt @default(0)
+ userid BigInt @default(0)
+ roleid BigInt @default(0)
+ timeend BigInt @default(0)
+ statsreads BigInt @default(0)
+ statswrites BigInt @default(0)
+ stattype String @default("") @db.VarChar(30)
+
+ @@index([courseid], map: "mdl_statuserweek_cou_ix")
+ @@index([roleid], map: "mdl_statuserweek_rol_ix")
+ @@index([timeend], map: "mdl_statuserweek_tim_ix")
+ @@index([userid], map: "mdl_statuserweek_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_stats_weekly {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt @default(0)
+ timeend BigInt @default(0)
+ roleid BigInt @default(0)
+ stattype String @default("activity") @db.VarChar(20)
+ stat1 BigInt @default(0)
+ stat2 BigInt @default(0)
+
+ @@index([courseid], map: "mdl_statweek_cou_ix")
+ @@index([roleid], map: "mdl_statweek_rol_ix")
+ @@index([timeend], map: "mdl_statweek_tim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_survey {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ template BigInt @default(0)
+ days Int @default(0) @db.MediumInt
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ questions String @default("") @db.VarChar(255)
+ completionsubmit Boolean @default(false)
+
+ @@index([course], map: "mdl_surv_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_survey_analysis {
+ id BigInt @id @default(autoincrement())
+ survey BigInt @default(0)
+ userid BigInt @default(0)
+ notes String @db.LongText
+
+ @@index([survey], map: "mdl_survanal_sur_ix")
+ @@index([userid], map: "mdl_survanal_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_survey_answers {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ survey BigInt @default(0)
+ question BigInt @default(0)
+ time BigInt @default(0)
+ answer1 String @db.LongText
+ answer2 String @db.LongText
+
+ @@index([question], map: "mdl_survansw_que_ix")
+ @@index([survey], map: "mdl_survansw_sur_ix")
+ @@index([userid], map: "mdl_survansw_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_survey_questions {
+ id BigInt @id @default(autoincrement())
+ text String @default("") @db.VarChar(255)
+ shorttext String @default("") @db.VarChar(30)
+ multi String @default("") @db.VarChar(100)
+ intro String @default("") @db.VarChar(50)
+ type Int @default(0) @db.SmallInt
+ options String? @db.LongText
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tag {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ tagcollid BigInt
+ name String @default("") @db.VarChar(255)
+ rawname String @default("") @db.VarChar(255)
+ isstandard Boolean @default(false)
+ description String? @db.LongText
+ descriptionformat Int @default(0) @db.TinyInt
+ flag Int? @default(0) @db.SmallInt
+ timemodified BigInt?
+
+ @@unique([tagcollid, name], map: "mdl_tag_tagnam_uix")
+ @@index([tagcollid], map: "mdl_tag_tag_ix")
+ @@index([tagcollid, isstandard], map: "mdl_tag_tagiss_ix")
+ @@index([userid], map: "mdl_tag_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tag_area {
+ id BigInt @id @default(autoincrement())
+ component String @default("") @db.VarChar(100)
+ itemtype String @default("") @db.VarChar(100)
+ enabled Boolean @default(true)
+ tagcollid BigInt
+ callback String? @db.VarChar(100)
+ callbackfile String? @db.VarChar(100)
+ showstandard Boolean @default(false)
+ multiplecontexts Boolean @default(false)
+
+ @@unique([component, itemtype], map: "mdl_tagarea_comite_uix")
+ @@index([tagcollid], map: "mdl_tagarea_tag_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tag_coll {
+ id BigInt @id @default(autoincrement())
+ name String? @db.VarChar(255)
+ isdefault Int @default(0) @db.TinyInt
+ component String? @db.VarChar(100)
+ sortorder Int @default(0) @db.MediumInt
+ searchable Int @default(1) @db.TinyInt
+ customurl String? @db.VarChar(255)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tag_correlation {
+ id BigInt @id @default(autoincrement())
+ tagid BigInt
+ correlatedtags String @db.LongText
+
+ @@index([tagid], map: "mdl_tagcorr_tag_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tag_instance {
+ id BigInt @id @default(autoincrement())
+ tagid BigInt
+ component String @default("") @db.VarChar(100)
+ itemtype String @default("") @db.VarChar(100)
+ itemid BigInt
+ contextid BigInt?
+ tiuserid BigInt @default(0)
+ ordering BigInt?
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ @@unique([component, itemtype, itemid, contextid, tiuserid, tagid], map: "mdl_taginst_comiteiteconti_uix")
+ @@index([contextid], map: "mdl_taginst_con_ix")
+ @@index([itemtype, component, tagid, contextid], map: "mdl_taginst_itecomtagcon_ix")
+ @@index([tagid], map: "mdl_taginst_tag_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_task_adhoc {
+ id BigInt @id @default(autoincrement())
+ component String @default("") @db.VarChar(255)
+ classname String @default("") @db.VarChar(255)
+ nextruntime BigInt
+ faildelay BigInt?
+ customdata String? @db.LongText
+ userid BigInt?
+ blocking Int @default(0) @db.TinyInt
+ timecreated BigInt @default(0)
+ timestarted BigInt?
+ hostname String? @db.VarChar(255)
+ pid BigInt?
+
+ @@index([nextruntime], map: "mdl_taskadho_nex_ix")
+ @@index([timestarted], map: "mdl_taskadho_tim_ix")
+ @@index([userid], map: "mdl_taskadho_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_task_log {
+ id BigInt @id @default(autoincrement())
+ type Int @db.SmallInt
+ component String @default("") @db.VarChar(255)
+ classname String @default("") @db.VarChar(255)
+ userid BigInt
+ timestart Decimal @db.Decimal(20, 10)
+ timeend Decimal @db.Decimal(20, 10)
+ dbreads BigInt
+ dbwrites BigInt
+ result Int @db.TinyInt
+ output String @db.LongText
+ hostname String? @db.VarChar(255)
+ pid BigInt?
+
+ @@index([classname], map: "mdl_tasklog_cla_ix")
+ @@index([timestart], map: "mdl_tasklog_tim_ix")
+ @@index([userid], map: "mdl_tasklog_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_task_scheduled {
+ id BigInt @id @default(autoincrement())
+ component String @default("") @db.VarChar(255)
+ classname String @unique(map: "mdl_tasksche_cla_uix") @default("") @db.VarChar(255)
+ lastruntime BigInt?
+ nextruntime BigInt?
+ blocking Int @default(0) @db.TinyInt
+ minute String @default("") @db.VarChar(200)
+ hour String @default("") @db.VarChar(70)
+ day String @default("") @db.VarChar(90)
+ month String @default("") @db.VarChar(30)
+ dayofweek String @default("") @db.VarChar(25)
+ faildelay BigInt?
+ customised Int @default(0) @db.TinyInt
+ disabled Boolean @default(false)
+ timestarted BigInt?
+ hostname String? @db.VarChar(255)
+ pid BigInt?
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tiny_autosave {
+ id BigInt @id @default(autoincrement())
+ elementid String @default("") @db.VarChar(255)
+ contextid BigInt
+ pagehash String @default("") @db.VarChar(64)
+ userid BigInt
+ drafttext String @db.LongText
+ draftid BigInt?
+ pageinstance String @default("") @db.VarChar(64)
+ timemodified BigInt @default(0)
+
+ @@unique([elementid, contextid, userid, pagehash], map: "mdl_tinyauto_eleconusepag_uix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_brickfield_areas {
+ id BigInt @id @default(autoincrement())
+ type Int @default(0) @db.TinyInt
+ contextid BigInt?
+ component String? @db.VarChar(100)
+ tablename String? @db.VarChar(40)
+ fieldorarea String? @db.VarChar(50)
+ itemid BigInt?
+ filename String? @db.VarChar(1333)
+ reftable String? @db.VarChar(40)
+ refid BigInt?
+ cmid BigInt?
+ courseid BigInt?
+ categoryid BigInt?
+
+ @@index([categoryid], map: "mdl_toolbricarea_cat_ix")
+ @@index([cmid], map: "mdl_toolbricarea_cmi_ix")
+ @@index([contextid], map: "mdl_toolbricarea_con_ix")
+ @@index([courseid], map: "mdl_toolbricarea_cou_ix")
+ @@index([courseid, cmid], map: "mdl_toolbricarea_coucmi_ix")
+ @@index([reftable, refid, type], map: "mdl_toolbricarea_refreftyp_ix")
+ @@index([type, contextid, component, fieldorarea, itemid], map: "mdl_toolbricarea_typconcomf_ix")
+ @@index([type, tablename, itemid, fieldorarea], map: "mdl_toolbricarea_typtabitef_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_brickfield_cache_acts {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ status Boolean?
+ component String? @db.VarChar(64)
+ totalactivities BigInt?
+ failedactivities BigInt?
+ passedactivities BigInt?
+ errorcount BigInt?
+
+ @@index([courseid], map: "mdl_toolbriccachacts_cou_ix")
+ @@index([status], map: "mdl_toolbriccachacts_sta_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_brickfield_cache_check {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ status Boolean?
+ checkid BigInt?
+ checkcount BigInt?
+ errorcount BigInt?
+
+ @@index([courseid], map: "mdl_toolbriccachchec_cou_ix")
+ @@index([errorcount], map: "mdl_toolbriccachchec_err_ix")
+ @@index([status], map: "mdl_toolbriccachchec_sta_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_brickfield_checks {
+ id BigInt @id @default(autoincrement())
+ checktype String? @db.VarChar(64)
+ shortname String? @db.VarChar(64)
+ checkgroup BigInt? @default(0)
+ status Int @db.SmallInt
+ severity Int @default(0) @db.TinyInt
+
+ @@index([checkgroup], map: "mdl_toolbricchec_che2_ix")
+ @@index([checktype], map: "mdl_toolbricchec_che_ix")
+ @@index([status], map: "mdl_toolbricchec_sta_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_brickfield_content {
+ id BigInt @id @default(autoincrement())
+ areaid BigInt
+ contenthash String @default("") @db.VarChar(40)
+ iscurrent Boolean @default(false)
+ status Int @default(0) @db.TinyInt
+ timecreated BigInt
+ timechecked BigInt?
+
+ @@index([areaid], map: "mdl_toolbriccont_are_ix")
+ @@index([iscurrent, areaid], map: "mdl_toolbriccont_iscare_ix")
+ @@index([status], map: "mdl_toolbriccont_sta_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_brickfield_errors {
+ id BigInt @id @default(autoincrement())
+ resultid BigInt
+ linenumber BigInt @default(0)
+ errordata String? @db.LongText
+ htmlcode String? @db.LongText
+
+ @@index([resultid], map: "mdl_toolbricerro_res_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_brickfield_process {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ item String? @db.VarChar(64)
+ contextid BigInt?
+ innercontextid BigInt?
+ timecreated BigInt?
+ timecompleted BigInt?
+
+ @@index([timecompleted], map: "mdl_toolbricproc_tim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_brickfield_results {
+ id BigInt @id @default(autoincrement())
+ contentid BigInt?
+ checkid BigInt
+ errorcount BigInt @default(0)
+
+ @@index([checkid], map: "mdl_toolbricresu_che_ix")
+ @@index([contentid], map: "mdl_toolbricresu_con_ix")
+ @@index([contentid, checkid], map: "mdl_toolbricresu_conche_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_brickfield_schedule {
+ id BigInt @id @default(autoincrement())
+ contextlevel BigInt @default(50)
+ instanceid BigInt
+ contextid BigInt?
+ status Int @default(0) @db.TinyInt
+ timeanalyzed BigInt? @default(0)
+ timemodified BigInt? @default(0)
+
+ @@unique([contextlevel, instanceid], map: "mdl_toolbricsche_conins_uix")
+ @@index([status], map: "mdl_toolbricsche_sta_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_brickfield_summary {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ status Boolean?
+ activities BigInt?
+ activitiespassed BigInt?
+ activitiesfailed BigInt?
+ errorschecktype1 BigInt?
+ errorschecktype2 BigInt?
+ errorschecktype3 BigInt?
+ errorschecktype4 BigInt?
+ errorschecktype5 BigInt?
+ errorschecktype6 BigInt?
+ errorschecktype7 BigInt?
+ failedchecktype1 BigInt?
+ failedchecktype2 BigInt?
+ failedchecktype3 BigInt?
+ failedchecktype4 BigInt?
+ failedchecktype5 BigInt?
+ failedchecktype6 BigInt?
+ failedchecktype7 BigInt?
+ percentchecktype1 BigInt?
+ percentchecktype2 BigInt?
+ percentchecktype3 BigInt?
+ percentchecktype4 BigInt?
+ percentchecktype5 BigInt?
+ percentchecktype6 BigInt?
+ percentchecktype7 BigInt?
+
+ @@index([courseid], map: "mdl_toolbricsumm_cou_ix")
+ @@index([status], map: "mdl_toolbricsumm_sta_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_cohortroles {
+ id BigInt @id @default(autoincrement())
+ cohortid BigInt
+ roleid BigInt
+ userid BigInt
+ timecreated BigInt
+ timemodified BigInt
+ usermodified BigInt?
+
+ @@unique([cohortid, roleid, userid], map: "mdl_toolcoho_cohroluse_uix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_customlang {
+ id BigInt @id @default(autoincrement())
+ lang String @default("") @db.VarChar(20)
+ componentid BigInt
+ stringid String @default("") @db.VarChar(255)
+ original String @db.LongText
+ master String? @db.LongText
+ local String? @db.LongText
+ timemodified BigInt
+ timecustomized BigInt?
+ outdated Int? @default(0) @db.SmallInt
+ modified Int? @default(0) @db.SmallInt
+
+ @@unique([lang, componentid, stringid], map: "mdl_toolcust_lancomstr_uix")
+ @@index([componentid], map: "mdl_toolcust_com_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_customlang_components {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(255)
+ version String? @db.VarChar(255)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_dataprivacy_category {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(100)
+ description String? @db.LongText
+ descriptionformat Boolean?
+ usermodified BigInt
+ timecreated BigInt
+ timemodified BigInt
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_dataprivacy_ctxexpired {
+ id BigInt @id @default(autoincrement())
+ contextid BigInt @unique(map: "mdl_tooldatactxe_con_uix")
+ unexpiredroles String? @db.LongText
+ expiredroles String? @db.LongText
+ defaultexpired Boolean
+ status Int @default(0) @db.TinyInt
+ usermodified BigInt
+ timecreated BigInt
+ timemodified BigInt
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_dataprivacy_ctxinstance {
+ id BigInt @id @default(autoincrement())
+ contextid BigInt @unique(map: "mdl_tooldatactxi_con_uix")
+ purposeid BigInt?
+ categoryid BigInt?
+ usermodified BigInt
+ timecreated BigInt
+ timemodified BigInt
+
+ @@index([categoryid], map: "mdl_tooldatactxi_cat_ix")
+ @@index([purposeid], map: "mdl_tooldatactxi_pur_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_dataprivacy_ctxlevel {
+ id BigInt @id @default(autoincrement())
+ contextlevel Int @unique(map: "mdl_tooldatactxl_con_uix") @db.SmallInt
+ purposeid BigInt?
+ categoryid BigInt?
+ usermodified BigInt
+ timecreated BigInt
+ timemodified BigInt
+
+ @@index([categoryid], map: "mdl_tooldatactxl_cat_ix")
+ @@index([purposeid], map: "mdl_tooldatactxl_pur_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_dataprivacy_purpose {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(100)
+ description String? @db.LongText
+ descriptionformat Boolean?
+ lawfulbases String @db.LongText
+ sensitivedatareasons String? @db.LongText
+ retentionperiod String @default("") @db.VarChar(255)
+ protected Boolean?
+ usermodified BigInt
+ timecreated BigInt
+ timemodified BigInt
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_dataprivacy_purposerole {
+ id BigInt @id @default(autoincrement())
+ purposeid BigInt
+ roleid BigInt
+ lawfulbases String? @db.LongText
+ sensitivedatareasons String? @db.LongText
+ retentionperiod String @default("") @db.VarChar(255)
+ protected Boolean?
+ usermodified BigInt
+ timecreated BigInt
+ timemodified BigInt
+
+ @@unique([purposeid, roleid], map: "mdl_tooldatapurp_purrol_uix")
+ @@index([purposeid], map: "mdl_tooldatapurp_pur_ix")
+ @@index([roleid], map: "mdl_tooldatapurp_rol_ix")
+ @@index([usermodified], map: "mdl_tooldatapurp_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_dataprivacy_request {
+ id BigInt @id @default(autoincrement())
+ type BigInt @default(0)
+ comments String? @db.LongText
+ commentsformat Int @default(0) @db.TinyInt
+ userid BigInt @default(0)
+ requestedby BigInt @default(0)
+ status Int @default(0) @db.TinyInt
+ dpo BigInt? @default(0)
+ dpocomment String? @db.LongText
+ dpocommentformat Int @default(0) @db.TinyInt
+ systemapproved Int @default(0) @db.SmallInt
+ usermodified BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ creationmethod BigInt @default(0)
+
+ @@index([dpo], map: "mdl_tooldatarequ_dpo_ix")
+ @@index([requestedby], map: "mdl_tooldatarequ_req_ix")
+ @@index([usermodified], map: "mdl_tooldatarequ_use2_ix")
+ @@index([userid], map: "mdl_tooldatarequ_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_monitor_events {
+ id BigInt @id @default(autoincrement())
+ eventname String @default("") @db.VarChar(254)
+ contextid BigInt
+ contextlevel BigInt
+ contextinstanceid BigInt
+ link String @default("") @db.VarChar(254)
+ courseid BigInt
+ timecreated BigInt
+
+ @@index([contextinstanceid], map: "mdl_toolmonieven_con2_ix")
+ @@index([contextid], map: "mdl_toolmonieven_con_ix")
+ @@index([courseid], map: "mdl_toolmonieven_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_monitor_history {
+ id BigInt @id @default(autoincrement())
+ sid BigInt
+ userid BigInt
+ timesent BigInt
+
+ @@unique([sid, userid, timesent], map: "mdl_toolmonihist_sidusetim_uix")
+ @@index([sid], map: "mdl_toolmonihist_sid_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_monitor_rules {
+ id BigInt @id @default(autoincrement())
+ description String? @db.LongText
+ descriptionformat Boolean
+ name String @default("") @db.VarChar(254)
+ userid BigInt
+ courseid BigInt
+ plugin String @default("") @db.VarChar(254)
+ eventname String @default("") @db.VarChar(254)
+ template String @db.LongText
+ templateformat Boolean
+ frequency Int @db.SmallInt
+ timewindow Int @db.MediumInt
+ timemodified BigInt
+ timecreated BigInt
+
+ @@index([courseid, userid], map: "mdl_toolmonirule_couuse_ix")
+ @@index([eventname], map: "mdl_toolmonirule_eve_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_monitor_subscriptions {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ ruleid BigInt
+ cmid BigInt
+ userid BigInt
+ timecreated BigInt
+ lastnotificationsent BigInt @default(0)
+ inactivedate BigInt @default(0)
+
+ @@index([courseid, userid], map: "mdl_toolmonisubs_couuse_ix")
+ @@index([ruleid], map: "mdl_toolmonisubs_rul_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_policy {
+ id BigInt @id @default(autoincrement())
+ sortorder Int @default(999) @db.MediumInt
+ currentversionid BigInt?
+
+ @@index([currentversionid], map: "mdl_toolpoli_cur_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_policy_acceptances {
+ id BigInt @id @default(autoincrement())
+ policyversionid BigInt
+ userid BigInt
+ status Boolean?
+ lang String @default("") @db.VarChar(30)
+ usermodified BigInt
+ timecreated BigInt
+ timemodified BigInt
+ note String? @db.LongText
+
+ @@unique([policyversionid, userid], map: "mdl_toolpoliacce_poluse_uix")
+ @@index([policyversionid], map: "mdl_toolpoliacce_pol_ix")
+ @@index([usermodified], map: "mdl_toolpoliacce_use2_ix")
+ @@index([userid], map: "mdl_toolpoliacce_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_policy_versions {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(1333)
+ type Int @default(0) @db.SmallInt
+ audience Int @default(0) @db.SmallInt
+ archived Int @default(0) @db.SmallInt
+ usermodified BigInt
+ timecreated BigInt
+ timemodified BigInt
+ policyid BigInt
+ agreementstyle Int @default(0) @db.SmallInt
+ optional Int @default(0) @db.SmallInt
+ revision String @default("") @db.VarChar(1333)
+ summary String @db.LongText
+ summaryformat Int @db.SmallInt
+ content String @db.LongText
+ contentformat Int @db.SmallInt
+
+ @@index([policyid], map: "mdl_toolpolivers_pol_ix")
+ @@index([usermodified], map: "mdl_toolpolivers_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_recyclebin_category {
+ id BigInt @id @default(autoincrement())
+ categoryid BigInt
+ shortname String @default("") @db.VarChar(255)
+ fullname String @default("") @db.VarChar(255)
+ timecreated BigInt
+
+ @@index([categoryid], map: "mdl_toolrecycate_cat_ix")
+ @@index([timecreated], map: "mdl_toolrecycate_tim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_recyclebin_course {
+ id BigInt @id @default(autoincrement())
+ courseid BigInt
+ section BigInt
+ module BigInt
+ name String? @db.VarChar(255)
+ timecreated BigInt @default(0)
+
+ @@index([courseid], map: "mdl_toolrecycour_cou_ix")
+ @@index([timecreated], map: "mdl_toolrecycour_tim_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_usertours_steps {
+ id BigInt @id @default(autoincrement())
+ tourid BigInt
+ title String? @db.LongText
+ content String? @db.LongText
+ contentformat Int @default(0) @db.SmallInt
+ targettype Int @db.TinyInt
+ targetvalue String @db.LongText
+ sortorder BigInt @default(0)
+ configdata String @db.LongText
+
+ @@index([tourid], map: "mdl_tooluserstep_tou_ix")
+ @@index([tourid, sortorder], map: "mdl_tooluserstep_tousor_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_tool_usertours_tours {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(255)
+ description String? @db.LongText
+ pathmatch String? @db.VarChar(255)
+ enabled Boolean @default(false)
+ sortorder BigInt @default(0)
+ endtourlabel String? @db.VarChar(255)
+ configdata String @db.LongText
+ displaystepnumbers Boolean @default(false)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_upgrade_log {
+ id BigInt @id @default(autoincrement())
+ type BigInt
+ plugin String? @db.VarChar(100)
+ version String? @db.VarChar(100)
+ targetversion String? @db.VarChar(100)
+ info String @default("") @db.VarChar(255)
+ details String? @db.LongText
+ backtrace String? @db.LongText
+ userid BigInt
+ timemodified BigInt
+
+ @@index([timemodified], map: "mdl_upgrlog_tim_ix")
+ @@index([type, timemodified], map: "mdl_upgrlog_typtim_ix")
+ @@index([userid], map: "mdl_upgrlog_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_url {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ intro String? @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ externalurl String @db.LongText
+ display Int @default(0) @db.SmallInt
+ displayoptions String? @db.LongText
+ parameters String? @db.LongText
+ timemodified BigInt @default(0)
+
+ @@index([course], map: "mdl_url_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_user {
+ id BigInt @id @default(autoincrement())
+ auth String @default("manual") @db.VarChar(20)
+ confirmed Boolean @default(false)
+ policyagreed Boolean @default(false)
+ deleted Boolean @default(false)
+ suspended Boolean @default(false)
+ mnethostid BigInt @default(0)
+ username String @default("") @db.VarChar(100)
+ password String @default("") @db.VarChar(255)
+ idnumber String @default("") @db.VarChar(255)
+ firstname String @default("") @db.VarChar(100)
+ lastname String @default("") @db.VarChar(100)
+ email String @default("") @db.VarChar(100)
+ emailstop Boolean @default(false)
+ phone1 String @default("") @db.VarChar(20)
+ phone2 String @default("") @db.VarChar(20)
+ institution String @default("") @db.VarChar(255)
+ department String @default("") @db.VarChar(255)
+ address String @default("") @db.VarChar(255)
+ city String @default("") @db.VarChar(120)
+ country String @default("") @db.VarChar(2)
+ lang String @default("en") @db.VarChar(30)
+ calendartype String @default("gregorian") @db.VarChar(30)
+ theme String @default("") @db.VarChar(50)
+ timezone String @default("99") @db.VarChar(100)
+ firstaccess BigInt @default(0)
+ lastaccess BigInt @default(0)
+ lastlogin BigInt @default(0)
+ currentlogin BigInt @default(0)
+ lastip String @default("") @db.VarChar(45)
+ secret String @default("") @db.VarChar(15)
+ picture BigInt @default(0)
+ description String? @db.LongText
+ descriptionformat Int @default(1) @db.TinyInt
+ mailformat Boolean @default(true)
+ maildigest Boolean @default(false)
+ maildisplay Int @default(2) @db.TinyInt
+ autosubscribe Boolean @default(true)
+ trackforums Boolean @default(false)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ trustbitmask BigInt @default(0)
+ imagealt String? @db.VarChar(255)
+ lastnamephonetic String? @db.VarChar(255)
+ firstnamephonetic String? @db.VarChar(255)
+ middlename String? @db.VarChar(255)
+ alternatename String? @db.VarChar(255)
+ moodlenetprofile String? @db.VarChar(255)
+
+ @@unique([mnethostid, username], map: "mdl_user_mneuse_uix")
+ @@index([alternatename], map: "mdl_user_alt_ix")
+ @@index([auth], map: "mdl_user_aut_ix")
+ @@index([city], map: "mdl_user_cit_ix")
+ @@index([confirmed], map: "mdl_user_con_ix")
+ @@index([country], map: "mdl_user_cou_ix")
+ @@index([deleted], map: "mdl_user_del_ix")
+ @@index([email], map: "mdl_user_ema_ix")
+ @@index([firstnamephonetic], map: "mdl_user_fir2_ix")
+ @@index([firstname], map: "mdl_user_fir_ix")
+ @@index([idnumber], map: "mdl_user_idn_ix")
+ @@index([lastaccess], map: "mdl_user_las2_ix")
+ @@index([lastnamephonetic], map: "mdl_user_las3_ix")
+ @@index([lastname], map: "mdl_user_las_ix")
+ @@index([middlename], map: "mdl_user_mid_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_user_devices {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ appid String @default("") @db.VarChar(128)
+ name String @default("") @db.VarChar(32)
+ model String @default("") @db.VarChar(32)
+ platform String @default("") @db.VarChar(32)
+ version String @default("") @db.VarChar(32)
+ pushid String @default("") @db.VarChar(255)
+ uuid String @default("") @db.VarChar(255)
+ timecreated BigInt
+ timemodified BigInt
+
+ @@unique([pushid, userid], map: "mdl_userdevi_pususe_uix")
+ @@index([userid], map: "mdl_userdevi_use_ix")
+ @@index([uuid, userid], map: "mdl_userdevi_uuiuse_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_user_enrolments {
+ id BigInt @id @default(autoincrement())
+ status BigInt @default(0)
+ enrolid BigInt
+ userid BigInt
+ timestart BigInt @default(0)
+ timeend BigInt @default(2147483647)
+ modifierid BigInt @default(0)
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+
+ enrol mdl_enrol @relation(fields: [enrolid], references: [id])
+
+ @@unique([enrolid, userid], map: "mdl_userenro_enruse_uix")
+ @@index([enrolid], map: "mdl_userenro_enr_ix")
+ @@index([modifierid], map: "mdl_userenro_mod_ix")
+ @@index([userid], map: "mdl_userenro_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_user_info_category {
+ id BigInt @id @default(autoincrement())
+ name String @default("") @db.VarChar(255)
+ sortorder BigInt @default(0)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_user_info_data {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ fieldid BigInt @default(0)
+ data String @db.LongText
+ dataformat Int @default(0) @db.TinyInt
+
+ @@unique([userid, fieldid], map: "mdl_userinfodata_usefie_uix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_user_info_field {
+ id BigInt @id @default(autoincrement())
+ shortname String @default("shortname") @db.VarChar(255)
+ name String @db.LongText
+ datatype String @default("") @db.VarChar(255)
+ description String? @db.LongText
+ descriptionformat Int @default(0) @db.TinyInt
+ categoryid BigInt @default(0)
+ sortorder BigInt @default(0)
+ required Int @default(0) @db.TinyInt
+ locked Int @default(0) @db.TinyInt
+ visible Int @default(0) @db.SmallInt
+ forceunique Int @default(0) @db.TinyInt
+ signup Int @default(0) @db.TinyInt
+ defaultdata String? @db.LongText
+ defaultdataformat Int @default(0) @db.TinyInt
+ param1 String? @db.LongText
+ param2 String? @db.LongText
+ param3 String? @db.LongText
+ param4 String? @db.LongText
+ param5 String? @db.LongText
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_user_lastaccess {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ courseid BigInt @default(0)
+ timeaccess BigInt @default(0)
+
+ @@unique([userid, courseid], map: "mdl_userlast_usecou_uix")
+ @@index([courseid], map: "mdl_userlast_cou_ix")
+ @@index([userid], map: "mdl_userlast_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_user_password_history {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ hash String @default("") @db.VarChar(255)
+ timecreated BigInt
+
+ @@index([userid], map: "mdl_userpasshist_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_user_password_resets {
+ id BigInt @id @default(autoincrement())
+ userid BigInt
+ timerequested BigInt
+ timererequested BigInt @default(0)
+ token String @default("") @db.VarChar(32)
+
+ @@index([userid], map: "mdl_userpassrese_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_user_preferences {
+ id BigInt @id @default(autoincrement())
+ userid BigInt @default(0)
+ name String @default("") @db.VarChar(255)
+ value String @default("") @db.VarChar(1333)
+
+ @@unique([userid, name], map: "mdl_userpref_usenam_uix")
+ @@index([name], map: "mdl_userpref_nam_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_user_private_key {
+ id BigInt @id @default(autoincrement())
+ script String @default("") @db.VarChar(128)
+ value String @default("") @db.VarChar(128)
+ userid BigInt
+ instance BigInt?
+ iprestriction String? @db.VarChar(255)
+ validuntil BigInt?
+ timecreated BigInt?
+
+ @@index([script, value], map: "mdl_userprivkey_scrval_ix")
+ @@index([userid], map: "mdl_userprivkey_use_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_wiki {
+ id BigInt @id @default(autoincrement())
+ course BigInt @default(0)
+ name String @default("Wiki") @db.VarChar(255)
+ intro String? @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ firstpagetitle String @default("First Page") @db.VarChar(255)
+ wikimode String @default("collaborative") @db.VarChar(20)
+ defaultformat String @default("creole") @db.VarChar(20)
+ forceformat Boolean @default(true)
+ editbegin BigInt @default(0)
+ editend BigInt? @default(0)
+
+ @@index([course], map: "mdl_wiki_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_wiki_links {
+ id BigInt @id @default(autoincrement())
+ subwikiid BigInt @default(0)
+ frompageid BigInt @default(0)
+ topageid BigInt @default(0)
+ tomissingpage String? @db.VarChar(255)
+
+ @@index([frompageid], map: "mdl_wikilink_fro_ix")
+ @@index([subwikiid], map: "mdl_wikilink_sub_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_wiki_locks {
+ id BigInt @id @default(autoincrement())
+ pageid BigInt @default(0)
+ sectionname String? @db.VarChar(255)
+ userid BigInt @default(0)
+ lockedat BigInt @default(0)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_wiki_pages {
+ id BigInt @id @default(autoincrement())
+ subwikiid BigInt @default(0)
+ title String @default("title") @db.VarChar(255)
+ cachedcontent String @db.LongText
+ timecreated BigInt @default(0)
+ timemodified BigInt @default(0)
+ timerendered BigInt @default(0)
+ userid BigInt @default(0)
+ pageviews BigInt @default(0)
+ readonly Boolean @default(false)
+
+ @@unique([subwikiid, title, userid], map: "mdl_wikipage_subtituse_uix")
+ @@index([subwikiid], map: "mdl_wikipage_sub_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_wiki_subwikis {
+ id BigInt @id @default(autoincrement())
+ wikiid BigInt @default(0)
+ groupid BigInt @default(0)
+ userid BigInt @default(0)
+
+ @@unique([wikiid, groupid, userid], map: "mdl_wikisubw_wikgrouse_uix")
+ @@index([wikiid], map: "mdl_wikisubw_wik_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_wiki_synonyms {
+ id BigInt @id @default(autoincrement())
+ subwikiid BigInt @default(0)
+ pageid BigInt @default(0)
+ pagesynonym String @default("Pagesynonym") @db.VarChar(255)
+
+ @@unique([pageid, pagesynonym], map: "mdl_wikisyno_pagpag_uix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_wiki_versions {
+ id BigInt @id @default(autoincrement())
+ pageid BigInt @default(0)
+ content String @db.LongText
+ contentformat String @default("creole") @db.VarChar(20)
+ version Int @default(0) @db.MediumInt
+ timecreated BigInt @default(0)
+ userid BigInt @default(0)
+
+ @@index([pageid], map: "mdl_wikivers_pag_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_workshop {
+ id BigInt @id @default(autoincrement())
+ course BigInt
+ name String @default("") @db.VarChar(255)
+ intro String? @db.LongText
+ introformat Int @default(0) @db.SmallInt
+ instructauthors String? @db.LongText
+ instructauthorsformat Int @default(0) @db.SmallInt
+ instructreviewers String? @db.LongText
+ instructreviewersformat Int @default(0) @db.SmallInt
+ timemodified BigInt
+ phase Int? @default(0) @db.SmallInt
+ useexamples Int? @default(0) @db.TinyInt
+ usepeerassessment Int? @default(0) @db.TinyInt
+ useselfassessment Int? @default(0) @db.TinyInt
+ grade Decimal? @default(80.00000) @db.Decimal(10, 5)
+ gradinggrade Decimal? @default(20.00000) @db.Decimal(10, 5)
+ strategy String @default("") @db.VarChar(30)
+ evaluation String @default("") @db.VarChar(30)
+ gradedecimals Int? @default(0) @db.SmallInt
+ submissiontypetext Boolean @default(true)
+ submissiontypefile Boolean @default(true)
+ nattachments Int? @default(1) @db.SmallInt
+ submissionfiletypes String? @db.VarChar(255)
+ latesubmissions Int? @default(0) @db.TinyInt
+ maxbytes BigInt? @default(100000)
+ examplesmode Int? @default(0) @db.SmallInt
+ submissionstart BigInt? @default(0)
+ submissionend BigInt? @default(0)
+ assessmentstart BigInt? @default(0)
+ assessmentend BigInt? @default(0)
+ phaseswitchassessment Int @default(0) @db.TinyInt
+ conclusion String? @db.LongText
+ conclusionformat Int @default(1) @db.SmallInt
+ overallfeedbackmode Int? @default(1) @db.SmallInt
+ overallfeedbackfiles Int? @default(0) @db.SmallInt
+ overallfeedbackfiletypes String? @db.VarChar(255)
+ overallfeedbackmaxbytes BigInt? @default(100000)
+
+ @@index([course], map: "mdl_work_cou_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_workshop_aggregations {
+ id BigInt @id @default(autoincrement())
+ workshopid BigInt
+ userid BigInt
+ gradinggrade Decimal? @db.Decimal(10, 5)
+ timegraded BigInt?
+
+ @@unique([workshopid, userid], map: "mdl_workaggr_woruse_uix")
+ @@index([userid], map: "mdl_workaggr_use_ix")
+ @@index([workshopid], map: "mdl_workaggr_wor_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_workshop_assessments {
+ id BigInt @id @default(autoincrement())
+ submissionid BigInt
+ reviewerid BigInt
+ weight BigInt @default(1)
+ timecreated BigInt? @default(0)
+ timemodified BigInt? @default(0)
+ grade Decimal? @db.Decimal(10, 5)
+ gradinggrade Decimal? @db.Decimal(10, 5)
+ gradinggradeover Decimal? @db.Decimal(10, 5)
+ gradinggradeoverby BigInt?
+ feedbackauthor String? @db.LongText
+ feedbackauthorformat Int? @default(0) @db.SmallInt
+ feedbackauthorattachment Int? @default(0) @db.SmallInt
+ feedbackreviewer String? @db.LongText
+ feedbackreviewerformat Int? @default(0) @db.SmallInt
+
+ @@index([gradinggradeoverby], map: "mdl_workasse_gra_ix")
+ @@index([reviewerid], map: "mdl_workasse_rev_ix")
+ @@index([submissionid], map: "mdl_workasse_sub_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_workshop_grades {
+ id BigInt @id @default(autoincrement())
+ assessmentid BigInt
+ strategy String @default("") @db.VarChar(30)
+ dimensionid BigInt
+ grade Decimal? @db.Decimal(10, 5)
+ peercomment String? @db.LongText
+ peercommentformat Int? @default(0) @db.SmallInt
+
+ @@unique([assessmentid, strategy, dimensionid], map: "mdl_workgrad_assstrdim_uix")
+ @@index([assessmentid], map: "mdl_workgrad_ass_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_workshop_submissions {
+ id BigInt @id @default(autoincrement())
+ workshopid BigInt
+ example Int? @default(0) @db.TinyInt
+ authorid BigInt
+ timecreated BigInt
+ timemodified BigInt
+ title String @default("") @db.VarChar(255)
+ content String? @db.LongText
+ contentformat Int @default(0) @db.SmallInt
+ contenttrust Int @default(0) @db.SmallInt
+ attachment Int? @default(0) @db.TinyInt
+ grade Decimal? @db.Decimal(10, 5)
+ gradeover Decimal? @db.Decimal(10, 5)
+ gradeoverby BigInt?
+ feedbackauthor String? @db.LongText
+ feedbackauthorformat Int? @default(0) @db.SmallInt
+ timegraded BigInt?
+ published Int? @default(0) @db.TinyInt
+ late Int @default(0) @db.TinyInt
+
+ @@index([authorid], map: "mdl_worksubm_aut_ix")
+ @@index([gradeoverby], map: "mdl_worksubm_gra_ix")
+ @@index([workshopid], map: "mdl_worksubm_wor_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_workshopallocation_scheduled {
+ id BigInt @id @default(autoincrement())
+ workshopid BigInt @unique(map: "mdl_worksche_wor_uix")
+ enabled Int @default(0) @db.TinyInt
+ submissionend BigInt
+ timeallocated BigInt?
+ settings String? @db.LongText
+ resultstatus BigInt?
+ resultmessage String? @db.VarChar(1333)
+ resultlog String? @db.LongText
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_workshopeval_best_settings {
+ id BigInt @id @default(autoincrement())
+ workshopid BigInt @unique(map: "mdl_workbestsett_wor_uix")
+ comparison Int? @default(5) @db.SmallInt
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_workshopform_accumulative {
+ id BigInt @id @default(autoincrement())
+ workshopid BigInt
+ sort BigInt? @default(0)
+ description String? @db.LongText
+ descriptionformat Int? @default(0) @db.SmallInt
+ grade BigInt
+ weight Int? @default(1) @db.MediumInt
+
+ @@index([workshopid], map: "mdl_workaccu_wor_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_workshopform_comments {
+ id BigInt @id @default(autoincrement())
+ workshopid BigInt
+ sort BigInt? @default(0)
+ description String? @db.LongText
+ descriptionformat Int? @default(0) @db.SmallInt
+
+ @@index([workshopid], map: "mdl_workcomm_wor_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_workshopform_numerrors {
+ id BigInt @id @default(autoincrement())
+ workshopid BigInt
+ sort BigInt? @default(0)
+ description String? @db.LongText
+ descriptionformat Int? @default(0) @db.SmallInt
+ descriptiontrust BigInt?
+ grade0 String? @db.VarChar(50)
+ grade1 String? @db.VarChar(50)
+ weight Int? @default(1) @db.MediumInt
+
+ @@index([workshopid], map: "mdl_worknume_wor_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_workshopform_numerrors_map {
+ id BigInt @id @default(autoincrement())
+ workshopid BigInt
+ nonegative BigInt
+ grade Decimal @db.Decimal(10, 5)
+
+ @@unique([workshopid, nonegative], map: "mdl_worknumemap_wornon_uix")
+ @@index([workshopid], map: "mdl_worknumemap_wor_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_workshopform_rubric {
+ id BigInt @id @default(autoincrement())
+ workshopid BigInt
+ sort BigInt? @default(0)
+ description String? @db.LongText
+ descriptionformat Int? @default(0) @db.SmallInt
+
+ @@index([workshopid], map: "mdl_workrubr_wor_ix")
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_workshopform_rubric_config {
+ id BigInt @id @default(autoincrement())
+ workshopid BigInt @unique(map: "mdl_workrubrconf_wor_uix")
+ layout String? @default("list") @db.VarChar(30)
+}
+
+/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
+model mdl_workshopform_rubric_levels {
+ id BigInt @id @default(autoincrement())
+ dimensionid BigInt
+ grade Decimal @db.Decimal(10, 5)
+ definition String? @db.LongText
+ definitionformat Int? @default(0) @db.SmallInt
+
+ @@index([dimensionid], map: "mdl_workrubrleve_dim_ix")
+}
diff --git a/src/prisma/migrations/0_init/migration.sql b/src/prisma/tripbot/migrations/0_init/migration.sql
similarity index 100%
rename from src/prisma/migrations/0_init/migration.sql
rename to src/prisma/tripbot/migrations/0_init/migration.sql
diff --git a/src/prisma/schema.prisma b/src/prisma/tripbot/schema.prisma
similarity index 99%
rename from src/prisma/schema.prisma
rename to src/prisma/tripbot/schema.prisma
index 7ad38c896..913a82ac5 100644
--- a/src/prisma/schema.prisma
+++ b/src/prisma/tripbot/schema.prisma
@@ -1,5 +1,6 @@
generator client {
provider = "prisma-client-js"
+ // output = "/usr/src/app/node_modules/@prisma-tripbot/client"
binaryTargets = ["native", "linux-musl-openssl-3.0.x"]
}
diff --git a/tsconfig.json b/tsconfig.json
index 5e7354887..c3bfb50af 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -13,7 +13,7 @@
"*/matrix/*",
"*/node_modules",
"node_modules",
- // "*/telegram/*",
+ "*/telegram/*",
"**/__tests__editreply_/*",
"**/__tests__integration__/*",
"**/__tests__modals__/*",