Fixed db init
This commit is contained in:
parent
80ac081234
commit
45e13b6149
|
@ -25,8 +25,7 @@ SearchLight.Configuration.load() |> SearchLight.connect
|
||||||
#SearchLight.Migration.all_up!!(context=Server)
|
#SearchLight.Migration.all_up!!(context=Server)
|
||||||
#SearchLight.Migration.status()
|
#SearchLight.Migration.status()
|
||||||
|
|
||||||
cd(@__DIR__)
|
p = "db/migrations/"
|
||||||
p = "migrations/"
|
|
||||||
files = readdir(p)
|
files = readdir(p)
|
||||||
files = files[map(x -> x[end-1:end].=="jl", files)]
|
files = files[map(x -> x[end-1:end].=="jl", files)]
|
||||||
inds = map(x -> parse(Int64,split(x,"_")[1]), files)
|
inds = map(x -> parse(Int64,split(x,"_")[1]), files)
|
||||||
|
@ -35,7 +34,7 @@ files = files[inds_sorted]
|
||||||
|
|
||||||
for f in files
|
for f in files
|
||||||
try
|
try
|
||||||
m = include(joinpath(p,f))
|
m = include(joinpath("migrations",f))
|
||||||
m.up()
|
m.up()
|
||||||
catch
|
catch
|
||||||
end
|
end
|
||||||
|
|
|
@ -26,7 +26,7 @@ function up()
|
||||||
end
|
end
|
||||||
|
|
||||||
function down()
|
function down()
|
||||||
drop_table(:groups)
|
drop_table(:groups_requests)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
Loading…
Reference in New Issue