webvimark / user-management

154 stars 163 forks source link

Migrations don't work with SQLite #184

Open Stefan39 opened 6 years ago

Stefan39 commented 6 years ago

Hello,

the migration don't work with SQLite DB Connection. The error:

*** applying m140808_073114_create_auth_item_group_table

create table {{%auth_item_group}} ... done (time: 0.000s) add column group_code varchar(64) to table {{%auth_item}} ... done (time: 0.000s) add foreign key fk_auth_item_group_code: {{%auth_item}} (group_code) references {{%auth_item_group}} (code) ...Exception: yii\db\sqlite\QueryBuilder::addForeignKey is not supported by SQLite. (/path/to/web/vendor/yiisoft/yii2/db/sqlite/QueryBuilder.php:239)

I have seen, that the foreignkey must be set on the creation of the tables, not as separate call. Is it possible to fix it asap?

Stefan39 commented 6 years ago

Also another problems with SQLite:

rename column browser_and_os in table {{%user_visit_log}} to user_agent ...Exception: yii\db\sqlite\QueryBuilder::renameColumn is not supported by SQLite. (/path/to/vendor/yiisoft/yii2/db/sqlite/QueryBuilder.php:219)

I have fix this localy and after fixing the migration works fine.