<?php

namespace Nijens\SatisBundle\Model\map;

use \RelationMap;
use \TableMap;


/**
 * This class defines the structure of the 'Release' table.
 *
 *
 *
 * This map class is used by Propel to do runtime db structure discovery.
 * For example, the createSelectSql() method checks the type of a given column used in an
 * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
 * (i.e. if it's a text column type).
 *
 * @package    propel.generator.src.Nijens.SatisBundle.Model.map
 */
class ReleaseTableMap extends TableMap
{

    /**
     * The (dot-path) name of this class
     */
    const CLASS_NAME = 'src.Nijens.SatisBundle.Model.map.ReleaseTableMap';

    /**
     * Initialize the table attributes, columns and validators
     * Relations are not initialized by this method since they are lazy loaded
     *
     * @return void
     * @throws PropelException
     */
    public function initialize()
    {
        // attributes
        $this->setName('Release');
        $this->setPhpName('Release');
        $this->setClassname('Nijens\\SatisBundle\\Model\\Release');
        $this->setPackage('src.Nijens.SatisBundle.Model');
        $this->setUseIdGenerator(true);
        // columns
        $this->addPrimaryKey('id', 'Id', 'INTEGER', true, null, null);
        $this->addForeignKey('package_id', 'PackageId', 'INTEGER', 'Package', 'id', true, null, null);
        $this->addColumn('name', 'Name', 'VARCHAR', true, 50, null);
        $this->addColumn('url', 'Url', 'VARCHAR', false, 255, null);
        $this->addColumn('revision', 'Revision', 'VARCHAR', false, 50, null);
        $this->addColumn('metadata', 'Metadata', 'LONGVARCHAR', false, null, null);
        $this->addColumn('updated_at', 'UpdatedAt', 'TIMESTAMP', false, null, null);
        // validators
    } // initialize()

    /**
     * Build the RelationMap objects for this table relationships
     */
    public function buildRelations()
    {
        $this->addRelation('Package', 'Nijens\\SatisBundle\\Model\\Package', RelationMap::MANY_TO_ONE, array('package_id' => 'id', ), null, null);
    } // buildRelations()

} // ReleaseTableMap
