[488820] Add a dropAllDataOnActivate property to DBStore

https://bugs.eclipse.org/bugs/show_bug.cgi?id=488820
diff --git a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/operators/Doc01_ConfiguringRepositories.java b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/operators/Doc01_ConfiguringRepositories.java
index 910cdd4..2b45944 100644
--- a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/operators/Doc01_ConfiguringRepositories.java
+++ b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/operators/Doc01_ConfiguringRepositories.java
@@ -288,6 +288,18 @@
     public class Property_writerPoolCapacity
     {
     }
+
+    /**
+     * Property dropAllDataOnActivate
+     * <p>
+     * If set to <code>true</code> and the store is a DBStore, drops all database tables of the configured
+     * {@link Element_dataSource schema} at the beginning of the store activation.
+     * <p>
+     * The default value is <code>false</code>.
+     */
+    public class Property_dropAllDataOnActivate
+    {
+    }
   }
 
   /**
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java
index 5cb3bb6..ce58248 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java
@@ -133,5 +133,10 @@
      * @since 4.3
      */
     public static final String FIELD_CONSTRUCTION_TRACKING = "fieldConstructionTracking"; //$NON-NLS-1$
+
+    /**
+     * @since 4.4
+     */
+    public static final String DROP_ALL_DATA_ON_ACTIVATE = "dropAllDataOnActivate"; //$NON-NLS-1$
   }
 }
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
index 62aad45..62322f5 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
@@ -598,6 +598,12 @@
 
       configureAccessorPool(readerPool, IDBStore.Props.READER_POOL_CAPACITY);
       configureAccessorPool(writerPool, IDBStore.Props.WRITER_POOL_CAPACITY);
+
+      String prop = properties.get(IDBStore.Props.DROP_ALL_DATA_ON_ACTIVATE);
+      if (prop != null)
+      {
+        setDropAllDataOnActivate(Boolean.parseBoolean(prop));
+      }
     }
 
     Connection connection = getConnection();