Unable to use table migrations with custom schema for PostgreSQL adapter
When trying to create migration files for PostgreSQL with tables in custom schema's the "up" action throws an error (shown below).
Error stacktrace
julia> SearchLight.Migration.last_up()
│┌ Error: 2019-11-15 20:23:23 Failed executing migration CreateTableDemo.games up
│└ @ SearchLight.Migration ~/.julia/packages/SearchLight/c2vea/src/Migration.jl:259
│ERROR: LoadError: syntax: invalid identifier name "."
│Stacktrace:
│ [1] top-level scope at xxxxxxx/db/migrations/2019111519212379_create_table_d
│emo.games.jl:1
│ [2] include at ./boot.jl:328 [inlined]
│ [3] include_relative(::Module, ::String) at ./loading.jl:1094
│ [4] include at ./Base.jl:31 [inlined]
│ [5] include at xxxxxxx/.julia/packages/SearchLight/c2vea/src/Migration.jl:4 [inlined]
│ [6] #run_migration#17(::Bool, ::typeof(SearchLight.Migration.run_migration), ::SearchLight.Migration.Database
│Migration, ::Symbol) at xxxxxxx/packages/SearchLight/c2vea/src/Migration.jl:247
│ [7] #run_migration at ./none:0 [inlined]
│ [8] #last_up#7 at xxxxxxx/.julia/packages/SearchLight/c2vea/src/Migration.jl:119 [inlined]
│ [9] last_up() at xxxxxxx/.julia/packages/SearchLight/c2vea/src/Migration.jl:119
│ [10] top-level scope at REPL[9]:1
│in expression starting at xxxxxxx/db/migrations/2019111519212379_create_table
│_demo.games.jl:1
To reproduce
While in REPL generate migration files with: SearchLight.Generator.newresource("Demo.Game")
Edit the file named "..._create_table_demo.games.jl".
Updates done were related only to column definition(s).
The resulting content of the file is shown below:
function up()
create_table(:demo.games) do
[
primary_key()
column(:description, :string)
]
end
add_index(:demo.games, :description)
end
function down()
drop_table(:demo.games)
end
end
3. Attempt to "up" the migration by calling "SearchLight.Migration.last_up()" from REPL
4. REPL throws an errow described above
**Expected behavior**
Creation of a table called 'game' in a schema called 'demo'.
**Additional context**
Unable to use table migrations with custom schema for PostgreSQL adapter When trying to create migration files for PostgreSQL with tables in custom schema's the "up" action throws an error (shown below).
Error stacktrace julia> SearchLight.Migration.last_up() │┌ Error: 2019-11-15 20:23:23 Failed executing migration CreateTableDemo.games up │└ @ SearchLight.Migration ~/.julia/packages/SearchLight/c2vea/src/Migration.jl:259 │ERROR: LoadError: syntax: invalid identifier name "." │Stacktrace: │ [1] top-level scope at xxxxxxx/db/migrations/2019111519212379_create_table_d │emo.games.jl:1 │ [2] include at ./boot.jl:328 [inlined] │ [3] include_relative(::Module, ::String) at ./loading.jl:1094 │ [4] include at ./Base.jl:31 [inlined] │ [5] include at xxxxxxx/.julia/packages/SearchLight/c2vea/src/Migration.jl:4 [inlined] │ [6] #run_migration#17(::Bool, ::typeof(SearchLight.Migration.run_migration), ::SearchLight.Migration.Database │Migration, ::Symbol) at xxxxxxx/packages/SearchLight/c2vea/src/Migration.jl:247 │ [7] #run_migration at ./none:0 [inlined] │ [8] #last_up#7 at xxxxxxx/.julia/packages/SearchLight/c2vea/src/Migration.jl:119 [inlined] │ [9] last_up() at xxxxxxx/.julia/packages/SearchLight/c2vea/src/Migration.jl:119 │ [10] top-level scope at REPL[9]:1 │in expression starting at xxxxxxx/db/migrations/2019111519212379_create_table │_demo.games.jl:1
To reproduce
import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table
function up() create_table(:demo.games) do [ primary_key() column(:description, :string) ] end
add_index(:demo.games, :description) end
function down() drop_table(:demo.games) end
end
pkg> st │ Status
xxxxxxx/Project.toml
│ [c43c736e] Genie v0.21.0 #master (https://github.com/GenieFramework/Genie.jl.git) │ [e6f89c97] LoggingExtras v0.4.0 │ [295af30f] Revise v2.3.0 │ [340e8cb6] SearchLight v0.15.0 #master (https://github.com/GenieFramework/SearchLight.jl.git)