Open GoogleCodeExporter opened 9 years ago
Well, there's another issue related to make SQLite work :
user/components/CAdvancedArBehavior.php
186 : return sprintf("delete ignore from %s where %s = '%s'",
The "ignore" option doesn't work with SQLite.
Original comment by ouebfra...@gmail.com
on 6 Jul 2010 at 2:53
Hi. I have merged some of your changes into the new 0.8 svn work i've began
today. unfortunately there is more work to do. We need to have 4 different
install scripts for each major database, that's mysql, sqlite, postgrseql and
maybe MS-Database stuff. Since i am using mysql only, i need someone else who
works with one of the other databases to provide Installation scripts. thanks
for this first one with sqlite.
Do you -really- use Yum on an sqlite database?
Original comment by thyseus
on 30 Jul 2010 at 7:21
I don't use Yum for now as it doesn't work well with sqlite (well, that's
because it's not quite implemented). And I really need it to work with sqlite.
By the way, Yum appears to be the better compromise I've found so far to user
management.
If you need I could try to put some more efforts on it.
Original comment by ouebfra...@gmail.com
on 30 Jul 2010 at 8:08
Hi,
Here's an updated version of the "YumInstalController.php" that should work
indifferently for both Mysql and Sqlite database.
The changes are located in actionInstall().
---
At the begining of the function creation of variables to manage inline
differences between Mysql and Sqlite.
if(Yii::app()->db->getDriverName()=="sqlite")
{
$idField = 'INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT';
$sqlEnd = ' ;';
$sqlEnum = "VARCHAR(20) NOT NULL default ''";
//
$sqlInsertBegin = " SELECT ";
$sqlInsertUnion = " UNION SELECT ";
$sqlInsertEnd = "";
} else {
$id_field = 'int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY';
$sqlEnd = ' ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;';
$sqlEnum = "ENUM('protected', 'private', 'public') NOT NULL";
//
$sqlInsertBegin = " VALUES ( ";
$sqlInsertUnion = ") , (";
$sqlInsertEnd = ")";
}
---
My previous commited file didn't work for Mysql because the "create index if
not exists" doesn't exist.
I think with can remove the "if not exists" for all.
CREATE INDEX [...]
Then create index separatly instead of direct creation within CREATE TABLE
statement. It should work with all database (?).
---
SELECT [...]
UNION
SELECT [...]
instead of :
INSERT INTO [...] VALUES ([...]) , ([...]) , ([...])
The sql statement is made with the $sqlInsertBegin, $sqlInsertUnio and
$sqlInsertEnd variables.
---
CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity
constraint violation: 19 profile_fields.hint may not be NULL
...
and many others
=>
[...]
`hint` text NOT NULL default '',
`match` varchar(255) NOT NULL default '',
`range` varchar(255) NOT NULL default '',
`error_message` varchar(255) NOT NULL default '',
[...]
`default` varchar(255) NOT NULL default '',
[...]
---
As ENUM doesn't exist in SQLite, I've disabled it for "$profileTable".
A dedicated variable $sqlEnum put the relevant code.
---
All theses changes should lead to a successful installation for Sqlite database
(and Mysql too, without any modification).
Original comment by ouebfra...@gmail.com
on 4 Aug 2010 at 11:40
Attachments:
Here's my updated (and fixed) "YumInstallController.php" according to r111
(settings and textsettings tables, and default values - and, I've added the
french default value).
With the last svn changes - r111 - I've got an issue related to 'yumsettings',
I've temporarly commented line 153 in my UserModule.php :
//$settings = YumSettings::model()->find('is_active');)
I guess this is "work in progress" svn :)
Original comment by ouebfra...@gmail.com
on 4 Aug 2010 at 12:58
Attachments:
Original issue reported on code.google.com by
ouebfra...@gmail.com
on 6 Jul 2010 at 12:26Attachments: