ActiveRecord defineAttributes() I have just started to build my first plugin with Craft CMS.

Im at the part where I want to defne my database table.

http://buildwithcraft.com/docs/plugins/database

For the method definedAttributes() what values will the array accept.

It looks like I can define values and types, but how do i add field lengths, primarykeys etc.. 

Are there some other docs that I can look at?

Thanks for your help.
You best bet would be to start by knowing all the exisiting default attribute types in this file:

craft/app/enums/AttributeType.php

Then look in

craft/app/helpers/ModelHelper.php
and
craft/app/helpers/DbHelper.php

There you will find all sorts of properties for column types and their default configs options like maxLength. Here is all the ColumnTypes defaults:

public static $attributeTypeDefaults = array(
    AttributeType::Mixed      =&gt; array('model' =&gt; null, 'column' =&gt; ColumnType::Text),
    AttributeType::Bool       =&gt; array('maxLength' =&gt; 1, 'default' =&gt; false, 'required' =&gt; true, 'column' =&gt; ColumnType::TinyInt, 'unsigned' =&gt; true),
    AttributeType::ClassName  =&gt; array('maxLength' =&gt; 150, 'column' =&gt; ColumnType::Varchar),
    AttributeType::DateTime   =&gt; array('column' =&gt; ColumnType::DateTime),
    AttributeType::Email      =&gt; array('minLength' =&gt; 5, 'column' =&gt; ColumnType::Varchar),
    AttributeType::Enum       =&gt; array('values' =&gt; array(), 'column' =&gt; ColumnType::Enum),
    AttributeType::Handle     =&gt; array('maxLength' =&gt; 255, 'reservedWords' =&gt; 'id,dateCreated,dateUpdated,uid,title', 'column' =&gt; ColumnType::Varchar),
    AttributeType::Locale     =&gt; array('column' =&gt; ColumnType::Locale),
    AttributeType::Name       =&gt; array('maxLength' =&gt; 255, 'column' =&gt; ColumnType::Varchar),
    AttributeType::Number     =&gt; array('min' =&gt; null, 'max' =&gt; null, 'decimals' =&gt; 0),
    AttributeType::SortOrder  =&gt; array('column' =&gt; ColumnType::TinyInt),
    AttributeType::Template   =&gt; array('maxLength' =&gt; 500, 'column' =&gt; ColumnType::Varchar),
    AttributeType::Url        =&gt; array('maxLength' =&gt; 255, 'column' =&gt; ColumnType::Varchar),
);


You will also see in the DbHelper.php how the column types map into the mysql definition of the table like so:

case ColumnType::Decimal:
            {
                $def = 'DECIMAL('.$config['length'].','.$config['decimals'].')';
                break;
            }


Hope that helps. I would encourage you to look at all the defineAttributes() methods in the craft/app/records directory.