Copyleaks / moodle-plagiarism_copyleaks

Copyleaks Plagiarism plugin for Moodle
GNU General Public License v3.0
3 stars 3 forks source link

Upgrade error #26

Closed durzo closed 1 year ago

durzo commented 1 year ago

We recently upgraded this plugin on a site running postgresql database and received the following error during moodle upgrade:

$ sudo -u www-data php admin/cli/upgrade.php --non-interactive
-->plagiarism_copyleaks
Default exception handler: DDL sql execution error Debug: ERROR:  column "date" is of type timestamp without time zone but default expression is of type integer
HINT:  You will need to rewrite or cast the expression.
BEGIN ISOLATION LEVEL SERIALIZABLE;
CREATE TABLE mdl_plagiarism_copyleaks_eula (
    id BIGSERIAL,
    ci_user_id BIGINT NOT NULL,
    version TEXT NOT NULL,
    is_synced NUMERIC(1),
    date TIMESTAMP NOT NULL DEFAULT 0,
CONSTRAINT mdl_plagcopyeula_id_pk PRIMARY KEY (id)
)
;
CREATE INDEX mdl_plagcopyeula_ci__ix ON mdl_plagiarism_copyleaks_eula (ci_user_id)
;
CREATE INDEX mdl_plagcopyeula_is__ix ON mdl_plagiarism_copyleaks_eula (is_synced)
;
CREATE INDEX mdl_plagcopyeula_dat_ix ON mdl_plagiarism_copyleaks_eula (date)
; COMMIT
Error code: ddlexecuteerror
* line 492 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
* line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
* line 338 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->read_slave_query_end()
* line 804 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
* line 77 of /lib/ddl/database_manager.php: call to pgsql_native_moodle_database->change_database_structure()
* line 446 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
* line 264 of /plagiarism/copyleaks/db/upgrade.php: call to database_manager->create_table()
* line 703 of /lib/upgradelib.php: call to xmldb_plagiarism_copyleaks_upgrade()
* line 1929 of /lib/upgradelib.php: call to upgrade_plugins()
* line 202 of /admin/cli/upgrade.php: call to upgrade_noncore()

!!! DDL sql execution error !!!
!! ERROR:  column "date" is of type timestamp without time zone but default expression is of type integer
HINT:  You will need to rewrite or cast the expression.
BEGIN ISOLATION LEVEL SERIALIZABLE;
CREATE TABLE mdl_plagiarism_copyleaks_eula (
    id BIGSERIAL,
    ci_user_id BIGINT NOT NULL,
    version TEXT NOT NULL,
    is_synced NUMERIC(1),
    date TIMESTAMP NOT NULL DEFAULT 0,
CONSTRAINT mdl_plagcopyeula_id_pk PRIMARY KEY (id)
)
;
CREATE INDEX mdl_plagcopyeula_ci__ix ON mdl_plagiarism_copyleaks_eula (ci_user_id)
;
CREATE INDEX mdl_plagcopyeula_is__ix ON mdl_plagiarism_copyleaks_eula (is_synced)
;
CREATE INDEX mdl_plagcopyeula_dat_ix ON mdl_plagiarism_copyleaks_eula (date)
; COMMIT
Error code: ddlexecuteerror !!
!! Stack trace: * line 492 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
* line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
* line 338 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->read_slave_query_end()
* line 804 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
* line 77 of /lib/ddl/database_manager.php: call to pgsql_native_moodle_database->change_database_structure()
* line 446 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
* line 264 of /plagiarism/copyleaks/db/upgrade.php: call to database_manager->create_table()
* line 703 of /lib/upgradelib.php: call to xmldb_plagiarism_copyleaks_upgrade()
* line 1929 of /lib/upgradelib.php: call to upgrade_plugins()
* line 202 of /admin/cli/upgrade.php: call to upgrade_noncore()
 !!
Gilco7 commented 1 year ago

Hello @durzo. Thanks for reaching out and informing us about this issue. We will take a look at the problem and keep you updated.

Gilco7 commented 1 year ago

Hey @durzo, We just deployed a new version of the plugin. You can download it from this link Appreciate if you will let me know if the upgrade succeeded and everything working ok.