diff --git a/src/main/resources/database/postgresql/alter_8_0_x_to_8_1_0.sql b/src/main/resources/database/postgresql/alter_8_0_x_to_8_1_0.sql
index c70c2f1f71144dc21fa77385c7a5c9617e074fd5..8b4f5dda7af1245cf054ebdc8ac19929a6441dfc 100644
--- a/src/main/resources/database/postgresql/alter_8_0_x_to_8_1_0.sql
+++ b/src/main/resources/database/postgresql/alter_8_0_x_to_8_1_0.sql
@@ -126,7 +126,7 @@ create or replace view o_ep_notifications_rating_v as (
    from o_userrating as urating
    inner join o_olatresource as rating_resource on (rating_resource.resid = urating.resid and rating_resource.resname = urating.resname)
    inner join o_ep_struct_el as map on (map.fk_olatresource = rating_resource.resource_id)
-   left join o_ep_struct_el as page on (page.fk_struct_root_map_id = map.structure_id and page.structure_id = cast(urating.ressubpath as integer))
+   left join o_ep_struct_el as page on (page.fk_struct_root_map_id = map.structure_id and page.structure_id = cast(urating.ressubpath as int8))
 );
 
 create or replace view o_ep_notifications_comment_v as (
@@ -141,6 +141,6 @@ create or replace view o_ep_notifications_comment_v as (
    from o_usercomment as ucomment
    inner join o_olatresource as comment_resource on (comment_resource.resid = ucomment.resid and comment_resource.resname = ucomment.resname)
    inner join o_ep_struct_el as map on (map.fk_olatresource = comment_resource.resource_id)
-   left join o_ep_struct_el as page on (page.fk_struct_root_map_id = map.structure_id and page.structure_id = cast(ucomment.ressubpath as integer))
+   left join o_ep_struct_el as page on (page.fk_struct_root_map_id = map.structure_id and page.structure_id = cast(ucomment.ressubpath as int8))
 );
 
diff --git a/src/main/resources/database/postgresql/setupDatabase.sql b/src/main/resources/database/postgresql/setupDatabase.sql
index 1aa361426490ecf7a84a9cc40a2d48b9425a0c97..0adb0a6e1ca8c5f6452aef812f7bba919783e5f9 100644
--- a/src/main/resources/database/postgresql/setupDatabase.sql
+++ b/src/main/resources/database/postgresql/setupDatabase.sql
@@ -1360,7 +1360,7 @@ create or replace view o_ep_notifications_rating_v as (
    from o_userrating as urating
    inner join o_olatresource as rating_resource on (rating_resource.resid = urating.resid and rating_resource.resname = urating.resname)
    inner join o_ep_struct_el as map on (map.fk_olatresource = rating_resource.resource_id)
-   left join o_ep_struct_el as page on (page.fk_struct_root_map_id = map.structure_id and page.structure_id = cast(urating.ressubpath as integer))
+   left join o_ep_struct_el as page on (page.fk_struct_root_map_id = map.structure_id and page.structure_id = cast(urating.ressubpath as int8))
 );
 
 create or replace view o_ep_notifications_comment_v as (
@@ -1375,7 +1375,7 @@ create or replace view o_ep_notifications_comment_v as (
    from o_usercomment as ucomment
    inner join o_olatresource as comment_resource on (comment_resource.resid = ucomment.resid and comment_resource.resname = ucomment.resname)
    inner join o_ep_struct_el as map on (map.fk_olatresource = comment_resource.resource_id)
-   left join o_ep_struct_el as page on (page.fk_struct_root_map_id = map.structure_id and page.structure_id = cast(ucomment.ressubpath as integer))
+   left join o_ep_struct_el as page on (page.fk_struct_root_map_id = map.structure_id and page.structure_id = cast(ucomment.ressubpath as int8))
 );
 
 create view o_gp_business_to_repository_v as (