From fab8a3dab6f6b470756bb243b31c511258ee82e4 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 9 Feb 2023 14:17:29 +0900 Subject: [PATCH 1/6] docs: clarify the method name --- user_guide_src/source/dbmgmt/forge.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/dbmgmt/forge.rst b/user_guide_src/source/dbmgmt/forge.rst index a3b74e979966..934e9e3a64e7 100644 --- a/user_guide_src/source/dbmgmt/forge.rst +++ b/user_guide_src/source/dbmgmt/forge.rst @@ -116,7 +116,7 @@ After the fields have been defined, they can be added using $forge->addField() ------------------ -The add fields method will accept the above array. +The ``addField()`` method will accept the above array. .. _forge-addfield-default-value-rawsql: From d89d6fc6b9f8fc22597bef822a4e4c5fc59c1e59 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 9 Feb 2023 14:18:12 +0900 Subject: [PATCH 2/6] docs: clarify above --- user_guide_src/source/dbmgmt/forge.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/dbmgmt/forge.rst b/user_guide_src/source/dbmgmt/forge.rst index 934e9e3a64e7..3714dd07a976 100644 --- a/user_guide_src/source/dbmgmt/forge.rst +++ b/user_guide_src/source/dbmgmt/forge.rst @@ -86,6 +86,8 @@ There are several things you may wish to do when creating tables. Add fields, add keys to the table, alter columns. CodeIgniter provides a mechanism for this. +.. _adding-fields: + Adding Fields ============= @@ -249,8 +251,8 @@ $forge->addColumn() ------------------- The ``addColumn()`` method is used to modify an existing table. It -accepts the same field array as above, and can be used for an unlimited -number of additional fields. +accepts the same field array as :ref:`Creating Tables `, and can +be used for an unlimited number of additional fields. .. literalinclude:: forge/022.php From e93fc0a4e50d6e61a53f32abc0b65fd832b1a6b6 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 9 Feb 2023 14:20:42 +0900 Subject: [PATCH 3/6] docs: add "existing" --- user_guide_src/source/dbmgmt/forge.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/dbmgmt/forge.rst b/user_guide_src/source/dbmgmt/forge.rst index 3714dd07a976..01ace8e60029 100644 --- a/user_guide_src/source/dbmgmt/forge.rst +++ b/user_guide_src/source/dbmgmt/forge.rst @@ -350,7 +350,7 @@ Class Reference :returns: true on success, false on failure :rtype: bool - Adds a column to a table. Usage: See `Adding a Field to a Table`_. + Adds a column to an existing table. Usage: See `Adding a Field to a Table`_. .. php:method:: addField($field) From 73d6d624c8c8d780e334679909d8251b33543466 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 9 Feb 2023 14:21:36 +0900 Subject: [PATCH 4/6] docs: fix classname notation --- user_guide_src/source/dbmgmt/forge.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/user_guide_src/source/dbmgmt/forge.rst b/user_guide_src/source/dbmgmt/forge.rst index 01ace8e60029..dafabfdaed57 100644 --- a/user_guide_src/source/dbmgmt/forge.rst +++ b/user_guide_src/source/dbmgmt/forge.rst @@ -355,8 +355,8 @@ Class Reference .. php:method:: addField($field) :param array $field: Field definition to add - :returns: \CodeIgniter\Database\Forge instance (method chaining) - :rtype: \CodeIgniter\Database\Forge + :returns: ``\CodeIgniter\Database\Forge`` instance (method chaining) + :rtype: ``\CodeIgniter\Database\Forge`` Adds a field to the set that will be used to create a table. Usage: See `Adding Fields`_. @@ -368,8 +368,8 @@ Class Reference :param string $onUpdate: Desired action for the "on update" :param string $onDelete: Desired action for the "on delete" :param string $fkName: Name of foreign key. This does not work with SQLite3 - :returns: \CodeIgniter\Database\Forge instance (method chaining) - :rtype: \CodeIgniter\Database\Forge + :returns: ``\CodeIgniter\Database\Forge`` instance (method chaining) + :rtype: ``\CodeIgniter\Database\Forge`` Adds a foreign key to the set that will be used to create a table. Usage: See `Adding Foreign Keys`_. @@ -381,8 +381,8 @@ Class Reference :param bool $primary: Set to true if it should be a primary key or a regular one :param bool $unique: Set to true if it should be a unique key or a regular one :param string $keyName: Name of key to be added - :returns: \CodeIgniter\Database\Forge instance (method chaining) - :rtype: \CodeIgniter\Database\Forge + :returns: ``\CodeIgniter\Database\Forge`` instance (method chaining) + :rtype: ``\CodeIgniter\Database\Forge`` Adds a key to the set that will be used to create a table. Usage: See `Adding Keys`_. @@ -392,8 +392,8 @@ Class Reference :param mixed $key: Name of a key field or an array of fields :param string $keyName: Name of key to be added - :returns: \CodeIgniter\Database\Forge instance (method chaining) - :rtype: \CodeIgniter\Database\Forge + :returns: ``\CodeIgniter\Database\Forge`` instance (method chaining) + :rtype: ``\CodeIgniter\Database\Forge`` Adds a primary key to the set that will be used to create a table. Usage: See `Adding Keys`_. @@ -403,8 +403,8 @@ Class Reference :param mixed $key: Name of a key field or an array of fields :param string $keyName: Name of key to be added - :returns: \CodeIgniter\Database\Forge instance (method chaining) - :rtype: \CodeIgniter\Database\Forge + :returns: ``\CodeIgniter\Database\Forge`` instance (method chaining) + :rtype: ``\CodeIgniter\Database\Forge`` Adds a unique key to the set that will be used to create a table. Usage: See `Adding Keys`_. From 6af6a8579eabc558c4c6ec19bd7b846bb6e5231f Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 9 Feb 2023 14:22:02 +0900 Subject: [PATCH 5/6] docs: remove unneeded space --- user_guide_src/source/dbmgmt/forge.rst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/user_guide_src/source/dbmgmt/forge.rst b/user_guide_src/source/dbmgmt/forge.rst index dafabfdaed57..ff53a9ae3c5f 100644 --- a/user_guide_src/source/dbmgmt/forge.rst +++ b/user_guide_src/source/dbmgmt/forge.rst @@ -358,7 +358,7 @@ Class Reference :returns: ``\CodeIgniter\Database\Forge`` instance (method chaining) :rtype: ``\CodeIgniter\Database\Forge`` - Adds a field to the set that will be used to create a table. Usage: See `Adding Fields`_. + Adds a field to the set that will be used to create a table. Usage: See `Adding Fields`_. .. php:method:: addForeignKey($fieldName, $tableName, $tableField[, $onUpdate = '', $onDelete = '', $fkName = '']) @@ -371,7 +371,7 @@ Class Reference :returns: ``\CodeIgniter\Database\Forge`` instance (method chaining) :rtype: ``\CodeIgniter\Database\Forge`` - Adds a foreign key to the set that will be used to create a table. Usage: See `Adding Foreign Keys`_. + Adds a foreign key to the set that will be used to create a table. Usage: See `Adding Foreign Keys`_. .. note:: ``$fkName`` can be used since v4.3.0. @@ -384,7 +384,7 @@ Class Reference :returns: ``\CodeIgniter\Database\Forge`` instance (method chaining) :rtype: ``\CodeIgniter\Database\Forge`` - Adds a key to the set that will be used to create a table. Usage: See `Adding Keys`_. + Adds a key to the set that will be used to create a table. Usage: See `Adding Keys`_. .. note:: ``$keyName`` can be used since v4.3.0. @@ -395,7 +395,7 @@ Class Reference :returns: ``\CodeIgniter\Database\Forge`` instance (method chaining) :rtype: ``\CodeIgniter\Database\Forge`` - Adds a primary key to the set that will be used to create a table. Usage: See `Adding Keys`_. + Adds a primary key to the set that will be used to create a table. Usage: See `Adding Keys`_. .. note:: ``$keyName`` can be used since v4.3.0. @@ -406,7 +406,7 @@ Class Reference :returns: ``\CodeIgniter\Database\Forge`` instance (method chaining) :rtype: ``\CodeIgniter\Database\Forge`` - Adds a unique key to the set that will be used to create a table. Usage: See `Adding Keys`_. + Adds a unique key to the set that will be used to create a table. Usage: See `Adding Keys`_. .. note:: ``$keyName`` can be used since v4.3.0. @@ -417,7 +417,7 @@ Class Reference :returns: true on success, false on failure :rtype: bool - Creates a new database. Usage: See `Creating and Dropping Databases`_. + Creates a new database. Usage: See `Creating and Dropping Databases`_. .. php:method:: createTable($table[, $if_not_exists = false[, array $attributes = []]]) @@ -427,7 +427,7 @@ Class Reference :returns: Query object on success, false on failure :rtype: mixed - Creates a new table. Usage: See `Creating a Table`_. + Creates a new table. Usage: See `Creating a Table`_. .. php:method:: dropColumn($table, $column_name) @@ -436,7 +436,7 @@ Class Reference :returns: true on success, false on failure :rtype: bool - Drops single or multiple columns from a table. Usage: See `Dropping Fields From a Table`_. + Drops single or multiple columns from a table. Usage: See `Dropping Fields From a Table`_. .. php:method:: dropDatabase($dbName) @@ -444,7 +444,7 @@ Class Reference :returns: true on success, false on failure :rtype: bool - Drops a database. Usage: See `Creating and Dropping Databases`_. + Drops a database. Usage: See `Creating and Dropping Databases`_. .. php:method:: dropKey($table, $keyName[, $prefixKeyName = true]) @@ -476,7 +476,7 @@ Class Reference :returns: true on success, false on failure :rtype: bool - Drops a table. Usage: See `Dropping a Table`_. + Drops a table. Usage: See `Dropping a Table`_. .. php:method:: processIndexes($table) @@ -497,7 +497,7 @@ Class Reference :returns: true on success, false on failure :rtype: bool - Modifies a table column. Usage: See `Modifying a Field in a Table`_. + Modifies a table column. Usage: See `Modifying a Field in a Table`_. .. php:method:: renameTable($table_name, $new_table_name) @@ -506,4 +506,4 @@ Class Reference :returns: Query object on success, false on failure :rtype: mixed - Renames a table. Usage: See `Renaming a Table`_. + Renames a table. Usage: See `Renaming a Table`_. From 4b153141a2d1eae9b47717abe3f30a14283fe349 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 10 Feb 2023 09:36:52 +0900 Subject: [PATCH 6/6] docs: fix incorrect description DBMS has its own maximum column number in a table. --- user_guide_src/source/dbmgmt/forge.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/dbmgmt/forge.rst b/user_guide_src/source/dbmgmt/forge.rst index ff53a9ae3c5f..21da852e9d4f 100644 --- a/user_guide_src/source/dbmgmt/forge.rst +++ b/user_guide_src/source/dbmgmt/forge.rst @@ -252,7 +252,7 @@ $forge->addColumn() The ``addColumn()`` method is used to modify an existing table. It accepts the same field array as :ref:`Creating Tables `, and can -be used for an unlimited number of additional fields. +be used to add additional fields. .. literalinclude:: forge/022.php