From c9ba638b9f0e2f11ff525c22a60d4daf4822a197 Mon Sep 17 00:00:00 2001
From: Matija Santl <matija.santl@memgraph.com>
Date: Tue, 4 Jun 2019 13:24:52 +0200
Subject: [PATCH] Fix includes for constraints

Summary: Forward declare the needed struct and include in the correct file.

Reviewers: ipaljak

Reviewed By: ipaljak

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2110
---
 src/database/single_node/graph_db_accessor.cpp    | 1 +
 src/database/single_node/graph_db_accessor.hpp    | 5 ++++-
 src/database/single_node_ha/graph_db_accessor.cpp | 1 +
 src/database/single_node_ha/graph_db_accessor.hpp | 5 ++++-
 4 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/database/single_node/graph_db_accessor.cpp b/src/database/single_node/graph_db_accessor.cpp
index f298b176a..f12a15e17 100644
--- a/src/database/single_node/graph_db_accessor.cpp
+++ b/src/database/single_node/graph_db_accessor.cpp
@@ -6,6 +6,7 @@
 #include <glog/logging.h>
 
 #include "durability/single_node/state_delta.hpp"
+#include "storage/common/constraints/exceptions.hpp"
 #include "storage/single_node/edge.hpp"
 #include "storage/single_node/edge_accessor.hpp"
 #include "storage/single_node/vertex.hpp"
diff --git a/src/database/single_node/graph_db_accessor.hpp b/src/database/single_node/graph_db_accessor.hpp
index 222b5d2b1..85f0ec5e4 100644
--- a/src/database/single_node/graph_db_accessor.hpp
+++ b/src/database/single_node/graph_db_accessor.hpp
@@ -13,7 +13,6 @@
 
 #include "database/single_node/exceptions.hpp"
 #include "database/single_node/graph_db.hpp"
-#include "storage/common/constraints/exceptions.hpp"
 #include "storage/common/types/types.hpp"
 #include "storage/single_node/edge_accessor.hpp"
 #include "storage/single_node/vertex_accessor.hpp"
@@ -21,6 +20,10 @@
 #include "transactions/type.hpp"
 #include "utils/bound.hpp"
 
+namespace storage::constraints {
+struct ConstraintEntry;
+}  // namespace storage::constraints
+
 namespace database {
 /**
  * Base accessor for the database object: exposes functions for operating on the
diff --git a/src/database/single_node_ha/graph_db_accessor.cpp b/src/database/single_node_ha/graph_db_accessor.cpp
index 3c077f435..9cdbe57a6 100644
--- a/src/database/single_node_ha/graph_db_accessor.cpp
+++ b/src/database/single_node_ha/graph_db_accessor.cpp
@@ -6,6 +6,7 @@
 #include <glog/logging.h>
 
 #include "durability/single_node_ha/state_delta.hpp"
+#include "storage/common/constraints/exceptions.hpp"
 #include "storage/single_node_ha/edge.hpp"
 #include "storage/single_node_ha/edge_accessor.hpp"
 #include "storage/single_node_ha/vertex.hpp"
diff --git a/src/database/single_node_ha/graph_db_accessor.hpp b/src/database/single_node_ha/graph_db_accessor.hpp
index 2d52e7023..81e505242 100644
--- a/src/database/single_node_ha/graph_db_accessor.hpp
+++ b/src/database/single_node_ha/graph_db_accessor.hpp
@@ -13,7 +13,6 @@
 
 #include "database/single_node_ha/graph_db.hpp"
 #include "raft/raft_interface.hpp"
-#include "storage/common/constraints/exceptions.hpp"
 #include "storage/common/types/types.hpp"
 #include "storage/single_node_ha/edge_accessor.hpp"
 #include "storage/single_node_ha/vertex_accessor.hpp"
@@ -22,6 +21,10 @@
 #include "utils/bound.hpp"
 #include "utils/exceptions.hpp"
 
+namespace storage::constraints {
+struct ConstraintEntry;
+}  // namespace storage::constraints
+
 namespace database {
 
 /** Thrown when inserting in an index with constraint. */