Skip to content

[2009-06-03] Make Database->renameField()/renameTable() transactional to avoid calling SQL on non-existing tables #1376

@silverstripe-issues

Description

@silverstripe-issues

created by: @chillu (ischommer)
created at: 2009-06-03
original ticket: http://open.silverstripe.org/ticket/4192


This problem pops up when using Database->dontRequireField(). It is basically useless for the first dev/build on a new database, as it tries to list all fields in a table that doesn't exist yet. Tables are created "transactional" using Database->transCreateTable(), but other commands are not transactional:

  • renameField()
  • renameTable()

Create Database->transRenameField() and transRenameTable(), or hook them into transAlterField() etc.

To test this behaviour, please implement the attached patch for Versioned.php. At the moment, certain columns in Versioned are not marked as obsolete, hence continue filling versioned queries with redundant and wrong data (see r78358 for details)

PRs

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions