Skip to content

Commit aaf9cb2

Browse files
committed
docs: change text decoration
1 parent 7807496 commit aaf9cb2

1 file changed

Lines changed: 20 additions & 22 deletions

File tree

user_guide_src/source/dbmgmt/forge.rst

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Returns true/false based on success or failure::
4040
echo 'Database created!';
4141
}
4242

43-
An optional second parameter set to true will add IF EXISTS statement
43+
An optional second parameter set to true will add ``IF EXISTS`` statement
4444
or will check if a database exists before create it (depending on DBMS).
4545

4646
::
@@ -95,9 +95,9 @@ Adding fields
9595
=============
9696

9797
Fields are normally created via an associative array. Within the array, you must
98-
include a 'type' key that relates to the datatype of the field. For
98+
include a ``type`` key that relates to the datatype of the field. For
9999
example, INT, VARCHAR, TEXT, etc. Many datatypes (for example VARCHAR)
100-
also require a 'constraint' key.
100+
also require a ``constraint`` key.
101101

102102
::
103103

@@ -111,14 +111,14 @@ also require a 'constraint' key.
111111

112112
Additionally, the following key/values can be used:
113113

114-
- unsigned/true : to generate "UNSIGNED" in the field definition.
115-
- default/value : to generate a default value in the field definition.
116-
- null/true : to generate "null" in the field definition. Without this,
114+
- ``unsigned``/true : to generate "UNSIGNED" in the field definition.
115+
- ``default``/value : to generate a default value in the field definition.
116+
- ``null``/true : to generate "null" in the field definition. Without this,
117117
the field will default to "NOT null".
118-
- auto_increment/true : generates an auto_increment flag on the
118+
- ``auto_increment``/true : generates an auto_increment flag on the
119119
field. Note that the field type must be a type that supports this,
120120
such as integer.
121-
- unique/true : to generate a unique key for the field definition.
121+
- ``unique``/true : to generate a unique key for the field definition.
122122

123123
::
124124

@@ -162,15 +162,13 @@ Passing strings as fields
162162
-------------------------
163163

164164
If you know exactly how you want a field to be created, you can pass the
165-
string into the field definitions with addField()
166-
167-
::
165+
string into the field definitions with ``addField()``::
168166

169167
$forge->addField("label varchar(100) NOT NULL DEFAULT 'default label'");
170168

171169
.. note:: Passing raw strings as fields cannot be followed by ``addKey()`` calls on those fields.
172170

173-
.. note:: Multiple calls to addField() are cumulative.
171+
.. note:: Multiple calls to ``addField()`` are cumulative.
174172

175173
Creating an id field
176174
--------------------
@@ -188,10 +186,10 @@ Adding Keys
188186
===========
189187

190188
Generally speaking, you'll want your table to have Keys. This is
191-
accomplished with $forge->addKey('field'). The optional second
189+
accomplished with ``$forge->addKey('field')``. The optional second
192190
parameter set to true will make it a primary key and the third
193-
parameter set to true will make it a unique key. Note that addKey()
194-
must be followed by a call to createTable().
191+
parameter set to true will make it a unique key. Note that ``addKey()``
192+
must be followed by a call to ``createTable()``.
195193

196194
Multiple column non-primary keys must be sent as an array. Sample output
197195
below is for MySQL.
@@ -256,7 +254,7 @@ with
256254
$forge->createTable('table_name');
257255
// gives CREATE TABLE table_name
258256

259-
An optional second parameter set to true adds an "IF NOT EXISTS" clause
257+
An optional second parameter set to true adds an ``IF NOT EXISTS`` clause
260258
into the definition
261259

262260
::
@@ -277,7 +275,7 @@ You could also pass optional table attributes, such as MySQL's ``ENGINE``::
277275
Dropping a table
278276
================
279277

280-
Execute a DROP TABLE statement and optionally add an IF EXISTS clause.
278+
Execute a ``DROP TABLE`` statement and optionally add an ``IF EXISTS`` clause.
281279

282280
::
283281

@@ -287,7 +285,7 @@ Execute a DROP TABLE statement and optionally add an IF EXISTS clause.
287285
// Produces: DROP TABLE IF EXISTS `table_name`
288286
$forge->dropTable('table_name', true);
289287

290-
A third parameter can be passed to add a "CASCADE" option, which might be required for some
288+
A third parameter can be passed to add a ``CASCADE`` option, which might be required for some
291289
drivers to handle removal of tables with foreign keys.
292290

293291
::
@@ -348,7 +346,7 @@ number of additional fields.
348346
// Executes: ALTER TABLE `table_name` ADD `preferences` TEXT
349347

350348
If you are using MySQL or CUBIRD, then you can take advantage of their
351-
AFTER and FIRST clauses to position the new column.
349+
``AFTER`` and ``FIRST`` clauses to position the new column.
352350

353351
Examples::
354352

@@ -464,7 +462,7 @@ Class Reference
464462
.. php:method:: createDatabase($dbName[, $ifNotExists = false])
465463
466464
:param string $db_name: Name of the database to create
467-
:param string $ifNotExists: Set to true to add an 'IF NOT EXISTS' clause or check if database exists
465+
:param string $ifNotExists: Set to true to add an ``IF NOT EXISTS`` clause or check if database exists
468466
:returns: true on success, false on failure
469467
:rtype: bool
470468

@@ -473,7 +471,7 @@ Class Reference
473471
.. php:method:: createTable($table[, $if_not_exists = false[, array $attributes = []]])
474472
475473
:param string $table: Name of the table to create
476-
:param string $if_not_exists: Set to true to add an 'IF NOT EXISTS' clause
474+
:param string $if_not_exists: Set to true to add an ``IF NOT EXISTS`` clause
477475
:param string $attributes: An associative array of table attributes
478476
:returns: Query object on success, false on failure
479477
:rtype: mixed
@@ -500,7 +498,7 @@ Class Reference
500498
.. php:method:: dropTable($table_name[, $if_exists = false])
501499
502500
:param string $table: Name of the table to drop
503-
:param string $if_exists: Set to true to add an 'IF EXISTS' clause
501+
:param string $if_exists: Set to true to add an ``IF EXISTS`` clause
504502
:returns: true on success, false on failure
505503
:rtype: bool
506504

0 commit comments

Comments
 (0)