bizley / timeclock

Simple work time clocking service
MIT License
30 stars 11 forks source link

Cannot create a project with assigned users #46

Closed husim0 closed 2 years ago

husim0 commented 2 years ago

Hello,

Thank you for your software, it is really useful.

I have a trouble creating a project with assigned users.

I have the following error :

SQLSTATE[23000]: Integrity constraint violation: 4025 CONSTRAINT `project.assignees` failed for `timeclock`.`project`
The SQL being executed was: INSERT INTO `project` (`name`, `color`, `assignees`, `created_at`, `updated_at`) VALUES ('test', '#60a193', 'Array', 1652104178, 1652104178)

Error Info: Array
(
    [0] => 23000
    [1] => 4025
    [2] => CONSTRAINT `project.assignees` failed for `timeclock`.`project`
)

↵
Caused by: PDOException
SQLSTATE[23000]: Integrity constraint violation: 4025 CONSTRAINT `project.assignees` failed for `timeclock`.`project`

Please tell me if I can give you any other information.

Have a nice day, thank you

bizley commented 2 years ago

It looks like your array is type-casted to string prior to the insert thus rendering as Array. I'm not sure what is causing it though, maybe your db is not allowing JSON?

husim0 commented 2 years ago

Hello, thank you for your reply. I'm using mariadb 10.7, so something pretty common I guess.

bizley commented 2 years ago

See https://github.com/SAM-IT/yii2-mariadb

husim0 commented 2 years ago

Ok, so what should I do, sorry I'm not familiar at all with Yii Framework. Do I need to use that dependency and then follow what is described in the README ?

bizley commented 2 years ago

Well, yes.

husim0 commented 2 years ago

Ok, I'll try that, then, thank you