From 44bd10fa25c980737e7f2a731aefb46095b1f569 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 25 Mar 2008 22:27:37 +0000 Subject: userguide note, corrections and omissions --- user_guide/database/forge.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'user_guide/database/forge.html') diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index cfbe005a0..4b0588c6c 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -126,7 +126,7 @@ already be running, since the forge class relies on it.

  • unsigned/true : to generate "UNSIGNED" in the field definition
  • default/value : to generate a default value in the field definition
  • null/true : to generate "NULL" in the field definition. Without this, the field will default to "NOT NULL"
  • -
  • auto_increment/true : generates an auto_increment flag on the field. Note that the field type must
  • +
  • auto_increment/true : generates an auto_increment flag on the field. Note that the field type must integer
  • $fields = array(
                            'blog_id' => array(
    @@ -148,7 +148,7 @@ already be running, since the forge class relies on it.

                                                     'type' => 'TEXT',
                                                     'null' => TRUE,
                                              ),
    -                );
    +                )
    );

    After the fields have been defined, they can be added using $this->dbforge->add_field($fields); followed by a call to the create_table() function.

    $this->dbforge->add_field()

    @@ -187,12 +187,12 @@ already be running, since the forge class relies on it.

    );
    $this->dbforge->add_column('table_name', $fields);

    -// gives ALTER TABLE sites ADD preferences TEXT

    +// gives ALTER TABLE table_name ADD preferences TEXT

    $this->dbforge->drop_column()

    Used to remove a column from a table.

    $this->dbforge->drop_column('table_name', 'column_to_drop');

    $this->dbforge->modify_column()

    -

    The usage of this function is identical to add_coumn(), except it alters an existing column rather than adding a new one. In order to use it you must add a "name" key into the field defining array.

    +

    The usage of this function is identical to add_column(), except it alters an existing column rather than adding a new one. In order to use it you must add a "name" key into the field defining array.

    $fields = array(
                            'old_name' => array(
                                                             'name' => 'new_name',
    -- cgit v1.2.3-24-g4f1b