File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -241,12 +241,21 @@ public function getDefaultDatabase(): string
241241 public function create (string $ name ): bool
242242 {
243243 $ this ->adapter ->create ($ name );
244-
245- // Temporarily change defaultDatabase to create metadata collection
246- $ defaultDatabase = $ this ->getDefaultDatabase ();
247-
248244 $ this ->setDefaultDatabase ($ name );
245+ $ this ->createMetadata ();
246+
247+ return true ;
248+ }
249249
250+ /**
251+ * Create Metadata collection.
252+ * @return bool
253+ * @throws LimitException
254+ * @throws AuthorizationException
255+ * @throws StructureException
256+ */
257+ public function createMetadata (): bool
258+ {
250259 /**
251260 * Create array of attribute documents
252261 * @var Document[] $attributes
@@ -265,7 +274,6 @@ public function create(string $name): bool
265274 ]);
266275
267276 $ this ->createCollection (self ::METADATA , $ attributes );
268- $ this ->setDefaultDatabase ($ defaultDatabase );
269277
270278 return true ;
271279 }
You can’t perform that action at this time.
0 commit comments