Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayush8923 committed Aug 28, 2024
2 parents 3bf7834 + 05d0b89 commit 44630ba
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,29 @@ function xmldb_local_moodle_survey_upgrade($oldversion) {

upgrade_plugin_savepoint(true, 2024071715, 'local', 'moodle_survey');
}
if ($oldversion < 2024071718) {
// Define table cc_user_grade to be created.
$table = new xmldb_table('cc_school_course_grade');

// Adding fields to table cc_user_grade.
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
$table->add_field('user_grade', XMLDB_TYPE_TEXT, null, null, null, null, null);
$table->add_field('course_id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
$table->add_field('school_id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
$table->add_field('audience_type', XMLDB_TYPE_TEXT, '20', null, XMLDB_NOTNULL, null, null);
$table->add_field('created_at', XMLDB_TYPE_DATETIME, null, null, XMLDB_NOTNULL, null, null);
$table->add_field('updated_at', XMLDB_TYPE_DATETIME, null, null, XMLDB_NOTNULL, null, null);

$table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']);
$table->add_key('cc_school_course_grade_school_fk', XMLDB_KEY_FOREIGN, ['school_id'], 'company', ['id']);
$table->add_key('cc_school_course_grade_course_fk', XMLDB_KEY_FOREIGN, ['course_id'], 'course', ['id']);

if (!$dbman->table_exists($table)) {
$dbman->create_table($table);
}

upgrade_plugin_savepoint(true, 2024071718, 'local', 'moodle_survey');
}

return true;
}
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@

$plugin->component = 'local_moodle_survey';
$plugin->release = '0.1.0';
$plugin->version = 2024071717;
$plugin->version = 2024071718;
$plugin->requires = 2022112800;
$plugin->maturity = MATURITY_ALPHA;

0 comments on commit 44630ba

Please sign in to comment.