tuupola Tue Jul 1 16:36:19 2003 EDT
Modified files:
/pear/DB/DB sqlite.php
Log:
* Keep sequence table tidy by removing old entries
# should be safe way to do it
Index: pear/DB/DB/sqlite.php
diff -u pear/DB/DB/sqlite.php:1.7 pear/DB/DB/sqlite.php:1.8
--- pear/DB/DB/sqlite.php:1.7 Tue Jul 1 10:02:33 2003
+++ pear/DB/DB/sqlite.php Tue Jul 1 16:36:18 2003
@@no-spam -16,7 +16,7 @@no-spam
// | Author: Urs Gehrig <urs@no-spam> |
// +----------------------------------------------------------------------+
//
-// $Id: sqlite.php,v 1.7 2003/07/01 14:02:33 urs Exp $
+// $Id: sqlite.php,v 1.8 2003/07/01 20:36:18 tuupola Exp $
//
// Database independent query interface definition for the PECL's SQLite
// extension.
@@no-spam -423,6 +423,15 @@no-spam
if (DB::isError($result)) {
return($result);
}
+ $query = "CREATE TRIGGER ${seqname}_cleanup AFTER INSERT ON $seqname
+ BEGIN
+ DELETE FROM $seqname WHERE id<LAST_INSERT_ROWID();
+ END ";
+ $result = $this->query($query);
+ if (DB::isError($result)) {
+ return($result);
+ }
+
}
/**