Skip to content

Commit

Permalink
Expanded DB identifier sizes (tables and columns - MDL-76459)
Browse files Browse the repository at this point in the history
Update all the references to the old 28 and 30 char long limits
to the new 53 and 63 ones for Moodle 4.3 and up.

Also, add a note in the 4.3 release page, database requirements,
about the new max CFG->prefix length (10 characters).
  • Loading branch information
stronk7 committed Sep 10, 2023
1 parent b590537 commit 5e3a393
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/apis/plugintypes/assign/feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ Assignment Feedback plugins are located in the `/mod/assign/feedback` directory.

:::important Plugin naming

The plugin name should be no longer than 13 characters - this is because the database tables for a submission plugin must be prefixed with `assignfeedback_[pluginname]` (15 chars + X) and the table names can be no longer than 28 chars due to a limitation with Oracle.
The plugin name should be no longer than 38 (13 before Moodle 4.3) characters - this is because the database tables for a submission plugin must be prefixed with `assignfeedback_[pluginname]` (15 chars + X) and the table names can be no longer than 53 (28 before Moodle 4.3) chars due to a limitation with PostgreSQL.

If a plugin requires multiple database tables, the plugin name will need to be shorter to allow different table names to fit under the 28 character limit.
If a plugin requires multiple database tables, the plugin name will need to be shorter to allow different table names to fit under the 53 character limit (28 before Moodle 4.3).

:::

Expand Down
4 changes: 2 additions & 2 deletions docs/apis/plugintypes/assign/submission.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ Assignment Feedback plugins are located in the `/mod/assign/submission` director

:::important Plugin naming

The plugin name should be no longer than 11 characters - this is because the database tables for a submission plugin must be prefixed with `assignsubmission_[pluginname]` (17 chars + X) and the table names can be no longer than 28 chars due to a limitation with Oracle.
The plugin name should be no longer than 36 (11 before Moodle 4.3) characters - this is because the database tables for a submission plugin must be prefixed with `assignsubmission_[pluginname]` (17 chars + X) and the table names can be no longer than 53 (28 before Moodle 4.3) chars due to a limitation with PostgreSQL.

If a plugin requires multiple database tables, the plugin name will need to be shorter to allow different table names to fit under the 28 character limit.
If a plugin requires multiple database tables, the plugin name will need to be shorter to allow different table names to fit under the 53 character limit (28 before Moodle 4.3).

:::

Expand Down
2 changes: 1 addition & 1 deletion general/development/tools/xmldb.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Apart from the [Database Structures guidelines](https://docs.moodle.org/dev/Data

1. About names:
1. All lowercase names (tables, indexes, keys and fields).
1. Table names and field names must use only a-z, 0-9 and _ chars. Max 28 characters.
1. Table names and field names must use only a-z, 0-9 and _ chars. Max 53 characters for tables and 63 characters for fields (28 and 30 before Moodle 4.3).
1. Key and index names under the XMLDB Files must be formed by concatenating the name of the fields present in the key/index with the '"-" (minus) character.
1. Primary key always must be named "primary" (this is one exception to the previous convention).
1. It's highly recommended to avoid [reserved words](https://docs.moodle.org/dev/XMLDB_reserved_words) completely. We know we have some of them now but they should be completely out for next releases.
Expand Down
2 changes: 2 additions & 0 deletions general/releases/4.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Moodle supports the following database servers. Again, version numbers are just
| [Microsoft SQL Server](http://www.microsoft.com/en-us/server-cloud/products/sql-server/) | 2017 | Latest |
| [Oracle Database](http://www.oracle.com/us/products/database/overview/index.html) | 19 | Latest |

Note that, since Moodle 4.3, the maximum length for the database prefix (`$CFG->prefix`) is 10 characters. Installation or upgrade won't be possible with longer prefixes.

## Client requirements

### Browser support
Expand Down

0 comments on commit 5e3a393

Please sign in to comment.