Development

Changeset 9213

You must first sign up to be able to contribute.

Changeset 9213

Show
Ignore:
Timestamp:
05/23/08 15:56:57 (5 years ago)
Author:
develop7
Message:

made sfMigration::addColumn working
added package template for sfPluginManagerPlugin and removed package.xml since it is generated automatically

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfPropelMigrationsLightPlugin/trunk/README

    r5483 r9213  
    8080== Changelog == 
    8181 
     82=== 2008-05-23 | 1.0.1 === 
     83* develop7: fixed syntax error in sfMigration::addColumn() 
     84  
    8285=== 2007-10-12 | 0.5.0 Beta === 
    8386 
  • plugins/sfPropelMigrationsLightPlugin/trunk/lib/sfMigration.class.php

    r5736 r9213  
    9797 
    9898  /** 
    99    * adds a column to an existing table [untested] 
     99   * Adds a column to an existing table  
    100100   * 
    101    * @param string $table the table name 
    102    * @param string $column the name of the column to add 
    103    * @param string $type the type of the column to add 
    104    * @param bool $notNull if the column should be NOT NULL 
    105    * @param mixed $default default value for the column 
     101   * @param string  $table  the table name 
     102   * @param string  $column the name of the column to add 
     103   * @param string  $type    the type of the column to add 
     104   * @param bool    $notNull if the column should be NOT NULL 
     105   * @param mixed  $default default value for the column 
    106106   */ 
    107107  protected function addColumn($table, $column, $type, $notNull = false, $default = null) 
    108108  { 
    109109    $sql = "ALTER TABLE $table ADD COLUMN $column $type"; 
    110     if ($notNull) { $sql += " NOT NULL"; } 
     110    if ($notNull) {  
     111      $sql .= " NOT NULL"; 
     112    } 
    111113    if ($default !== null) {  
    112       if (!is_int($default)) { $default = "'" . $default . "'"; } 
    113       $sql += " DEFAULT $default";  
     114      if (!is_int($default)) { 
     115        $default = "'" . $default . "'"; 
     116      } 
     117      $sql .= " DEFAULT $default";  
    114118    } 
    115119