From 0f0d3c62e608287cdf77f1a3239371b521ecb40b Mon Sep 17 00:00:00 2001 From: wei <> Date: Sat, 14 Apr 2007 05:02:29 +0000 Subject: Refactor ActiveRecordGateway to use TDataGatewayCommand --- framework/Data/Common/Sqlite/TSqliteMetaData.php | 22 +++++++++++++++++++++- .../Data/Common/Sqlite/TSqliteTableColumn.php | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'framework/Data/Common/Sqlite') diff --git a/framework/Data/Common/Sqlite/TSqliteMetaData.php b/framework/Data/Common/Sqlite/TSqliteMetaData.php index 68734046..2ce46fb7 100644 --- a/framework/Data/Common/Sqlite/TSqliteMetaData.php +++ b/framework/Data/Common/Sqlite/TSqliteMetaData.php @@ -80,6 +80,7 @@ class TSqliteMetaData extends TDbMetaData $columnId = $col['name']; //use column name as column Id $info['ColumnName'] = '"'.$columnId.'"'; //quote the column names! + $info['ColumnId'] = $columnId; $info['ColumnIndex'] = $col['index']; if($col['notnull']!=='99') @@ -115,6 +116,8 @@ class TSqliteMetaData extends TDbMetaData } /** + * + * * @param string quoted table name. * @return array foreign key details. */ @@ -145,6 +148,23 @@ class TSqliteMetaData extends TDbMetaData } return false; } +} -} +/** + +CREATE TABLE foo +( + id INTEGER NOT NULL PRIMARY KEY, + id2 CHAR(2) +); + +CREATE TABLE bar +( + id INTEGER NOT NULL PRIMARY KEY, + foo_id INTEGER NOT NULL CONSTRAINT fk_foo_id REFERENCES foo(id) ON DELETE CASCADE, + foo_id2 CHAR(2) CONSTRAINT fk_foo_id REFERENCES foo(id2) ON DELETE CASCADE, + bar_id INTEGER NOT NULL CONSTRAINT fk_bar_id REFERENCES bar(id) +); +*/ + ?> \ No newline at end of file diff --git a/framework/Data/Common/Sqlite/TSqliteTableColumn.php b/framework/Data/Common/Sqlite/TSqliteTableColumn.php index cb379bfd..b8287218 100644 --- a/framework/Data/Common/Sqlite/TSqliteTableColumn.php +++ b/framework/Data/Common/Sqlite/TSqliteTableColumn.php @@ -53,7 +53,7 @@ class TSqliteTableColumn extends TDbTableColumn /** * @return boolean true if auto increment is true. */ - public function getHasSequence() + public function hasSequence() { return $this->getAutoIncrement(); } -- cgit v1.2.3