Making a Integer table row unsigned with Zend\Db\Sql\Ddl\Column\Integer

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Making a Integer table row unsigned with Zend\Db\Sql\Ddl\Column\Integer

jimmysole
This post was updated on .
Hello Everyone,

I'm having some trouble finding how to make an integer unsigned with Zend\Db\Sql\Ddl\Column\Integer. Is it automatically unsigned? Here is the code I have:

$table->addColumn((new Integer('visit_count', false, 0))->setOption('visit_count', 'unsigned'));

Is setOption() the method to make this happen or is there something else?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Making a Integer table row unsigned with Zend\Db\Sql\Ddl\Column\Integer

settermjd
Have you tried a SQL Expression object? That might do it.

Best,

Matthew Setter
Malt Blue Ltd
http://www.maltblue.com | [hidden email] | @maltblue
Connect with me on LinkedIn :: in/MatthewSetter

Am 6 Aug 2013 um 15:42 schrieb jimmysole <[hidden email]>:

> Hello Everyone,
>
> I'm having some trouble finding how to make an integer unsigned with
> Zend\Db\Sql\Ddl\Column\Integer. Is it automatically unsigned? Here is the
> code I have:
>
> $table->addColumn((new Integer('visit_count', false,
> 0))->setOption('visit_count', 'unsigned'));
>
> Is setOption() the method to make this happen or is their something else?
>
> Thanks
>
>
>
> --
> View this message in context: http://zend-framework-community.634137.n4.nabble.com/Making-a-Integer-table-row-unsigned-with-Zend-Db-Sql-Ddl-Column-Integer-tp4660679.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
> --
> List: [hidden email]
> Info: http://framework.zend.com/archives
> Unsubscribe: [hidden email]
>
>

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Making a Integer table row unsigned with Zend\Db\Sql\Ddl\Column\Integer

jimmysole
How would you do that with zf2?
Reply | Threaded
Open this post in threaded view
|

Re: Making a Integer table row unsigned with Zend\Db\Sql\Ddl\Column\Integer

settermjd
I'll have a play tomorrow and see about working up an example. However, if someone gets in before me, just let me know.

Matt

On 6 Aug 2013, at 21:59, jimmysole <[hidden email]> wrote:

> How would you do that with zf2?
>
>
>
> --
> View this message in context: http://zend-framework-community.634137.n4.nabble.com/Making-a-Integer-table-row-unsigned-with-Zend-Db-Sql-Ddl-Column-Integer-tp4660679p4660686.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
> --
> List: [hidden email]
> Info: http://framework.zend.com/archives
> Unsubscribe: [hidden email]
>
>


--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Making a Integer table row unsigned with Zend\Db\Sql\Ddl\Column\Integer

jimmysole
Hey Matt,

I've been trying everything and I can't seem to get Zend\Sql\Ddl to make the column unsigned and auto increment. I know I'm probably missing something, I just don't know what at this point.

Any help would be greatly appreciated

Jimmy
Reply | Threaded
Open this post in threaded view
|

Re: Making a Integer table row unsigned with Zend\Db\Sql\Ddl\Column\Integer

ralphschindler
Currently, this is not possible.  Although, it would be fairly easy to
implement.  The relative classes are:

The Integer type:

https://github.com/zendframework/zf2/blob/master/library/Zend/Db/Sql/Ddl/Column/Integer.php

The Column base type:

https://github.com/zendframework/zf2/blob/master/library/Zend/Db/Sql/Ddl/Column/Column.php

And the CreateTable decorator for MySQL

https://github.com/zendframework/zf2/blob/master/library/Zend/Db/Sql/Platform/Mysql/Ddl/CreateTableDecorator.php


Do you want to file an improvement or issue a pull request for this on
the github issue tracker?

-ralph


On 8/8/13 12:11 PM, jimmysole wrote:

> Hey Matt,
>
> I've been trying everything and I can't seem to get Zend\Sql\Ddl to make the
> column unsigned and auto increment. I know I'm probably missing something, I
> just don't know what at this point.
>
> Any help would be greatly appreciated
>
> Jimmy
>
>
>
> --
> View this message in context: http://zend-framework-community.634137.n4.nabble.com/Making-a-Integer-table-row-unsigned-with-Zend-Db-Sql-Ddl-Column-Integer-tp4660679p4660704.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Making a Integer table row unsigned with Zend\Db\Sql\Ddl\Column\Integer

jimmysole

It would be cool to see it implemented. What would be the process for this?
Reply | Threaded
Open this post in threaded view
|

Re: Making a Integer table row unsigned with Zend\Db\Sql\Ddl\Column\Integer

jimmysole
In reply to this post by ralphschindler
Hey Ralph,

How would the CreateTableDecorator class work exactly?

Thanks

Jimmy
Reply | Threaded
Open this post in threaded view
|

Re: Making a Integer table row unsigned with Zend\Db\Sql\Ddl\Column\Integer

jimmysole
Hello,

Has anyone been able to think of a way to have this implemented?

Jimmy