17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 3888 Views |
-
db/build?flush=1

10 December 2008 at 5:54am Last edited: 10 December 2008 5:56am
Hello,
I have SilverStripe CMS - 2.2.3 running on OS x 1.3.9 with Mamp 1.4.1.I created HomePage.php in mysite/code/ with:
<?php
/**
* Defines the HomePage page type
*/
class HomePage extends Page {
static $db = array();
static $has_one = array();
}
class HomePage_Controller extends Page_Controller {
}
?>I run db/build?flush=1 and it updated the db, perfect!!!
Than I created PilderPage.php in mysite/code/ with:
<?php
/**
* Defines the PilderPage page type
*/class PilderPage extends Page {
static $db = array(
);
static $has_one = array(
);}
class PilderPage_Controller extends Page_Controller {
}
?>
When I run db/build?flush=1 the db is not updated??? What's wrong? -
Re: db/build?flush=1

10 December 2008 at 6:46am
Occasionally your browser caches the flush page. The ?flush=1 tells the server not to cache it, but if your browser has the page cached, it doesn't ever get as far as the server. Try doing F5 and if that fails, Ctrl-F5. Should fix it.
-
Re: db/build?flush=1

10 December 2008 at 9:31am
A few things to check:
1) Are the class name and controller name are correct - it's common to copy another class and forget to change the name.
2) Always put the class braces on the same line as the class definition, otherwise manifestbuilder will ignore it (I think this has been fixed in 2.3).
3) Are you sure it hasn't worked? If your new page type has no extra fields or relationships, then the only part of the database that will change is the ClassName field in the SiteTree tables.
-
Re: db/build?flush=1

10 December 2008 at 11:55am
Just expanding a little on jam's last point; if it shows some stuff in blue text at the top of the db/build?flush=1 page and mentions an enum and some page types (Page, Redirector Page, etc) then it IS affecting it, but it's the lack of new fields causing it to look almost the same as if it wasn't changing.
Alternatively, try swapping this into your $db line and see if it outputs anything in green to signify new fields being added:
static $db = array(
'UniqueName' => 'Text',
'DeleteMe' => 'Date'
);
| 3888 Views | ||
|
Page:
1
|
Go to Top |



