Commit Graph

53 Commits

Author SHA1 Message Date
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
stronk7 55c4b9435d add_key() and drop_key() are working (with sync of undelying
indexes automated)
2006-09-28 17:30:14 +00:00
stronk7 d335bebc06 Added support for add_index() and drop_index() 2006-09-26 23:17:24 +00:00
stronk7 7253d30810 Added one new function find_key_name() to retrieve the
name og any key in the DB. This hasn't too much sense
for now (until we start to use referencial integrity) and
it is far from perfect, because it doesn't seach for the
key really in DB (due to the lack of support for this of ADOdb).
2006-09-24 19:39:53 +00:00
stronk7 c1761c4292 XMLDB generators can return empty arrays if there is nothing to do. 2006-09-24 15:34:18 +00:00
stronk7 70a8ac6666 Given one xmldb_field, finds its name in DB 2006-09-24 08:26:24 +00:00
stronk7 0e9e0b3bb3 adding support for alter columns
(not finished yet)
2006-09-23 21:24:51 +00:00
skodak eef868d17d major whitespace cleanup - fixed trailng whitespace in new files and admin area 2006-09-20 21:00:45 +00:00
stronk7 f521d32b71 Two new functions added: add_field() and drop_field() 2006-09-12 22:23:00 +00:00
stronk7 b8359f7965 Adding options for continue and feedback to all the DDL functions. 2006-09-10 18:36:50 +00:00
stronk7 8830218f53 Initial support for DROP TABLE adedd. 2006-09-07 17:28:46 +00:00
stronk7 4dc4dde9e2 First implementation of the create_table() function. Simple. 2006-09-02 23:48:02 +00:00
tjhunt dd4a1bca28 During the conversion datalib -> ddllib, Eloy removed my comment that made it possible to understand how to use table_colum :-( Adding it back. 2006-08-24 15:37:03 +00:00
stronk7 134e3128bb Added the install_from_xmldb_file() function that
loads, transform and execute one entire XMLDB
file into the correct SQL sentences.
2006-08-20 15:50:27 +00:00