Browse Source

Feature #272 - Lengts of some database text-type fields are increased. The need was identified by using a real course in Bulgarian language.

Ivan Tcholakov 15 years ago
parent
commit
961a6a6f22
2 changed files with 18 additions and 18 deletions
  1. 15 15
      main/inc/lib/add_course.lib.inc.php
  2. 3 3
      main/install/db_main.sql

+ 15 - 15
main/inc/lib/add_course.lib.inc.php

@@ -644,9 +644,9 @@ function update_Db_course($courseDbName, $language = null)
 	$sql = "
 		CREATE TABLE `".$TABLEQUIZ . "` (
 		id mediumint unsigned NOT NULL auto_increment,
-		title varchar(200) NOT NULL,
+		title varchar(255) NOT NULL,
 		description text default NULL,
-		sound varchar(50) default NULL,
+		sound varchar(255) default NULL,
 		type tinyint unsigned NOT NULL default 1,
 		random smallint(6) NOT NULL default 0,
 		random_answers tinyint unsigned NOT NULL default 0,
@@ -669,7 +669,7 @@ function update_Db_course($courseDbName, $language = null)
 	$sql = "
 		CREATE TABLE `".$TABLEQUIZQUESTIONLIST . "` (
 		id mediumint unsigned NOT NULL auto_increment,
-		question varchar(200) NOT NULL,
+		question varchar(511) NOT NULL,
 		description text default NULL,
 		ponderation float(6,2) NOT NULL default 0,
 		position mediumint unsigned NOT NULL default 1,
@@ -740,12 +740,12 @@ function update_Db_course($courseDbName, $language = null)
 	$sql = "
 		CREATE TABLE `" . $tbl_course_homepage . "` (
 		id int unsigned NOT NULL auto_increment,
-		name varchar(100) NOT NULL,
+		name varchar(255) NOT NULL,
 		link varchar(255) NOT NULL,
-		image varchar(100) default NULL,
+		image varchar(255) default NULL,
 		visibility tinyint unsigned default 0,
-		admin varchar(200) default NULL,
-		address varchar(120) default NULL,
+		admin varchar(255) default NULL,
+		address varchar(255) default NULL,
 		added_tool tinyint unsigned default 1,
 		target enum('_self','_blank') NOT NULL default '_self',
 		category enum('authoring','interaction','admin') NOT NULL default 'authoring',
@@ -764,7 +764,7 @@ function update_Db_course($courseDbName, $language = null)
 	$sql = "
 		CREATE TABLE `".$TABLETOOLAGENDA . "` (
 		id int unsigned NOT NULL auto_increment,
-		title varchar(200) NOT NULL,
+		title varchar(255) NOT NULL,
 		content text,
 		start_date datetime NOT NULL default '0000-00-00 00:00:00',
 		end_date datetime NOT NULL default '0000-00-00 00:00:00',
@@ -833,10 +833,10 @@ function update_Db_course($courseDbName, $language = null)
 	$sql = "
 		CREATE TABLE `".$TABLETOOLWORKS . "` (
 		id int unsigned NOT NULL auto_increment,
-		url varchar(200) default NULL,
-		title varchar(200) default NULL,
-		description text default NULL,
-		author varchar(200) default NULL,
+		url varchar(255) default NULL,
+		title varchar(255) default NULL,
+		description varchar(255) default NULL,
+		author varchar(255) default NULL,
 		active tinyint default NULL,
 		accepted tinyint default 0,
 		post_group_id int DEFAULT 0 NOT NULL,
@@ -1193,7 +1193,7 @@ function update_Db_course($courseDbName, $language = null)
 	$sql = "CREATE TABLE IF NOT EXISTS `$TABLELP` (" .
 		"id				int	unsigned	primary key auto_increment," . //unique ID, generated by MySQL
 		"lp_type		smallint	unsigned not null," .	//lp_types can be found in the main database's lp_type table
-		"name			tinytext	not null," . //name is the text name of the learning path (e.g. Word 2000)
+		"name			varchar(255)	not null," . //name is the text name of the learning path (e.g. Word 2000)
 		"ref			tinytext	null," . //ref for SCORM elements is the SCORM ID in imsmanifest. For other learnpath types, just ignore
 		"description	text	null,". //textual description
 		"path 			text	not null," . //path, starting at the platforms root (so all paths should start with 'courses/...' for now)
@@ -1251,8 +1251,8 @@ function update_Db_course($courseDbName, $language = null)
 		"lp_id			int unsigned	not null," .	//lp_id from 'lp'
 		"item_type		char(32)	not null default 'dokeos_document'," . //can be dokeos_document, dokeos_chapter or scorm_asset, scorm_sco, scorm_chapter
 		"ref			tinytext	not null default ''," . //the ID given to this item in the imsmanifest file
-		"title			tinytext	not null," . //the title/name of this item (to display in the T.O.C.)
-		"description	tinytext	not null default ''," . //the description of this item - deprecated
+		"title			varchar(511)	not null," . //the title/name of this item (to display in the T.O.C.)
+		"description	varchar(511)	not null default ''," . //the description of this item - deprecated
 		"path			text		not null," . //the path to that item, starting at 'courses/...' level
 		"min_score		float unsigned	not null default 0," . //min score allowed
 		"max_score		float unsigned	not null default 100," . //max score allowed

+ 3 - 3
main/install/db_main.sql

@@ -243,7 +243,7 @@ CREATE TABLE course_field_values(
 DROP TABLE IF EXISTS course_module;
 CREATE TABLE course_module (
   id int unsigned NOT NULL auto_increment,
-  name varchar(100) NOT NULL,
+  name varchar(255) NOT NULL,
   link varchar(255) NOT NULL,
   image varchar(100) default NULL,
   `row` int unsigned NOT NULL default '0',
@@ -1282,7 +1282,7 @@ CREATE TABLE access_url_rel_session (
 --
 CREATE TABLE IF NOT EXISTS sys_calendar (
   id int unsigned NOT NULL auto_increment,
-  title varchar(200) NOT NULL,
+  title varchar(255) NOT NULL,
   content text,
   start_date datetime NOT NULL default '0000-00-00 00:00:00',
   end_date datetime NOT NULL default '0000-00-00 00:00:00',
@@ -2328,7 +2328,7 @@ CREATE TABLE session_category (
 
 CREATE TABLE tag (
 	id int NOT NULL auto_increment,
-	tag char(80) NOT NULL,
+	tag varchar(255) NOT NULL,
 	field_id int NOT NULL,
 	count int NOT NULL,
 	PRIMARY KEY  (id)