Re: Creating database tables within an application

2006-09-06 Thread nate
The quickest way that comes to mind is to explicitly invalidate (kill) the cache file, as follows (all the model cache files are kept in tmp/cache/models): cache($pathToCacheFile, null, '-1 minute'); Then I think you might have to delete the in-memory copy of the description out of the database

Re: Creating database tables within an application

2006-09-06 Thread gorbster
nate wrote: > Yes and no. Cake automatically loads up the correct driver as long as > you tell it the type of database you're connecting to, but using > Model::execute forces you to write queries by hand, which means, you'd > have to do your database-specific translation manually. Thanks Nate -

Re: Creating database tables within an application

2006-09-06 Thread nate
Yes and no. Cake automatically loads up the correct driver as long as you tell it the type of database you're connecting to, but using Model::execute forces you to write queries by hand, which means, you'd have to do your database-specific translation manually. Unfortunately, none of Cake's data

Re: Creating database tables within an application

2006-09-06 Thread gorbster
Chris Hartjes wrote: > I'm coming a little late to the party here, but I'm curious as to why > you need to dynamically create tables? The application allows users to create a custom-table from predfined column types (e.g. text, image, file), and to specify which of those columns should be "search

Re: Creating database tables within an application

2006-09-06 Thread Chris Hartjes
On 9/5/06, gorbster <[EMAIL PROTECTED]> wrote: > > Is it possible to dynamically create tables from within a Cake > application, and then use the table with Cake's Model class? > I'm coming a little late to the party here, but I'm curious as to why you need to dynamically create tables? -- Chri

Re: Creating database tables within an application

2006-09-06 Thread gorbster
Using this option (Model::execute()), is it possible to take advantage of the built-in DBO abstraction currently used in Cake? e.g. if I wanted to specify generic column types when creating the table. Thanks for the help so far, -Brian --~--~-~--~~~---~--~~ You

Re: Creating database tables within an application

2006-09-05 Thread gwoo
Option 3: class AppModel extends Model { function createTable($name = null) { if($name) { $this->execute('CREATE TABLE IF NOT EXISTS '.$name); } } } --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Creating database tables within an application

2006-09-05 Thread John David Anderson (_psychic_)
On Sep 5, 2006, at 10:11 AM, gorbster wrote: > > Is it possible to dynamically create tables from within a Cake > application, and then use the table with Cake's Model class? Make a generic model that doesn't use a table (var $useTable = false), and use the execute() function of the model to

Re: Creating database tables within an application

2006-09-05 Thread nate
You can if you intercept the __construct( ) method of the controller (or AppController), i.e.: function __construct( ) { $db =& ConnectionManager::getDataSource("default"); // Get database connection reference $db->execute("CREATE TABLE ..."); parent::__construct(); } --~--~

Creating database tables within an application

2006-09-05 Thread gorbster
Is it possible to dynamically create tables from within a Cake application, and then use the table with Cake's Model class? Thanks, -Brian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post