1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
Table Prefix support
--------------------
1. Introduction
A requested feature for some time, this functionality has finally been
added for OpenDb 0.50. It allows Opendb to coexist with other products
in the same database where tables such as 'user' could already be in
use by that other product.
The prefix support allows you to specify a unique prefix for the OpenDb
tables. For example a prefix of 'opendb050_' would prefix the opendb
tables thus:
opendb050_user
opendb050_borrowed_item
opendb050_review
opendb050_item
opendb050_item_instance
opendb050_item_attribute
opendb050_s_status_type
opendb050_s_item_type
opendb050_s_attribute_type
opendb050_s_item_attribute_type
opendb050_s_attribute_type_lookup
2. Configuration
The opendb table prefix support is enabled/disabled and configured
via a single include/config.php variable $CONFIG_VARS['db_server.table_prefix'].
If this variable is NULL, EMPTY or UNDEFINED table prefix support is
disabled.
3. Apply Prefixes
This step is very dependent on where you are in the installation
process.
3.1 New Install
If you are installing OpenDb for the first time and have no OpenDb
tables in the database as yet then before running patch.php ensure
the $CONFIG_VARS['db_server.table_prefix'] is defined.
You can then run the Install script as normal.
3.2 Patch DVDDBp 1.45 - 0.38
The patches for DVDDBp 1.45, 0.30rc5, 0.33-dev3, 0.34p2, 0.35p2, 0.36,
0.37 & 0.38 do _not_ provide support for table prefixes, so don't even
try to enable prefix support on an existing installed product from this
range.
3.3 Existing Installation
If you have an existing installation of OpenDb and have performed any
patches so that you have a OpenDb 0.50 level database you can
enable prefix support safely.
Before loading the patch.php ensure that $CONFIG_VARS['db_server.table_prefix'] is
defined. Load the patch.php script and choose the 'Prefix tables'
option. If all is well you should have two buttons 'Apply Prefixes'
and 'Remove Prefixes'. You can now click the 'Apply Prefixes' to add
prefix support. As long as all of the tables were correctly converted
your prefixing has been correctly applied.
4. Remove Prefixes
Ensure that $CONFIG_VARS['db_server.table_prefix'] is set to the current prefix
of your tables, which it should be if you have not modified this value since
apply prefixes. Load the patch.php script and choose the 'Prefix tables'
option; instead of 'Apply Prefixes' choose 'Remove Prefixes'. If all goes well
your prefixes should be removed. After this step be sure to disable the
$CONFIG_VARS['db_server.table_prefix'] variable in include/config.php.
5. Issues
Currently there is no automated way to recover from a failed
'Apply Prefixes' or 'Remove Prefixes'. You will have to open up phpMyAdmin
and manually remove/add prefixes yourself.
|