mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-02 14:18:46 +02:00
API CHANGE: The standard ID column is now database-specific
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71824 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
11dc761752
commit
040913369d
@ -236,7 +236,8 @@ abstract class Database extends Object {
|
||||
$this->checkAndRepairTable($table);
|
||||
}
|
||||
|
||||
$this->requireField($table, "ID", "int(11) not null auto_increment");
|
||||
//DB ABSTRACTION: we need to convert this to a db-specific version:
|
||||
$this->requireField($table, 'ID', DB::getConn()->IdColumn());
|
||||
|
||||
// Create custom fields
|
||||
if($fieldSchema) {
|
||||
|
@ -573,6 +573,16 @@ class MySQLDatabase extends Database {
|
||||
return 'varchar(' . $values['precision'] . ') character set utf8 collate utf8_general_ci';
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the column which is the primary key for each table
|
||||
* In Postgres, it is a SERIAL8, which is the equivalent of an auto_increment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function IdColumn(){
|
||||
return 'int(11) not null auto_increment';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given table is exists in the current database
|
||||
* NOTE: Experimental; introduced for db-abstraction and may changed before 2.4 is released.
|
||||
|
Loading…
Reference in New Issue
Block a user