 
 (defn get-schema-name-for-session-id [data-session-id]
   (let [
-         app-schema-id     (:appshare_application_schema_id (sql-1 "select   appshare_application_schema_id   from   public.appshare_web_sessions    where   session_id = ?" [data-session-id]))
+         schema-id     (:fk_appshare_schema_id (sql-1 "select   fk_appshare_schema_id   from   public.appshare_web_sessions    where   session_id = ?" [data-session-id]))
+
+
 
          schema-name       (cond
-                             app-schema-id
-                             (:database_schema_name (sql-1 "select   database_schema_name   from   public.appshare_application_schemas  where  id = ?"  [app-schema-id]))
+                             schema-id
+                             (:database_schema_name (sql-1 "select   database_schema_name   from   public.appshare_schemas  where  id = ?"  [schema-id]))
 
                              :else
                              "public")

          fk_appshare_application_id                       integer,
          fk_appshare_schema_id                            integer,
          application_environment                          character varying,
          database_schema_name                             character varying,
          CONSTRAINT appshare_applications_schemas_pkey    PRIMARY KEY (id)
          );
          "


          (
          id                               NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY,
          fk_appshare_user_id              NUMBER,
          fk_appshare_schema_id            NUMBER,
          session_id                       VARCHAR2(200 BYTE),
          CONSTRAINT  APPSHARE_WEB_SESSIONS_PK PRIMARY KEY (ID)
          )")
