~coughphp/coughphp/2.0

« back to all changes in this revision

Viewing changes to tests/cough/config/database_schema_generator.inc.php

  • Committer: Anthony Bush
  • Date: 2008-08-23 03:35:08 UTC
  • mfrom: (262.1.18 coughphp-release-1.3)
  • Revision ID: anthony@anthonybush.com-20080823033508-uy4yn5pmio6wcetv
Accept release-1.3 branch changes into trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 * You don't have to pass these to the schema generator as it will use
6
6
 * reasonable defaults. The are replicated here to make them easy to change.
7
7
 *
8
 
 * @package schema_generator
 
8
 * @package tests
9
9
 * @author Anthony Bush
10
10
 **/
11
11
 
 
12
require(dirname(dirname(dirname(__FILE__))) . '/database_config.inc.php');
12
13
 
13
14
$config = array(
14
 
        // REQUIRED CONFIG
15
 
        
16
 
        // All databases will be scanned unless specified in the 'databases' parameter in the OPTIONAL CONFIG SECTION.
17
 
        'dsn' => array(
18
 
                'host' => 'localhost',
19
 
                'user' => 'cough_test',
20
 
                'pass' => 'cough_test',
21
 
                'port' => 3306,
22
 
                'driver' => 'mysql'
23
 
        ),
24
 
        
25
 
        // OPTIONAL ADDITIONAL CONFIG
26
 
        
 
15
        'dsn' => $dsn,
27
16
        'database_settings' => array(
28
 
                'include_databases_matching_regex' => '/^(test_cough_object)$/',
29
 
        ),
30
 
        
31
 
        'table_settings' => array(
32
 
                // This match setting is so the database scanner can resolve relationships better, e.g. know that when it sees "ticket_id" that a "wfl_ticket" table is an acceptable match.
33
 
                'match_table_name_prefixes' => array(), // Example: array('cust_', 'wfl_', 'baof_'),
34
 
                // You can ignore tables all together, too:
35
 
                'exclude_tables_matching_regex' => '/(_bak$)|(^bak_)|(^temp_)/',
36
 
        ),
37
 
        
38
 
        'field_settings' => array(
39
 
                // In case of non FK detection, you can have the Database Schema Generator check for ID columns matching this regex.
40
 
                // This is useful, for example, when no FK relationships set up)
41
 
                'id_to_table_regex' => '/^(.*)_id$/',
42
 
                'delete_flag_column' => 'is_retired',
43
 
                'delete_flag_value' => '1',
44
 
        ),
45
 
        
 
17
                'include_databases_matching_regex' => '/^(' . $dsn['db_name'] . ')$/',
 
18
        ),
46
19
);
47
20
 
48
21
?>