Re: using CakeSchema from the app

2010-01-25 Thread Lorenzo Bettini

That's nice to hear :)
I had already started taking a look at the shell code and it looked to 
me as well that most of the code could be shared to be used also inside 
a controller.


It'd be nice to isolate that code so that it can be used in the shell 
code and also in the controller code.  From what I saw it basically 
boils down to copy that code and to avoid outputting to the standard 
output, am I right?


I'd really love to see your code when it's done; probably also trying to 
come up with something re-usable for installation and updating 
functionalities (a plugin?) for cake!


cheers
Lorenzo

Jamie wrote:

It can't be done "out of the box", since, like you mentioned, the only
tool that the Cake core comes with for managing schemas is the shell
class. But the schema shell just uses the CakeSchema model to do most
of the heavy lifting. So you could just make a SchemaController that
uses the CakeSchema model and then use that to handle schema updating.
A lot of the code in the schema shell can be transferred into a
controller with minimal changes - the database updating code is pretty
straightforward.

I've actually got something like this planned that I hope to get to in
the next week or so; I'll gladly share my results once I'm done.

- Jamie

On Jan 24, 10:31 am, Lorenzo Bettini  wrote:

Hi

I found

http://book.cakephp.org/view/735/Generating-and-using-Schema-files

which is cool to migrate database schemas with cake console; but I'd
like to migrate and apply schema (e.g., for installation and update
pages) from the application...  can it be done?

thanks in advance
Lorenzo





--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: using CakeSchema from the app

2010-01-25 Thread Lorenzo Bettini

but are you re-using sql dumps?

Because I'd aim at using either sql dumps and possibly sql table update 
statements (which I've done in the past) or cake generated schema files 
(which should be the cake way).


cheers
Lorenzo

Miles J wrote:

They require shells (or at least what I found). I recently had the
same dilemma with my forum plugin as I wanted to build an install
script and use the Schema classes. I just had to use plain SQL files.

http://github.com/milesj/forum/blob/master/controllers/install_controller.php

If someone has more information on this subject, that would be great.

On Jan 24, 7:31 am, Lorenzo Bettini  wrote:

Hi

I found

http://book.cakephp.org/view/735/Generating-and-using-Schema-files

which is cool to migrate database schemas with cake console; but I'd
like to migrate and apply schema (e.g., for installation and update
pages) from the application...  can it be done?





--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: using CakeSchema from the app

2010-01-24 Thread Jamie
It can't be done "out of the box", since, like you mentioned, the only
tool that the Cake core comes with for managing schemas is the shell
class. But the schema shell just uses the CakeSchema model to do most
of the heavy lifting. So you could just make a SchemaController that
uses the CakeSchema model and then use that to handle schema updating.
A lot of the code in the schema shell can be transferred into a
controller with minimal changes - the database updating code is pretty
straightforward.

I've actually got something like this planned that I hope to get to in
the next week or so; I'll gladly share my results once I'm done.

- Jamie

On Jan 24, 10:31 am, Lorenzo Bettini  wrote:
> Hi
>
> I found
>
> http://book.cakephp.org/view/735/Generating-and-using-Schema-files
>
> which is cool to migrate database schemas with cake console; but I'd
> like to migrate and apply schema (e.g., for installation and update
> pages) from the application...  can it be done?
>
> thanks in advance
>         Lorenzo
>
> --
> Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
> HOME:http://www.lorenzobettini.itMUSIC:http://www.purplesucker.com
> BLOGS:http://tronprog.blogspot.com http://longlivemusic.blogspot.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: using CakeSchema from the app

2010-01-24 Thread Miles J
They require shells (or at least what I found). I recently had the
same dilemma with my forum plugin as I wanted to build an install
script and use the Schema classes. I just had to use plain SQL files.

http://github.com/milesj/forum/blob/master/controllers/install_controller.php

If someone has more information on this subject, that would be great.

On Jan 24, 7:31 am, Lorenzo Bettini  wrote:
> Hi
>
> I found
>
> http://book.cakephp.org/view/735/Generating-and-using-Schema-files
>
> which is cool to migrate database schemas with cake console; but I'd
> like to migrate and apply schema (e.g., for installation and update
> pages) from the application...  can it be done?
>
> thanks in advance
>         Lorenzo
>
> --
> Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
> HOME:http://www.lorenzobettini.itMUSIC:http://www.purplesucker.com
> BLOGS:http://tronprog.blogspot.com http://longlivemusic.blogspot.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


using CakeSchema from the app

2010-01-24 Thread Lorenzo Bettini

Hi

I found

http://book.cakephp.org/view/735/Generating-and-using-Schema-files

which is cool to migrate database schemas with cake console; but I'd 
like to migrate and apply schema (e.g., for installation and update 
pages) from the application...  can it be done?


thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en