Pārlūkot izejas kodu

Sanitized SQL scripts

Yannick Warnier 15 gadi atpakaļ
vecāks
revīzija
3a242660db

+ 19 - 1
main/install/dokeos_main.sql

@@ -722,7 +722,7 @@ VALUES
 ('allow_terms_conditions', NULL, 'radio', 'Platform', 'false', 'AllowTermsAndConditionsTitle', 'AllowTermsAndConditionsComment', NULL, NULL,0),
 ('allow_terms_conditions', NULL, 'radio', 'Platform', 'false', 'AllowTermsAndConditionsTitle', 'AllowTermsAndConditionsComment', NULL, NULL,0),
 ('show_tutor_data',NULL,'radio','Platform','true','ShowTutorDataTitle','ShowTutorDataComment',NULL,NULL, 1),
 ('show_tutor_data',NULL,'radio','Platform','true','ShowTutorDataTitle','ShowTutorDataComment',NULL,NULL, 1),
 ('show_teacher_data',NULL,'radio','Platform','true','ShowTeacherDataTitle','ShowTeacherDataComment',NULL,NULL, 1),
 ('show_teacher_data',NULL,'radio','Platform','true','ShowTeacherDataTitle','ShowTeacherDataComment',NULL,NULL, 1),
-('dokeos_database_version', NULL, 'textfield', NULL,'1.8.6.1.8171','DokeosDatabaseVersion','',NULL,NULL,0); 
+('dokeos_database_version', NULL, 'textfield', NULL,'1.8.6.1.8225','DokeosDatabaseVersion','',NULL,NULL,0); 
 UNLOCK TABLES;
 UNLOCK TABLES;
 /*!40000 ALTER TABLE settings_current ENABLE KEYS */;
 /*!40000 ALTER TABLE settings_current ENABLE KEYS */;
 
 
@@ -1061,6 +1061,7 @@ CREATE TABLE gradebook_evaluation (
   weight smallint NOT NULL,
   weight smallint NOT NULL,
   max float unsigned NOT NULL,
   max float unsigned NOT NULL,
   visible tinyint NOT NULL,
   visible tinyint NOT NULL,
+  type varchar(40) NOT NULL default 'evaluation',
   PRIMARY KEY  (id)
   PRIMARY KEY  (id)
 );
 );
 DROP TABLE IF EXISTS gradebook_link;
 DROP TABLE IF EXISTS gradebook_link;
@@ -2030,6 +2031,7 @@ CREATE TABLE  reservation_item  (
    description  text NOT NULL,
    description  text NOT NULL,
    blackout  tinyint NOT NULL default 0,
    blackout  tinyint NOT NULL default 0,
    creator  int unsigned NOT NULL default 0,
    creator  int unsigned NOT NULL default 0,
+   always_available TINYINT NOT NULL default 0,
   PRIMARY KEY  ( id )
   PRIMARY KEY  ( id )
 );
 );
 
 
@@ -2174,4 +2176,20 @@ CREATE TABLE  legal (
 
 
 INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) values (1, 'legal_accept','Legal',0,0);
 INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) values (1, 'legal_accept','Legal',0,0);
 
 
+--
+-- Table structure for certificate with gradebook
+--
 
 
+CREATE TABLE gradebook_certificate(
+	id bigint unsigned not null auto_increment,
+	cat_id int unsigned not null,
+	user_id int unsigned not null,
+	score_certificate float unsigned not null default 0,
+	date_certificate datetime not null default '0000-00-00 00:00:00',
+	path_certificate text null,
+	PRIMARY KEY(id)
+);
+ALTER TABLE gradebook_certificate ADD INDEX idx_gradebook_certificate_category_id(cat_id);
+ALTER TABLE gradebook_certificate ADD INDEX idx_gradebook_certificate_user_id(user_id);
+ALTER TABLE gradebook_certificate ADD INDEX idx_gradebook_certificate_category_id_user_id(cat_id,user_id);
+ALTER TABLE gradebook_category ADD COLUMN document_id int unsigned default NULL;

+ 8 - 1
main/install/migrate-db-1.8.6-1.8.6.1-pre.sql

@@ -32,8 +32,15 @@ INSERT INTO settings_options (variable, value, display_text) VALUES ('show_tutor
 INSERT INTO settings_options (variable, value, display_text) VALUES ('show_tutor_data','false','No');
 INSERT INTO settings_options (variable, value, display_text) VALUES ('show_tutor_data','false','No');
 INSERT INTO settings_options (variable, value, display_text) VALUES ('show_teacher_data','true','Yes');
 INSERT INTO settings_options (variable, value, display_text) VALUES ('show_teacher_data','true','Yes');
 INSERT INTO settings_options (variable, value, display_text) VALUES ('show_teacher_data','false','No');
 INSERT INTO settings_options (variable, value, display_text) VALUES ('show_teacher_data','false','No');
-INSERT IGNORE INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url, access_url_changeable) VALUES ('dokeos_database_version',NULL,'textfield',NULL,'1.8.6.1.8171','DokeosDatabaseVersion','',NULL,NULL,1,0);
 ALTER TABLE user_friend ADD COLUMN last_edit DATETIME;
 ALTER TABLE user_friend ADD COLUMN last_edit DATETIME;
+ALTER TABLE reservation_item ADD always_available TINYINT NOT NULL default 0;
+CREATE TABLE gradebook_certificate( id bigint unsigned not null auto_increment, cat_id int unsigned not null, user_id int unsigned not null, score_certificate float unsigned not null default 0, date_certificate datetime not null default '0000-00-00 00:00:00', path_certificate text null, PRIMARY KEY(id));
+ALTER TABLE gradebook_certificate ADD INDEX idx_gradebook_certificate_category_id(cat_id);
+ALTER TABLE gradebook_certificate ADD INDEX idx_gradebook_certificate_user_id(user_id);
+ALTER TABLE gradebook_certificate ADD INDEX idx_gradebook_certificate_category_id_user_id(cat_id,user_id);
+ALTER TABLE gradebook_category ADD COLUMN document_id int unsigned default NULL;
+ALTER TABLE gradebook_evaluation ADD COLUMN type varchar(40) NOT NULL default 'evaluation';
+INSERT IGNORE INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url, access_url_changeable) VALUES ('dokeos_database_version',NULL,'textfield',NULL,'1.8.6.1.8225','DokeosDatabaseVersion','',NULL,NULL,1,0);
 
 
 -- xxSTATSxx
 -- xxSTATSxx