1.4.2.2 (checked in on 2008/03/30 at 20:42:13 by agentken)
// $Id: README.txt,v 1.4.2.2 2008/03/30 20:42:13 agentken Exp $
/**
Domain Access: Table Prefixing Dynamic table prefixing for Domain Access.
CONTENTS --------
1. Introduction 1.1 WARNING! 1.2 Use-Case 1.3 Sponsors 2. Installation 2.1 Dependencies 2.2 Configuration Options 3. Table Prefix Options 4. Drupal Upgrades 5. Developer Notes 5.1 Database Schema 5.2 PostgreSQL Users
---- 1. Introduction
The Domain Access: Table Prefixing module (called Domain Prefix), is an optional extension of the Domain Access module. Domain Prefix provides options for dynamically creating and selecting different database tables for affiliate sites.
The Domain Prefix module allows you to create, copy, and drop tables that are used by a specific domain. These tables are dynamically selected inside your site's settings.php file.
---- 1.1 WARNING!
Table prefixing is an advanced Drupal option; it should only be performed by experienced admins or by those willing to learn how table prefixing functions.
For more information, see http://drupal.org/node/2622.
This module may cause unexpected behavior. Test any changes to your database carefully.
To test basic functionality, I recommend prefixing the 'watchdog' table. Then test Drupal's error logging on variuous subdomains.
THIS MODULE WILL NOT WORK CORRECTLY ON pgSQL. See 4.2 for details.
---- 1.2 Use-Case
For affiliated sites, there are times when you want to use a different configuration or data set for each site (or for a select site).
In the original use-case, we needed to have different block settings for each affiliate.
---- 1.3 Example
To have different block settings for each affiliate, you would set the following tables to 'copy':
---- 1.3 Sponsors
Domain Prefix is sponsored by Morris DigitalWorks. http://morrisdigitalworks.com
---- 2. Installation
The Domain Prefix module is included in the Domain Access download. To install, untar the domain package and place the entire folder in your modules directory.
When you enable the module, it will create a {domain_prefix} table in your Drupal database.
For the module to function correctly, you must follow the instructions in INSTALL.txt.
---- 2.1 Dependencies
Domain Prefix requires the Domain Access module be installed and active.
Domain Prefix requires a change to your settings.php file, as indicated by the directions in INSTALL.txt
---- 2.2 Configuration Options
Clicking on the 'Table prefixing' tab takes you to a screen with configuration options:
Domain creation options: * [] Generate tables as defined below [] Do not generate any tables Determines what actions to take when creating new domain records.
This setting controls the behavior of newly created domain records. If set to 'Generate', then the module will attempt to create prefixed tables as defined.
When selecting options for table prefixing, you can now select which data source to use when copying tables. Use the select list to determine the source for data.
---- 3. Table Prefix Options
When using Domain Prefix, you have the following options for table creation.
---- 4. Drupal Upgrades
Running Drupal's upgrade script [update.php] respects the table prefixing provided by Domain Prefix. That is, if you run the script from one.example.com, it will update tables prefixed for that domain.
However, without hacking the update script, we cannot force ths script to update tables for all domains. In order to update you site correctly you must follow these steps.
---- 5. Developer Notes
Some issues:
---- 5.1 Database Schema
Installing the module creates a {domain_prefix} table that contains:
---- 5.2 PostgreSQL Users
Apologies. This module is not fully functional on pgSQL. Here are the features that work, and the issues that remain.
-- Table creation works. -- Table data copying works. -- Table dropping works.
However, the following issues make the above functions useless:
-- Copying table definitions (such as default values, NOT NULL) does not work. -- Creating indexes does not work. -- Creating sequences (and copying sequence values when necessary) does not work.
I did research these issues and, frankly, they are delaying the release of the module. I would love to support these features fully, but I suspect that it will have to wait for Drupal 6, when we can simply use the information contained in schema files.
To contribute, see http://drupal.org/node/200279