machour / yii2-notifications

A complete notifications module for your Yii 2 powered application
MIT License
91 stars 49 forks source link

Generic fix for ORACLE db #38

Open ilbassa opened 7 years ago

ilbassa commented 7 years ago

For more compatibility of the extension can tell you some fix needed for ORACLE database:

Glad if this can help improve compatibiliy of the extension.

machour commented 7 years ago

Thank you for all this details. As far as I understand, Yii is able to handle all this under the hood, and I'm definitely doing something wrong. I'll fix this properly as soon as I understand it. Meanwhile, don't hesitate to fork this repo and do your changes

On Jul 18, 2017 17:10, "ilbassa" notifications@github.com wrote:

For more compatibility of the extension can tell you some fix needed for ORACLE database:

-

in the matching of "boolean" value we must use 1/0 because in ORACLE boolean doesn't exist. The migration tool convert an attribute set as $this->boolean() in Numer(1,0) #[36] (ref. issue 36)

I have ovverride the notify() function also because for ORACLE the Expression NOW() doesn't exist, so first I replaced it with SYSDATE() that is suited for ORACLE but I can suggest you to use "new Expression('CURRENT_TIMESTAMP')".

In the migration I also need to change "created_at" attribute from dateTime to date() because dateTime() is converted into TIMESTAMP and the models return a datetime like this "18-LUG-17 17:53:09,000000", it is possible to have TIMESTAMP with precision 0 in ORACLE that returns "18-LUG-17 17:53:09" but I have not figured out how to set precision 0 in the migration ($this->dateTime(0) doesn't work)

Glad if this can help improve compatibiliy of the extension.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/machour/yii2-notifications/issues/38, or mute the thread https://github.com/notifications/unsubscribe-auth/AASlQrMQCx2fo2V7KTcOjIHK284D3L5xks5sPNkPgaJpZM4OblHn .