66 Commits

Author SHA1 Message Date
stronk7
a8cb94f66f MDL-14863 - 1st iteration: lowercase XMLDB table, field, index, key and statement +
wrapper class to support old syntax (no changes in public API yet)
2008-05-20 23:24:40 +00:00
stronk7
46293bd7b7 MDL-14863 - 1st iteration: lowercase XMLDB constants, object, file and structure (no changes in public API yet) 2008-05-20 17:06:26 +00:00
skodak
f33e1ed4ae MDL-14679 ok, here is the big patch with new dmllib and ddlib API, some code is already converted, XML db editor works; see tracker for details of regressions and TODOs 2008-05-15 21:40:00 +00:00
sam_marshall
d9b063277b MDL-13660: Allow admin reports to have db tables, cron 2008-02-26 10:34:51 +00:00
skodak
8293c75198 MDL-6786 Improved dropping of block and module tables during uninstall; merged from MOODLE_19_STABLE 2008-01-03 15:03:32 +00:00
fmarier
69885093bf ddllib: Mark table_column() as deprecated
Signed-off-by: Eloy Lafuente
2007-12-03 23:20:03 +00:00
nicolasconnault
1f0e492171 Unit test refactoring using mock objects. NOT FINISHED: testgradecategory and testgradeitem are incomplete. The other tests work great however, and no longer a need for DB data 2007-11-07 17:59:33 +00:00
nicolasconnault
b7064779f5 Updated copyright notice in header 2007-10-10 05:25:14 +00:00
stronk7
f090314f46 General cleanup of debugging messages.
Now change_field_enum() introspects DB and detects
if the enum existed or no, as needed. MDL-9356
2007-09-11 18:33:23 +00:00
stronk7
af1192b159 Now both check_constraint_exists() and find_check_constraint_name()
are working under mysql, postgresql and mssql. 1st step of MDL-9356
2007-09-10 22:42:04 +00:00
stronk7
7abc6e09c0 Adding two new functions to search for check constraints from ddl stuff.
Unused and unfinished for now. I need them in CVS.
2007-09-10 22:22:23 +00:00
stronk7
b794dc20c0 Instead of looking for current default value, fetch from
the generator the *real* default value that the table will have.
2007-08-11 21:47:22 +00:00
martinlanghoff
a4b6d764dd ddllib: Introducing create_temp_table()
Close sibling to create_table() - will create a temporary table.
Two aspects of its usage are interesting

 - you _must_ truncate the table after creation as you may be
   "inheriting" an existing temp table from the former user
   of your persistent connection

 - you must use the tablename returned to support MSSQL and any
   other DB that needs special names for temp tables

A couple of TODOs

 - I just don't know how to actually munge the tablename for MSSQL
   (help! Eloooooyyyy!)

 - Surely Eloy will have something better than the preg_replace() ;-)
2007-04-29 20:31:47 +00:00
stronk7
42b9540e01 When renaming tables, check that the new one doesn't exist. 2007-01-27 20:13:23 +00:00
stronk7
bb3172c038 Prevent rename_field() to be executed if no full specs of
the original field are provided. MDL-8296
2007-01-24 17:54:53 +00:00
stronk7
c672870f8e Introducing CFG->dbfamily and create a setter function for it
(to be able to use families at install). MDL-7061
2007-01-12 23:44:00 +00:00
skodak
810944af7f we are going 100% unicode now - removed use of $CFG->unicodedb and current_charset(); MDL-7439 - part 2, only hotpot and wiki left 2006-11-11 17:23:20 +00:00
stronk7
dddf32590f Dropping xmldb_dbg($message). Now it has been replaced by a new cleaner
debug system, with XMLDB hook for debug enabled by the creation of one
function called: xmldb_debug($message, $object), currently present in
lib/datalib.php MDL-7261
2006-10-28 15:24:04 +00:00
stronk7
93f98abdb9 Improve error output of install_from_xmldb_file(). Part of MDL-7262
Merged from MOODLE_17_STABLE
2006-10-28 10:37:54 +00:00
stronk7
8914508a4b Prevent add_field() to work if we are adding one not null field
to one non-empty table without specifying its default value.

Merged from MOODLE_17_STABLE
2006-10-21 18:19:47 +00:00
toyomoyo
207355b438 merged, setting $CFG->unicodedb after converting db to unicode. Chaning the order of if clause to same some sqls 2006-10-20 02:08:21 +00:00
mjollnir_
722c3bfede error reporting for xmldb (credit: Nigel McNie <nigel@catalyst.net.nz>) 2006-10-19 23:30:28 +00:00
toyomoyo
c30f752c30 merged, adding addtional check to change_db_encoding to make sure db not already in unicode, upon successful conversion set the correct names 2006-10-19 02:14:43 +00:00
toyomoyo
a6eb09d977 merged added code to force mysql db to change default encoding during fresh installation 2006-10-18 07:26:04 +00:00
stronk7
1c460b0bc9 Show error if the dbtype specified isn't supported by XMLDB 2006-10-09 22:28:22 +00:00
stronk7
c5ac44c69e Added find_sequence_name() to be used by insert_record() to get the correct sequence 2006-10-08 09:38:09 +00:00
moodler
a9b1f143d2 Undoing my hacks to try and keep this code clean as possible. 2006-10-04 15:30:54 +00:00
moodler
eb437bd351 Some changes to ddllib.php to make some functions a bit easier to call.
May not be final ... see MDL-6817 for details.
2006-10-04 09:44:38 +00:00
stronk7
6fdea1a0bd In my previous commit, "I" was "It" :-D
Plus one typo fixed.
2006-10-02 16:46:12 +00:00
stronk7
af72e37237 Prevent "id" fields to be renamed. I can cause lots of problems. 2006-10-02 16:37:41 +00:00
stronk7
a2851e5f55 Basic rename_field() function added.
TODO: Automatic sequence/trigger/check constraint recreation
      under PG, MSSQL & Oracle
2006-10-01 23:02:39 +00:00
stronk7
4702d62e32 Change slighty the style of RenameKey and RenameIndex functions. 2006-09-30 22:59:10 +00:00
stronk7
a59f3a34f3 Initial commit of rename_table(). Not ended! 2006-09-30 22:40:15 +00:00
stronk7
9c4ee55b6c Added rename_key()
Note that this is one EXPERIMENTAL function and shouldn't be used
by you in production code EVER!
2006-09-30 19:44:49 +00:00
stronk7
6c89dc5514 Added rename_index()
Adding support for index renaming. Note that MySQL doesn't support this
but this shouldn't be important at all, mainly because, under xmldb,
accesses to index-names are always done with find_index_name() and
never explicity.
Anyway, this function could be useful in the future to normalize index
names in some Health center or another similar place.
2006-09-30 18:24:14 +00:00
stronk7
61af97e76b Added new function change_field_enum() 2006-09-30 17:06:20 +00:00
stronk7
3e1861cc87 Applying the field_exists() check to add and drop fields. 2006-09-30 15:48:23 +00:00
stronk7
342da808c5 New function field_exists() to detect if one field exists 2006-09-30 15:35:32 +00:00
stronk7
73d111a820 Add some checks to detect if one table exists before creating or
dropping it. Part of MDL-6614
2006-09-30 15:19:56 +00:00
stronk7
7471f3f0dd Adding some debugging() for some controlled actions. 2006-09-30 15:15:34 +00:00
stronk7
cf9a1a40f1 Fixed typo 2006-09-30 14:59:03 +00:00
stronk7
2719f3e2c9 Inside ddllib, for consistency we call parameters table, field...
(without the xmldb_ prefix)
2006-09-30 13:04:17 +00:00
stronk7
a504ba0213 Added index_exists(). One wrapper over find_index_name() 2006-09-30 12:56:39 +00:00
stronk7
68bc165bed Added new function table_exists() to be used later... 2006-09-30 12:01:33 +00:00
stronk7
87c6baf4a1 Ah! forgot to interchange keys and values! 2006-09-30 11:09:44 +00:00
stronk7
ef18962b00 Execute the index_get_name() silently to avoid a lot of
output in the install/upgrade process. Original db->debug
is re-set to their original status once executed.
2006-09-30 10:54:37 +00:00
stronk7
f020b35705 Moving some change_field_XXX() functions and introducing
change_field_type(). Seems to work everywere but under
mssql (due to some problems with default constraints).
Will see it tomorrow.
2006-09-28 23:14:52 +00:00
stronk7
5adc951c4f Don't rely on index names to decide if we have to drop one key 2006-09-28 22:05:11 +00:00
stronk7
71ea93e023 Argh! More than 3 hours searching for this error! I was calling one
constructor with wrong number of parameters and PHP said nothing at
all (with DEVELOPER level of debugging). Horrible OOP !
2006-09-28 20:06:08 +00:00
stronk7
53d3b80798 prevent some warnings on tables without indexes 2006-09-28 19:43:17 +00:00