78 Commits

Author SHA1 Message Date
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
stronk7
7e13be0887 Splitting datalib.php in three libraries:
- ddllib.php: Where all the DDL (install/upgrade) functions will be.
  - dmllib.php: Where all the DML (select...) functions will be.
  - datalib.php: Legacy lib. Its contents should go to other libraries soon.
For more info see: http://docs.moodle.org/en/XMLDB_Roadmap (point 1)
2006-08-18 22:56:08 +00:00
stronk7
46d42a3cc5 Now ddllib includes all the required xmldb stuff 2006-08-17 16:59:14 +00:00
stronk7
f11bf81701 Initial commit of the ddllib (to perform DDL operations) 2006-08-15 09:08:17 +00:00