1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5
Bugzilla::DB::Schema</title>
6
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7
<link rel="stylesheet" title="style" type="text/css" href="../../style.css" media="all" >
11
<p class="backlinktop"><b><a name="___top" href="../../index.html" accesskey="1" title="All Documents"><<</a></b></p>
12
<h1>Bugzilla::DB::Schema</h1>
13
<div class='indexgroup'>
14
<ul class='indexList indexList1'>
15
<li class='indexItem indexItem1'><a href='#NAME'>NAME</a>
16
<li class='indexItem indexItem1'><a href='#SYNOPSIS'>SYNOPSIS</a>
17
<li class='indexItem indexItem1'><a href='#DESCRIPTION'>DESCRIPTION</a>
18
<li class='indexItem indexItem1'><a href='#NEW_TO_SCHEMA.PM%3F'>NEW TO SCHEMA.PM?</a>
19
<li class='indexItem indexItem1'><a href='#CONSTANTS'>CONSTANTS</a>
20
<li class='indexItem indexItem1'><a href='#METHODS'>METHODS</a>
21
<li class='indexItem indexItem1'><a href='#SERIALIZATION%2FDESERIALIZATION'>SERIALIZATION/DESERIALIZATION</a>
22
<li class='indexItem indexItem1'><a href='#CLASS_METHODS'>CLASS METHODS</a>
23
<li class='indexItem indexItem1'><a href='#ABSTRACT_DATA_TYPES'>ABSTRACT DATA TYPES</a>
24
<li class='indexItem indexItem1'><a href='#SEE_ALSO'>SEE ALSO</a>
28
<h1><a class='u' href='#___top' title='click to go to top of document'
32
<p>Bugzilla::DB::Schema - Abstract database schema for Bugzilla</p>
34
<h1><a class='u' href='#___top' title='click to go to top of document'
38
<pre class="code"> # Obtain MySQL database schema.
39
# Do not do this. Use Bugzilla::DB instead.
40
use Bugzilla::DB::Schema;
41
my $mysql_schema = new Bugzilla::DB::Schema('Mysql');
43
# Recommended way to obtain database schema.
45
my $dbh = Bugzilla->dbh;
46
my $schema = $dbh->_bz_schema();
48
# Get the list of tables in the Bugzilla database.
49
my @tables = $schema->get_table_list();
51
# Get the SQL statements need to create the bugs table.
52
my @statements = $schema->get_table_ddl('bugs');
54
# Get the database-specific SQL data type used to implement
55
# the abstract data type INT1.
56
my $db_specific_type = $schema->sql_type('INT1');</pre>
58
<h1><a class='u' href='#___top' title='click to go to top of document'
62
<p>This module implements an object-oriented, abstract database schema. It should be considered package-private to the Bugzilla::DB module. That means that CGI scripts should never call any function in this module directly, but should instead rely on methods provided by Bugzilla::DB.</p>
64
<h1><a class='u' href='#___top' title='click to go to top of document'
65
name="NEW_TO_SCHEMA.PM?"
66
>NEW TO SCHEMA.PM?</a></h1>
68
<p>If this is your first time looking at Schema.pm, especially if you are making changes to the database, please take a look at <a href="http://www.bugzilla.org/docs/developer.html#sql-schema" class="podlinkurl"
69
>http://www.bugzilla.org/docs/developer.html#sql-schema</a> to learn more about how this integrates into the rest of Bugzilla.</p>
71
<h1><a class='u' href='#___top' title='click to go to top of document'
76
<dt><a name="SCHEMA_VERSION"
77
><code class="code">SCHEMA_VERSION</code></a></dt>
80
<p>The 'version' of the internal schema structure. This version number is incremented every time the the fundamental structure of Schema internals changes.</p>
82
<p>This is NOT changed every time a table or a column is added. This number is incremented only if the internal structures of this Schema would be incompatible with the internal structures of a previous Schema version.</p>
84
<p>In general, unless you are messing around with serialization and deserialization of the schema, you don't need to worry about this constant.</p>
86
<dt><a name="ABSTRACT_SCHEMA"
87
><code class="code">ABSTRACT_SCHEMA</code></a></dt>
90
<p>The abstract database schema structure consists of a hash reference in which each key is the name of a table in the Bugzilla database.</p>
92
<p>The value for each key is a hash reference containing the keys <code class="code">FIELDS</code> and <code class="code">INDEXES</code> which in turn point to array references containing information on the table's fields and indexes.</p>
94
<p>A field hash reference should must contain the key <code class="code">TYPE</code>. Optional field keys include <code class="code">PRIMARYKEY</code>, <code class="code">NOTNULL</code>, and <code class="code">DEFAULT</code>.</p>
96
<p>The <code class="code">INDEXES</code> array reference contains index names and information regarding the index. If the index name points to an array reference, then the index is a regular index and the array contains the indexed columns. If the index name points to a hash reference, then the hash must contain the key <code class="code">FIELDS</code>. It may also contain the key <code class="code">TYPE</code>, which can be used to specify the type of index such as UNIQUE or FULLTEXT.</p>
100
<h1><a class='u' href='#___top' title='click to go to top of document'
104
<p>Note: Methods which can be implemented generically for all DBs are implemented in this module. If needed, they can be overridden with DB-specific code in a subclass. Methods which are prefixed with <code class="code">_</code> are considered protected. Subclasses may override these methods, but other modules should not invoke these methods directly.</p>
108
><code class="code">new</code></a></dt>
111
<pre class="code"> Description: Public constructor method used to instantiate objects of this
112
class. However, it also can be used as a factory method to
113
instantiate database-specific subclasses when an optional
114
driver argument is supplied.
115
Parameters: $driver (optional) - Used to specify the type of database.
116
This routine C<die>s if no subclass is found for the specified
118
$schema (optional) - A reference to a hash. Callers external
119
to this package should never use this parameter.
120
Returns: new instance of the Schema class or a database-specific subclass</pre>
122
<dt><a name="_initialize"
123
><code class="code">_initialize</code></a></dt>
126
<pre class="code"> Description: Protected method that initializes an object after
127
instantiation with the abstract schema. All subclasses should
128
override this method. The typical subclass implementation
129
should first call the C<_initialize> method of the superclass,
130
then do any database-specific initialization (especially
131
define the database-specific implementation of the all
132
abstract data types), and then call the C<_adjust_schema>
134
Parameters: $abstract_schema (optional) - A reference to a hash. If
135
provided, this hash will be used as the internal
136
representation of the abstract schema instead of our
137
default abstract schema. This is intended for internal
138
use only by deserialize_abstract.
139
Returns: the instance of the Schema class</pre>
141
<dt><a name="_adjust_schema"
142
><code class="code">_adjust_schema</code></a></dt>
145
<pre class="code"> Description: Protected method that alters the abstract schema at
146
instantiation-time to be database-specific. It is a generic
147
enough routine that it can be defined here in the base class.
148
It takes the abstract schema and replaces the abstract data
149
types with database-specific data types.
151
Returns: the instance of the Schema class</pre>
153
<dt><a name="get_type_ddl"
154
><code class="code">get_type_ddl</code></a></dt>
157
<pre class="code"> Description: Public method to convert abstract (database-generic) field
158
specifiers to database-specific data types suitable for use
159
in a C<CREATE TABLE> or C<ALTER TABLE> SQL statment. If no
160
database-specific field type has been defined for the given
161
field type, then it will just return the same field type.
162
Parameters: a hash or a reference to a hash of a field containing the
163
following keys: C<TYPE> (required), C<NOTNULL> (optional),
164
C<DEFAULT> (optional), C<PRIMARYKEY> (optional), C<REFERENCES>
166
Returns: a DDL string suitable for describing a field in a
167
C<CREATE TABLE> or C<ALTER TABLE> SQL statement</pre>
169
<dt><a name="convert_type"
170
><code class="code">convert_type</code></a></dt>
173
<p>Converts a TYPE from the <a href="#ABSTRACT_SCHEMA" class="podlinkpod"
174
>"ABSTRACT_SCHEMA"</a> format into the real SQL type.</p>
176
<dt><a name="get_column($table,_$column)"
177
><code class="code">get_column($table, $column)</code></a></dt>
180
<pre class="code"> Description: Public method to get the abstract definition of a column.
181
Parameters: $table - the table name
182
$column - a column in the table
183
Returns: a hashref containing information about the column, including its
184
type (C<TYPE>), whether or not it can be null (C<NOTNULL>),
185
its default value if it has one (C<DEFAULT), etc.
186
Returns undef if the table or column does not exist.</pre>
188
<dt><a name="get_table_list"
189
><code class="code">get_table_list</code></a></dt>
192
<pre class="code"> Description: Public method for discovering what tables should exist in the
195
Returns: an array of table names</pre>
197
<dt><a name="get_table_columns"
198
><code class="code">get_table_columns</code></a></dt>
201
<pre class="code"> Description: Public method for discovering what columns are in a given
202
table in the Bugzilla database.
203
Parameters: $table - the table name
204
Returns: array of column names</pre>
206
<dt><a name="get_table_ddl"
207
><code class="code">get_table_ddl</code></a></dt>
210
<pre class="code"> Description: Public method to generate the SQL statements needed to create
211
the a given table and its indexes in the Bugzilla database.
212
Subclasses may override or extend this method, if needed, but
213
subclasses probably should override C<_get_create_table_ddl>
214
or C<_get_create_index_ddl> instead.
215
Parameters: $table - the table name
216
Returns: an array of strings containing SQL statements</pre>
218
<dt><a name="_get_create_table_ddl"
219
><code class="code">_get_create_table_ddl</code></a></dt>
222
<pre class="code"> Description: Protected method to generate the "create table" SQL statement
224
Parameters: $table - the table name
225
Returns: a string containing the DDL statement for the specified table</pre>
227
<dt><a name="_get_create_index_ddl"
228
><code class="code">_get_create_index_ddl</code></a></dt>
231
<pre class="code"> Description: Protected method to generate a "create index" SQL statement
232
for a given table and index.
233
Parameters: $table_name - the name of the table
234
$index_name - the name of the index
235
$index_fields - a reference to an array of field names
236
$index_type (optional) - specify type of index (e.g., UNIQUE)
237
Returns: a string containing the DDL statement</pre>
239
<dt><a name="get_add_column_ddl($table,_$column,_\%definition,_$init_value)"
240
><code class="code">get_add_column_ddl($table, $column, \%definition, $init_value)</code></a></dt>
243
<pre class="code"> Description: Generate SQL to add a column to a table.
244
Params: $table - The table containing the column.
245
$column - The name of the column being added.
246
\%definition - The new definition for the column,
247
in standard C<ABSTRACT_SCHEMA> format.
248
$init_value - (optional) An initial value to set
249
the column to. Should already be SQL-quoted
251
Returns: An array of SQL statements.</pre>
253
<dt><a name="get_add_index_ddl"
254
><code class="code">get_add_index_ddl</code></a></dt>
257
<pre class="code"> Description: Gets SQL for creating an index.
258
NOTE: Subclasses should not override this function. Instead,
259
if they need to specify a custom CREATE INDEX statement,
260
they should override C<_get_create_index_ddl>
261
Params: $table - The name of the table the index will be on.
262
$name - The name of the new index.
263
$definition - An index definition. Either a hashref
264
with FIELDS and TYPE or an arrayref
265
containing a list of columns.
266
Returns: An array of SQL statements that will create the
267
requested index.</pre>
269
<dt><a name="get_alter_column_ddl($table,_$column,_\%definition)"
270
><code class="code">get_alter_column_ddl($table, $column, \%definition)</code></a></dt>
273
<pre class="code"> Description: Generate SQL to alter a column in a table.
274
The column that you are altering must exist,
275
and the table that it lives in must exist.
276
Params: $table - The table containing the column.
277
$column - The name of the column being changed.
278
\%definition - The new definition for the column,
279
in standard C<ABSTRACT_SCHEMA> format.
280
$set_nulls_to - A value to set NULL values to, if
281
your new definition is NOT NULL and contains
282
no DEFAULT, and when there is a possibility
283
that the column could contain NULLs. $set_nulls_to
284
should be already SQL-quoted if necessary.
285
Returns: An array of SQL statements.</pre>
287
<dt><a name="get_drop_index_ddl($table,_$name)"
288
><code class="code">get_drop_index_ddl($table, $name)</code></a></dt>
291
<pre class="code"> Description: Generates SQL statements to drop an index.
292
Params: $table - The table the index is on.
293
$name - The name of the index being dropped.
294
Returns: An array of SQL statements.</pre>
296
<dt><a name="get_drop_column_ddl($table,_$column)"
297
><code class="code">get_drop_column_ddl($table, $column)</code></a></dt>
300
<pre class="code"> Description: Generate SQL to drop a column from a table.
301
Params: $table - The table containing the column.
302
$column - The name of the column being dropped.
303
Returns: An array of SQL statements.</pre>
305
<dt><a name="get_drop_table_ddl($table)"
306
><code class="code">get_drop_table_ddl($table)</code></a></dt>
309
<pre class="code"> Description: Generate SQL to drop a table from the database.
310
Params: $table - The name of the table to drop.
311
Returns: An array of SQL statements.</pre>
313
<dt><a name="get_rename_column_ddl($table,_$old_name,_$new_name)"
314
><code class="code">get_rename_column_ddl($table, $old_name, $new_name)</code></a></dt>
317
<pre class="code"> Description: Generate SQL to change the name of a column in a table.
318
NOTE: ANSI SQL contains no simple way to rename a column,
319
so this function is ABSTRACT and must be implemented
321
Params: $table - The table containing the column to be renamed.
322
$old_name - The name of the column being renamed.
323
$new_name - The name the column is changing to.
324
Returns: An array of SQL statements.</pre>
326
<dt><a name="get_rename_table_sql"
327
><code class="code">get_rename_table_sql</code></a></dt>
331
<dt><a name="Description"
332
><b>Description</b></a></dt>
335
<p>Gets SQL to rename a table in the database.</p>
338
><b>Params</b></a></dt>
342
<dt><a name="$old_name_-_The_current_name_of_the_table."
343
><code class="code">$old_name</code> - The current name of the table.
344
<dt><a name="$new_name_-_The_new_name_of_the_table."
345
><code class="code">$new_name</code> - The new name of the table.</a></dt>
348
<dt><a name="Returns:_An_array_of_SQL_statements_to_rename_a_table."
349
><b>Returns</b>: An array of SQL statements to rename a table.</a></dt>
352
<dt><a name="delete_table($name)"
353
><code class="code">delete_table($name)</code></a></dt>
356
<pre class="code"> Description: Deletes a table from this Schema object.
357
Dies if you try to delete a table that doesn't exist.
358
Params: $name - The name of the table to delete.
359
Returns: nothing</pre>
361
<dt><a name="get_column_abstract($table,_$column)"
362
><code class="code">get_column_abstract($table, $column)</code></a></dt>
365
<pre class="code"> Description: A column definition from the abstract internal schema.
366
cross-database format.
367
Params: $table - The name of the table
368
$column - The name of the column that you want
369
Returns: A hash reference. For the format, see the docs for
370
C<ABSTRACT_SCHEMA>.
371
Returns undef if the column or table does not exist.</pre>
373
<dt><a name="get_indexes_on_column_abstract($table,_$column)"
374
><code class="code">get_indexes_on_column_abstract($table, $column)</code></a></dt>
377
<pre class="code"> Description: Gets a list of indexes that are on a given column.
378
Params: $table - The table the column is on.
379
$column - The name of the column.
380
Returns: Indexes in the standard format of an INDEX
381
entry on a table. That is, key-value pairs
382
where the key is the index name and the value
383
is the index definition.
384
If there are no indexes on that column, we return
387
<dt><a name="get_index_abstract($table,_$index)"
388
><code class="code">get_index_abstract($table, $index)</code></a></dt>
391
<pre class="code"> Description: Returns an index definition from the internal abstract schema.
392
Params: $table - The table the index is on.
393
$index - The name of the index.
394
Returns: A hash reference representing an index definition.
395
See the C<ABSTRACT_SCHEMA> docs for details.
396
Returns undef if the index does not exist.</pre>
398
<dt><a name="get_table_abstract($table)"
399
><code class="code">get_table_abstract($table)</code></a></dt>
402
<pre class="code"> Description: Gets the abstract definition for a table in this Schema
404
Params: $table - The name of the table you want a definition for.
405
Returns: An abstract table definition, or undef if the table doesn't
408
<dt><a name="add_table($name,_\%definition)"
409
><code class="code">add_table($name, \%definition)</code></a></dt>
412
<pre class="code"> Description: Creates a new table in this Schema object.
413
If you do not specify a definition, we will
414
simply create an empty table.
415
Params: $name - The name for the new table.
416
\%definition (optional) - An abstract definition for
418
Returns: nothing</pre>
420
<dt><a name="rename_table"
421
><code class="code">rename_table</code></a></dt>
424
<p>Renames a table from <code class="code">$old_name</code> to <code class="code">$new_name</code> in this Schema object.</p>
426
<dt><a name="delete_column($table,_$column)"
427
><code class="code">delete_column($table, $column)</code></a></dt>
430
<pre class="code"> Description: Deletes a column from this Schema object.
431
Params: $table - Name of the table that the column is in.
432
The table must exist, or we will fail.
433
$column - Name of the column to delete.
434
Returns: nothing</pre>
436
<dt><a name="rename_column($table,_$old_name,_$new_name)"
437
><code class="code">rename_column($table, $old_name, $new_name)</code></a></dt>
440
<pre class="code"> Description: Renames a column on a table in the Schema object.
441
The column that you are renaming must exist.
442
Params: $table - The table the column is on.
443
$old_name - The current name of the column.
444
$new_name - The new name of hte column.
445
Returns: nothing</pre>
447
<dt><a name="set_column($table,_$column,_\%new_def)"
448
><code class="code">set_column($table, $column, \%new_def)</code></a></dt>
451
<pre class="code"> Description: Changes the definition of a column in this Schema object.
452
If the column doesn't exist, it will be added.
453
The table that you specify must already exist in the Schema.
454
NOTE: This does not affect the database on the disk.
455
Use the C<Bugzilla::DB> "Schema Modification Methods"
456
if you want to do that.
457
Params: $table - The name of the table that the column is on.
458
$column - The name of the column.
459
\%new_def - The new definition for the column, in
460
C<ABSTRACT_SCHEMA> format.
461
Returns: nothing</pre>
463
<dt><a name="set_index($table,_$name,_$definition)"
464
><code class="code">set_index($table, $name, $definition)</code></a></dt>
467
<pre class="code"> Description: Changes the definition of an index in this Schema object.
468
If the index doesn't exist, it will be added.
469
The table that you specify must already exist in the Schema.
470
NOTE: This does not affect the database on the disk.
471
Use the C<Bugzilla::DB> "Schema Modification Methods"
472
if you want to do that.
473
Params: $table - The table the index is on.
474
$name - The name of the index.
475
$definition - A hashref or an arrayref. An index
476
definition in C<ABSTRACT_SCHEMA> format.
477
Returns: nothing</pre>
479
<dt><a name="delete_index($table,_$name)"
480
><code class="code">delete_index($table, $name)</code></a></dt>
483
<pre class="code"> Description: Removes an index definition from this Schema object.
484
If the index doesn't exist, we will fail.
485
The table that you specify must exist in the Schema.
486
NOTE: This does not affect the database on the disk.
487
Use the C<Bugzilla::DB> "Schema Modification Methods"
488
if you want to do that.
489
Params: $table - The table the index is on.
490
$name - The name of the index that we're removing.
491
Returns: nothing</pre>
493
<dt><a name="columns_equal($col_one,_$col_two)"
494
><code class="code">columns_equal($col_one, $col_two)</code></a></dt>
497
<pre class="code"> Description: Tells you if two columns have entirely identical definitions.
498
The TYPE field's value will be compared case-insensitive.
499
However, all other fields will be case-sensitive.
500
Params: $col_one, $col_two - The columns to compare. Hash
501
references, in C<ABSTRACT_SCHEMA> format.
502
Returns: C<1> if the columns are identical, C<0> if they are not.</pre>
506
<h1><a class='u' href='#___top' title='click to go to top of document'
507
name="SERIALIZATION/DESERIALIZATION"
508
>SERIALIZATION/DESERIALIZATION</a></h1>
511
<dt><a name="serialize_abstract()"
512
><code class="code">serialize_abstract()</code></a></dt>
515
<pre class="code"> Description: Serializes the "abstract" schema into a format
516
that deserialize_abstract() can read in. This is
517
a method, called on a Schema instance.
519
Returns: A scalar containing the serialized, abstract schema.
520
Do not attempt to manipulate this data directly,
521
as the format may change at any time in the future.
522
The only thing you should do with the returned value
523
is either store it somewhere (coupled with appropriate
524
SCHEMA_VERSION) or deserialize it.</pre>
526
<dt><a name="deserialize_abstract($serialized,_$version)"
527
><code class="code">deserialize_abstract($serialized, $version)</code></a></dt>
530
<pre class="code"> Description: Used for when you've read a serialized Schema off the disk,
531
and you want a Schema object that represents that data.
532
Params: $serialized - scalar. The serialized data.
533
$version - A number in the format X.YZ. The "version"
534
of the Schema that did the serialization.
535
See the docs for C<SCHEMA_VERSION> for more details.
536
Returns: A Schema object. It will have the methods of (and work
537
in the same fashion as) the current version of Schema.
538
However, it will represent the serialized data instead of
539
ABSTRACT_SCHEMA.</pre>
543
<h1><a class='u' href='#___top' title='click to go to top of document'
545
>CLASS METHODS</a></h1>
547
<p>These methods are generally called on the class instead of on a specific object.</p>
550
<dt><a name="get_empty_schema()"
551
><code class="code">get_empty_schema()</code></a></dt>
554
<pre class="code"> Description: Returns a Schema that has no tables. In effect, this
555
Schema is totally "empty."
557
Returns: A "empty" Schema object.</pre>
561
<h1><a class='u' href='#___top' title='click to go to top of document'
562
name="ABSTRACT_DATA_TYPES"
563
>ABSTRACT DATA TYPES</a></h1>
565
<p>The size and range data provided here is only intended as a guide. See your database's Bugzilla module (in this directory) for the most up-to-date values for these data types. The following abstract data types are used:</p>
568
<dt><a name="BOOLEAN"
569
><code class="code">BOOLEAN</code></a></dt>
572
<p>Logical value 0 or 1 where 1 is true, 0 is false.</p>
575
><code class="code">INT1</code></a></dt>
578
<p>Integer values (-128 - 127 or 0 - 255 unsigned).</p>
581
><code class="code">INT2</code></a></dt>
584
<p>Integer values (-32,768 - 32767 or 0 - 65,535 unsigned).</p>
587
><code class="code">INT3</code></a></dt>
590
<p>Integer values (-8,388,608 - 8,388,607 or 0 - 16,777,215 unsigned)</p>
593
><code class="code">INT4</code></a></dt>
596
<p>Integer values (-2,147,483,648 - 2,147,483,647 or 0 - 4,294,967,295 unsigned)</p>
598
<dt><a name="SMALLSERIAL"
599
><code class="code">SMALLSERIAL</code></a></dt>
602
<p>An auto-increment <a href="#INT1" class="podlinkpod"
603
>"INT1"</a></p>
605
<dt><a name="MEDIUMSERIAL"
606
><code class="code">MEDIUMSERIAL</code></a></dt>
609
<p>An auto-increment <a href="#INT3" class="podlinkpod"
610
>"INT3"</a></p>
612
<dt><a name="INTSERIAL"
613
><code class="code">INTSERIAL</code></a></dt>
616
<p>An auto-increment <a href="#INT4" class="podlinkpod"
617
>"INT4"</a></p>
619
<dt><a name="TINYTEXT"
620
><code class="code">TINYTEXT</code></a></dt>
623
<p>Variable length string of characters up to 255 (2^8 - 1) characters wide or more depending on the character set used.</p>
625
<dt><a name="MEDIUMTEXT"
626
><code class="code">MEDIUMTEXT</code></a></dt>
629
<p>Variable length string of characters up to 16M (2^24 - 1) characters wide or more depending on the character set used.</p>
632
><code class="code">TEXT</code></a></dt>
635
<p>Variable length string of characters up to 64K (2^16 - 1) characters wide or more depending on the character set used.</p>
637
<dt><a name="LONGBLOB"
638
><code class="code">LONGBLOB</code></a></dt>
641
<p>Variable length string of binary data up to 4M (2^32 - 1) bytes wide</p>
643
<dt><a name="DATETIME"
644
><code class="code">DATETIME</code></a></dt>
647
<p>DATETIME support varies from database to database, however, it's generally safe to say that DATETIME entries support all date/time combinations greater than 1900-01-01 00:00:00. Note that the format used is <code class="code">YYYY-MM-DD hh:mm:ss</code> to be safe, though it's possible that your database may not require leading zeros. For greatest compatibility, however, please make sure dates are formatted as above for queries to guarantee consistent results.</p>
651
<p>Database-specific subclasses should define the implementation for these data types as a hash reference stored internally in the schema object as <code class="code">db_specific</code>. This is typically done in overridden <a href="../../_initialize.html" class="podlinkpod"
652
>_initialize</a> method.</p>
654
<p>The following abstract boolean values should also be defined on a database-specific basis:</p>
658
><code class="code">TRUE</code>
660
><code class="code">FALSE</code></a></dt>
663
<h1><a class='u' href='#___top' title='click to go to top of document'
667
<p><a href="../../Bugzilla/DB.html" class="podlinkpod"
668
>Bugzilla::DB</a></p>
670
<p><a href="http://www.bugzilla.org/docs/developer.html#sql-schema" class="podlinkurl"
671
>http://www.bugzilla.org/docs/developer.html#sql-schema</a></p>
672
<p class="backlinkbottom"><b><a name="___bottom" href="../../index.html" title="All Documents"><<</a></b></p>