Repository navigation
Fix/support postgres db for contentauthor #3290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
d43433c
7278eb1
3e687e6
88dabc3
22f0a50
04a8064
fe609b6
bcc2cdd
f625b00
1f2c30b
4c641d7
e325e9a
bd3d5d4
28503c6
f820fb8
6b9ed08
fcfbeaa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| CREATE DATABASE IF NOT EXISTS edlibcontentauthor; | ||
| CREATE DATABASE IF NOT EXISTS moodle; | ||
| CREATE DATABASE IF NOT EXISTS edlibcontentauthor_test; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| CREATE DATABASE hub; | ||
| CREATE DATABASE hub_test; | ||
| CREATE DATABASE contentauthor; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ RUN install-php-extensions \ | |
| pcntl \ | ||
| pcov \ | ||
| pdo_mysql \ | ||
| pdo_pgsql \ | ||
| redis \ | ||
| zip | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -951,15 +951,15 @@ public function loadContentDependencies($id, $type = null) | |
| } | ||
| $sql = | ||
| "SELECT hl.id | ||
| , hl.name AS machineName | ||
| , hl.major_version AS majorVersion | ||
| , hl.minor_version AS minorVersion | ||
| , hl.patch_version AS patchVersion | ||
| , hl.preloaded_css AS preloadedCss | ||
| , hl.preloaded_js AS preloadedJs | ||
| , hcl.drop_css AS dropCss | ||
| , hcl.dependency_type AS dependencyType | ||
| , hl.patch_version_in_folder_name AS patchVersionInFolderName | ||
| , hl.name AS \"machineName\" | ||
| , hl.major_version AS \"majorVersion\" | ||
| , hl.minor_version AS \"minorVersion\" | ||
| , hl.patch_version AS \"patchVersion\" | ||
| , hl.preloaded_css AS \"preloadedCss\" | ||
| , hl.preloaded_js AS \"preloadedJs\" | ||
| , hcl.drop_css AS \"dropCss\" | ||
| , hcl.dependency_type AS \"dependencyType\" | ||
| , hl.patch_version_in_folder_name AS \"patchVersionInFolderName\" | ||
|
Comment on lines
+954
to
+962
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Postgres converts texts to lowercase unless escaped. Escaping also works on mysql/mariadb. |
||
| FROM h5p_contents_libraries hcl | ||
| JOIN h5p_libraries hl ON hcl.library_id = hl.id | ||
| WHERE hcl.content_id = ?"; | ||
|
|
@@ -1208,8 +1208,8 @@ public function replaceContentTypeCache($contentTypeCache) | |
| 'major_version' => $type->version->major, | ||
| 'minor_version' => $type->version->minor, | ||
| 'patch_version' => $type->version->patch, | ||
| 'h5P_major_version' => $type->coreApiVersionNeeded->major, | ||
| 'h5P_minor_version' => $type->coreApiVersionNeeded->minor, | ||
| 'h5p_major_version' => $type->coreApiVersionNeeded->major, | ||
| 'h5p_minor_version' => $type->coreApiVersionNeeded->minor, | ||
| 'title' => $type->title, | ||
| 'summary' => $type->summary, | ||
| 'description' => $type->description, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,7 +152,7 @@ public function getProgress(Request $request) | |
|
|
||
| public function getState($contentId, $context) | ||
| { | ||
| $sql = "select data, sub_content_id, data_id from $this->tableName where content_id=:contentId and user_id=:userId and preload=1"; | ||
| $sql = "select data, sub_content_id, data_id from $this->tableName where content_id=:contentId and user_id=:userId and preload=true"; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Postgres treats booleans as booleans and not tinyint. This works also for mysql/mariadb. |
||
| $params = [ | ||
| ':contentId' => $contentId, | ||
| ':userId' => $this->currentUserId, | ||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needed for fresh databases. Existing bases are targeted in new migrations. |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This column is non existing in the table.