Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Enable/disable foreign key constraings for sqlite. #1449

Closed
wants to merge 5 commits into from

4 participants

@qiangxue
Owner

Could you update the CHANGELOG file accordingly? Thanks.

@cebe
Collaborator

As stated in #1447 this is not supported by older sqlite versions, we need to make sure it does not break applications using old sqlite versions.

@resurtm
Collaborator

And of course, unit tests as always are very welcome! ;-)

@resurtm resurtm was assigned
@resurtm
Collaborator

Merged manually: 33763f8

@resurtm resurtm closed this
@resurtm
Collaborator

@cebe:

we need to make sure it does not break applications using old sqlite versions

It won't. This case is unit tested (1b24643).

@cebe
Collaborator

It won't. This case is unit tested (1b24643).

@resurtm also with sqlite < 3.7.10 ?

@resurtm
Collaborator

@cebe, i did some tests on PHP 5.2 (sqlite 3.3.7) and on PHP 5.4 (sqlite 3.7.7.1):

  1. Testing script: http://pastebin.com/dBngz3CA
  2. PHP 5.2 (sqlite 3.3.7): http://pastebin.com/6uYMNGZ5
  3. PHP 5.4 (sqlite 3.7.7.1): http://pastebin.com/q3X3vyDa

Looks good to me. Btw, note that default sqlite version bundled with the latest PHP 5.2 is 3.3.7—our unit tests are all right.

@cebe
Collaborator

Okay, cool :) Thanks for the effort!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 21, 2012
  1. @gleb-sternharz
  2. @gleb-sternharz

    Update CHANGELOG

    gleb-sternharz authored
  3. @gleb-sternharz

    Update CHANGELOG

    gleb-sternharz authored
  4. @gleb-sternharz

    Update framework/db/schema/sqlite/CSqliteSchema.php

    gleb-sternharz authored gleb committed
    Issue #1447
    
    Update CHANGELOG
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +1 −0  CHANGELOG
  2. +1 −2  framework/db/schema/sqlite/CSqliteSchema.php
View
1  CHANGELOG
@@ -39,6 +39,7 @@ Version 1.1.13 work in progress
- Enh #1369: Added CCheckBoxColumn::disabled that accepts PHP expression or anonymous function determining if checkbox for the row should be disabled (sucotronic)
- Enh #1386: Second parameter of the CHtml::value() is now able to accept anonymous function which calculates value to be used (Qiang, resurtm)
- Enh #1396: Added 'text/csv' mime-type for the 'csv' file extension in utils/mimeTypes.php (effectively used by e.g. CHttpRequest::sendFile()) (rawtaz)
+- Enh #1447: CSqliteSchema: Added enabling/disabling integrity check for sqlite (gleb-sternharz)
- Enh: Fixed the check for ajaxUpdate false value in jquery.yiilistview.js as that never happens (mdomba)
- Enh: Requirements checker: added check for Oracle database (pdo_oci extension) and MSSQL (pdo_dblib, pdo_sqlsrv and pdo_mssql extensions) (resurtm)
- Enh: Added CChainedLogFilter class to allow adding multiple filters to a logroute (cebe)
View
3  framework/db/schema/sqlite/CSqliteSchema.php
@@ -73,8 +73,7 @@ public function resetSequence($table,$value=null)
*/
public function checkIntegrity($check=true,$schema='')
{
- // SQLite doesn't enforce integrity
- return;
+ $this->getDbConnection()->createCommand('PRAGMA foreign_keys='.($check?1:0))->execute();
}
/**
Something went wrong with that request. Please try again.