ShawnClake / UserExtended

An extension to the existing RainLab.User plugin for OctoberCMS
http://octobercms.com/plugin/clake-userextended
GNU General Public License v3.0
23 stars 12 forks source link

"attempts" cant be NULL on adding route (PostgreSQL) #126

Open mnvx opened 7 years ago

mnvx commented 7 years ago

My database is PostgreSQL.

When I try to add route on page backend/clake/userextended/routes/create

I have next error:

"SQLSTATE[23502]: Not null violation: 7 ОШИБКА: нулевое значение в столбце "attempts" нарушает ограничение NOT NULL DETAIL: Ошибочная строка содержит (2, /blog, null, null, null, 2017-06-18 06:31:34, 2017-06-18 06:31:34, t, , f). (SQL: insert into "clake_userextended_routes" ("route", "description", "enabled", "cascade", "updated_at", "created_at") values (/blog, , 1, 0, 2017-06-18 06:31:34, 2017-06-18 06:31:34) returning "id")" on line 666 of /var/www/zabor/vendor/laravel/framework/src/Illuminate/Database/Connection.php

mnvx commented 7 years ago

I resolved it with setting SET DEFAULT 0 for this field, but after this I have next error:

SQLSTATE[42703]: Undefined column: 7 ОШИБКА: столбец clake_userextended_routes_pivot.route_Id не существует LINE 1: ...id" = "clake_userextended_roles"."id") as "role", "clake_use... ^ HINT: Возможно, предполагалась ссылка на столбец "clake_userextended_routes_pivot.route_id". (SQL: select "clake_userextended_route_restriction".*, (select name from "users" where "clake_userextended_route_restriction"."user_id" = "users"."id") as "user", (select name from "user_groups" where "clake_userextended_route_restriction"."group_id" = "user_groups"."id") as "group", (select name from "clake_userextended_roles" where "clake_userextended_route_restriction"."role_id" = "clake_userextended_roles"."id") as "role", "clake_userextended_routes_pivot"."route_Id" as "pivot_route_Id", "clake_userextended_routes_pivot"."restriction_id" as "pivot_restriction_id" from "clake_userextended_route_restriction" inner join "clake_userextended_routes_pivot" on "clake_userextended_route_restriction"."id" = "clake_userextended_routes_pivot"."restriction_id" where "clake_userextended_route_restriction"."deleted_at" is null and "clake_userextended_routes_pivot"."route_Id" = 3 order by "name" desc) /var/www/zabor/vendor/laravel/framework/src/Illuminate/Database/Connection.php line 666 I fixed it with setting SET DEFAULT 0 for this field, but after this I have next error:

SQLSTATE[42703]: Undefined column: 7 ОШИБКА: столбец clake_userextended_routes_pivot.route_Id не существует LINE 1: ...id" = "clake_userextended_roles"."id") as "role", "clake_use... ^ HINT: Возможно, предполагалась ссылка на столбец "clake_userextended_routes_pivot.route_id". (SQL: select "clake_userextended_route_restriction".*, (select name from "users" where "clake_userextended_route_restriction"."user_id" = "users"."id") as "user", (select name from "user_groups" where "clake_userextended_route_restriction"."group_id" = "user_groups"."id") as "group", (select name from "clake_userextended_roles" where "clake_userextended_route_restriction"."role_id" = "clake_userextended_roles"."id") as "role", "clake_userextended_routes_pivot"."route_Id" as "pivot_route_Id", "clake_userextended_routes_pivot"."restriction_id" as "pivot_restriction_id" from "clake_userextended_route_restriction" inner join "clake_userextended_routes_pivot" on "clake_userextended_route_restriction"."id" = "clake_userextended_routes_pivot"."restriction_id" where "clake_userextended_route_restriction"."deleted_at" is null and "clake_userextended_routes_pivot"."route_Id" = 3 order by "name" desc) /var/www/zabor/vendor/laravel/framework/src/Illuminate/Database/Connection.php line 666