Commit 61be4ef3 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Schema change for mysql

parent ed82dc67
......@@ -232,7 +232,7 @@
<TABLE NAME="grouptype_roles">
<FIELDS>
<FIELD NAME="grouptype" TYPE="char" LENGTH="20" NOTNULL="true" />
<FIELD NAME="role" TYPE="text" NOTNULL="true" />
<FIELD NAME="role" TYPE="char" LENGTH="255" NOTNULL="true" />
<FIELD NAME="edit_views" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
<FIELD NAME="see_submitted_views" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
</FIELDS>
......@@ -262,7 +262,7 @@
<FIELDS>
<FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="true" />
<FIELD NAME="member" TYPE="int" LENGTH="10" NOTNULL="true" />
<FIELD NAME="role" TYPE="text" NOTNULL="true" />
<FIELD NAME="role" TYPE="char" LENGTH="255" NOTNULL="true" />
<FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
</FIELDS>
<KEYS>
......@@ -359,7 +359,7 @@
</TABLE>
<TABLE NAME="artefact_access_role">
<FIELDS>
<FIELD NAME="role" TYPE="text" NOTNULL="true" />
<FIELD NAME="role" TYPE="char" LENGTH="255" NOTNULL="true" />
<FIELD NAME="artefact" TYPE="int" LENGTH="10" NOTNULL="true" />
<FIELD NAME="can_view" TYPE="int" LENGTH="1" NOTNULL="true" />
<FIELD NAME="can_edit" TYPE="int" LENGTH="1" NOTNULL="true" />
......@@ -605,7 +605,7 @@
<FIELDS>
<FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
<FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="true" />
<FIELD NAME="role" TYPE="text" NOTNULL="false" />
<FIELD NAME="role" TYPE="char" LENGTH="255" NOTNULL="false" />
<FIELD NAME="startdate" TYPE="datetime" NOTNULL="false" />
<FIELD NAME="stopdate" TYPE="datetime" NOTNULL="false" />
</FIELDS>
......
......@@ -983,7 +983,7 @@ function xmldb_core_upgrade($oldversion=0) {
log_debug('GROUP TYPE REFACTOR');
execute_sql('ALTER TABLE {group} ADD grouptype CHARACTER VARYING(20)');
execute_sql('ALTER TABLE {group_member} ADD role TEXT');
execute_sql('ALTER TABLE {group_member} ADD role CHARACTER VARYING(255)');
$groups = get_records_array('group');
if ($groups) {
......@@ -1072,7 +1072,7 @@ function xmldb_core_upgrade($oldversion=0) {
if ($oldversion < 2008062301) {
execute_sql('CREATE TABLE {artefact_access_role} (
role TEXT NOT NULL,
role VARCHAR(255) NOT NULL,
artefact INTEGER NOT NULL REFERENCES {artefact}(id),
can_view SMALLINT NOT NULL,
can_edit SMALLINT NOT NULL,
......@@ -1095,7 +1095,7 @@ function xmldb_core_upgrade($oldversion=0) {
execute_sql("INSERT INTO {grouptype} (name,usercancreate,submittableto) VALUES ('course',0,1)");
execute_sql('CREATE TABLE {grouptype_roles} (
grouptype VARCHAR(20) NOT NULL REFERENCES {grouptype}(name),
role TEXT NOT NULL
role VARCHAR(255) NOT NULL
);');
execute_sql("INSERT INTO {grouptype_roles} (grouptype,role) VALUES ('standard','admin')");
execute_sql("INSERT INTO {grouptype_roles} (grouptype,role) VALUES ('standard','member')");
......@@ -1112,7 +1112,7 @@ function xmldb_core_upgrade($oldversion=0) {
execute_sql('ALTER TABLE {view} ADD COLUMN "group" BIGINT');
execute_sql('ALTER TABLE {view} ADD CONSTRAINT {view_gro_fk} FOREIGN KEY ("group") REFERENCES {group}(id)');
execute_sql('ALTER TABLE {view} ALTER COLUMN owner DROP NOT NULL');
execute_sql('ALTER TABLE {view_access_group} ADD COLUMN role TEXT');
execute_sql('ALTER TABLE {view_access_group} ADD COLUMN role VARCHAR(255)');
execute_sql("UPDATE {view_access_group} SET role = 'tutor' WHERE tutoronly = 1");
execute_sql('ALTER TABLE {view_access_group} DROP COLUMN tutoronly');
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment