]> granicus.if.org Git - ejabberd/commitdiff
New schema support for tests. (#2355)
authora-iv <alexander.vl.ivanov@gmail.com>
Thu, 12 Apr 2018 13:42:43 +0000 (18:42 +0500)
committerPaweł Chmielowski <prefiks@prefiks.org>
Thu, 12 Apr 2018 13:42:43 +0000 (15:42 +0200)
test/ejabberd_SUITE.erl

index dcc17d0f5aae08af1bdfa1f4d43f4ee85be545cb..23f3f2db35cf6c7fed5ad1ca78a2b3d58c8b6391 100644 (file)
@@ -1083,9 +1083,21 @@ create_sql_tables(sqlite, _BaseDir) ->
 create_sql_tables(Type, BaseDir) ->
     {VHost, File} = case Type of
                         mysql ->
-                            {?MYSQL_VHOST, "mysql.sql"};
+                            Path = case ejabberd_sql:use_new_schema() of
+                                true ->
+                                    "mysql.new.sql";
+                                false ->
+                                    "mysql.sql"
+                            end,
+                            {?MYSQL_VHOST, Path};
                         pgsql ->
-                            {?PGSQL_VHOST, "pg.sql"}
+                            Path = case ejabberd_sql:use_new_schema() of
+                                true ->
+                                    "pg.new.sql";
+                                false ->
+                                    "pg.sql"
+                            end,
+                            {?PGSQL_VHOST, Path}
                     end,
     SQLFile = filename:join([BaseDir, "sql", File]),
     CreationQueries = read_sql_queries(SQLFile),