View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
352 | PHPOF2 | Default | public | 28 May 2010 14:12 | 14 Sep 2010 12:38 |
Reporter | wcrouch | Assigned To | timj | ||
Priority | normal | Severity | feature | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Target Version | 0.12.2 | Fixed in Version | 0.12.2 | ||
Summary | 352: Add the ability to refresh the schema details for an instance of PHPOF2 DB Table | ||||
Description | When making changes to a database from code, the results from discoverSchema can become out of date. Eg with an upgrade management app, you may have loaded the table, then made changes to the structure, if you then use the table again, the schema will be out of date, and insert/update operations will fail. | ||||
Tags | No tags attached. | ||||
Attached Files | refresh_schema.diff (763 bytes)
Index: DBTable.php =================================================================== --- DBTable.php (revision 32940) +++ DBTable.php (working copy) @@ -442,6 +442,23 @@ // Now create _list properties $this->_createSchemaCachedLists(); } + + /** + * Clear internal cached lists and rediscover the schema + * + * @return void + */ + public function refreshSchema() { + $this->fields_normal = array(); + $this->pri_keys = array(); + $this->fgn_keys = array(); + $this->fieldlist = array(); + $this->pri_key_list = array(); + $this->key_auto_increment = false; + $this->field_defs = array(); + $this->fields_lob = array(); + $this->discoverSchema(); + } /** * Create cached properties containing lists of *pre-quoted* fields and | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
28 May 2010 14:12 | wcrouch | New Issue | |
30 Jul 2010 09:03 | wcrouch | Note Added: 372 | |
30 Jul 2010 09:03 | wcrouch | File Added: refresh_schema.diff | |
30 Jul 2010 09:04 | wcrouch | Note Edited: 372 | |
14 Sep 2010 12:14 | timj | Assigned To | => timj |
14 Sep 2010 12:14 | timj | Status | new => assigned |
14 Sep 2010 12:14 | timj | Target Version | => 0.12.2 |
14 Sep 2010 12:29 | timj | Note Added: 379 | |
14 Sep 2010 12:29 | timj | Status | assigned => resolved |
14 Sep 2010 12:29 | timj | Resolution | open => fixed |
14 Sep 2010 12:29 | timj | Fixed in Version | => 0.12.2 |
14 Sep 2010 12:29 | timj | Note Edited: 379 | |
14 Sep 2010 12:31 | timj | Note Edited: 379 | |
14 Sep 2010 12:38 | timj | Status | resolved => closed |