diff options
-rw-r--r-- | Makefile.in | 5 | ||||
-rw-r--r-- | src/ejabberd_sql_sup.erl | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/Makefile.in b/Makefile.in index c7b799ac7..ee2b36e3b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -212,13 +212,16 @@ $(sort $(call TO_DEST,$(MAIN_DIRS) $(DEPS_DIRS))): $(call TO_DEST,priv/sql/lite.sql): sql/lite.sql $(call TO_DEST,priv/sql) $(INSTALL) -m 644 $< $@ +$(call TO_DEST,priv/sql/lite.new.sql): sql/lite.new.sql $(call TO_DEST,priv/sql) + $(INSTALL) -m 644 $< $@ + $(call TO_DEST,priv/bin/captcha.sh): tools/captcha.sh $(call TO_DEST,priv/bin) $(INSTALL) -m 755 $(O_USER) $< $@ $(call TO_DEST,priv/lua/redis_sm.lua): priv/lua/redis_sm.lua $(call TO_DEST,priv/lua) $(INSTALL) -m 644 $< $@ -copy-files-sub2: $(call TO_DEST,$(DEPS_FILES) $(MAIN_FILES) priv/bin/captcha.sh priv/sql/lite.sql priv/lua/redis_sm.lua) +copy-files-sub2: $(call TO_DEST,$(DEPS_FILES) $(MAIN_FILES) priv/bin/captcha.sh priv/sql/lite.sql priv/sql/lite.new.sql priv/lua/redis_sm.lua) .PHONY: $(call TO_DEST,$(DEPS_FILES) $(MAIN_DIRS) $(DEPS_DIRS)) diff --git a/src/ejabberd_sql_sup.erl b/src/ejabberd_sql_sup.erl index 2251c811e..d4af0244b 100644 --- a/src/ejabberd_sql_sup.erl +++ b/src/ejabberd_sql_sup.erl @@ -188,7 +188,11 @@ check_sqlite_db(Host) -> create_sqlite_tables(DB) -> SqlDir = misc:sql_dir(), - File = filename:join(SqlDir, "lite.sql"), + Filename = case ejabberd_sql:use_new_schema() of + true -> "lite.new.sql"; + false -> "lite.sql" + end, + File = filename:join(SqlDir, Filename), case file:open(File, [read, binary]) of {ok, Fd} -> Qs = read_lines(Fd, File, []), |