diff --git a/sql/pgagent--unpackaged--3.4.sql b/sql/pgagent--unpackaged--4.0.sql
similarity index 90%
rename from sql/pgagent--unpackaged--3.4.sql
rename to sql/pgagent--unpackaged--4.0.sql
index 81794fa..302dde4 100644
--- a/sql/pgagent--unpackaged--3.4.sql
+++ b/sql/pgagent--unpackaged--4.0.sql
@@ -1,6 +1,6 @@
 /*
 // pgAgent - PostgreSQL Tools
-// 
+//
 // Copyright (C) 2002 - 2018 The pgAdmin Development Team
 // This software is released under the PostgreSQL Licence
 //
@@ -42,3 +42,11 @@ SELECT pg_catalog.pg_extension_config_dump('pga_schedule', '');
 SELECT pg_catalog.pg_extension_config_dump('pga_exception', '');
 SELECT pg_catalog.pg_extension_config_dump('pga_joblog', '');
 SELECT pg_catalog.pg_extension_config_dump('pga_jobsteplog', '');
+
+CREATE OR REPLACE FUNCTION pgagent.pgagent_schema_version() RETURNS int2 AS '
+BEGIN
+    -- RETURNS PGAGENT MAJOR VERSION
+    -- WE WILL CHANGE THE MAJOR VERSION, ONLY IF THERE IS A SCHEMA CHANGE
+    RETURN 4;
+END;
+' LANGUAGE 'plpgsql' VOLATILE;
