Use list of system database names
This closes #15
COUCHDB-2619
COUCHDB-2620
diff --git a/src/fabric_db_create.erl b/src/fabric_db_create.erl
index 8b9d32a..6678d5b 100644
--- a/src/fabric_db_create.erl
+++ b/src/fabric_db_create.erl
@@ -45,12 +45,11 @@
case re:run(DbName, ?DBNAME_REGEX, [{capture,none}, dollar_endonly]) of
match ->
ok;
- nomatch when DbName =:= <<"_users">> ->
- ok;
- nomatch when DbName =:= <<"_replicator">> ->
- ok;
nomatch ->
- {error, illegal_database_name}
+ case lists:member(?b2l(DbName), ?SYSTEM_DATABASES) of
+ true -> ok;
+ false -> {error, illegal_database_name}
+ end
end
end.