Doctrine Symfony 1.4原则创建表

Doctrine Symfony 1.4原则创建表,doctrine,symfony-1.4,dql,Doctrine,Symfony 1.4,Dql,有人能给我举一个关于如何在条令中使用createTable的例子吗? 例如,我想创建一个包含以下列的表“附件”: “文件路径”=>字符串 'message_id'=>整数 谢谢找到它: $this->createTable('attachment', array( 'id' => array( 'type' => 'integer', 'length' => 8,

有人能给我举一个关于如何在条令中使用createTable的例子吗? 例如,我想创建一个包含以下列的表“附件”: “文件路径”=>字符串 'message_id'=>整数

谢谢找到它:

$this->createTable('attachment', array(
        'id' =>
            array(
                'type' => 'integer',
                'length' => 8,
                'autoincrement' => true,
                'primary' => true,
            ),
        'file_path' =>
            array(
                'type' => 'string',
                'notnull' => true,
                'length' => 255,
            ),
        'message_id' =>
            array(
                'type' => 'integer',
                'notnull' => false,
                'length' => 8,
            ),
        'created_at' =>
            array(
                'notnull' => true,
                'type' => 'timestamp',
                'length' => 25,
            ),
        'updated_at' =>
            array(
                'notnull' => true,
                'type' => 'timestamp',
                'length' => 25,
            ),
    ), array(
        'indexes' =>
            array(
            ),
        'primary' =>
            array(
                0 => 'id',
            ),
        'collate' => 'utf8_general_ci',
        'charset' => 'utf8',
    ));