GenieFramework / SearchLight.jl

ORM layer for Genie.jl, the highly productive Julia web framework
https://genieframework.com
MIT License
139 stars 16 forks source link

MethodError: no method matching names(::String; all=true) #39

Closed AbhimanyuAryan closed 2 years ago

AbhimanyuAryan commented 2 years ago

Describe the bug SearchLight.Migration.last_up() fails

Error stacktrace

[ Info: 2021-11-24 11:35:47 SELECT version FROM schema_migrations ORDER BY version DESC
WARNING: replacing module CreateTablePkgrequests.
┌ Error: 2021-11-24 11:35:47 Failed executing migration CreateTablePkgrequests up
└ @ SearchLight.Migration ~/.julia/packages/SearchLight/OxfJI/src/Migration.jl:300
ERROR: MethodError: no method matching names(::String; all=true)
Closest candidates are:
  names(::Union{DataFrames.DataFrameColumns, DataFrames.DataFrameRows}) at /Users/arstar/.julia/packages/DataFrames/vuMM8/src/abstractdataframe/iteration.jl:261 got unsupported keyword argument "all"
  names(::Union{DataFrames.DataFrameColumns, DataFrames.DataFrameRows}, ::Any) at /Users/arstar/.julia/packages/DataFrames/vuMM8/src/abstractdataframe/iteration.jl:262 got unsupported keyword argument "all"
  names(::DataFrames.DataFrameRow) at /Users/arstar/.julia/packages/DataFrames/vuMM8/src/dataframerow/dataframerow.jl:266 got unsupported keyword argument "all"
  ...
Stacktrace:
 [1] run_migration(migration::SearchLight.Migration.DatabaseMigration, direction::Symbol; force::Bool)
   @ SearchLight.Migration ~/.julia/packages/SearchLight/OxfJI/src/Migration.jl:289
 [2] #last_up#11
   @ ~/.julia/packages/SearchLight/OxfJI/src/Migration.jl:155 [inlined]
 [3] last_up()
   @ SearchLight.Migration ~/.julia/packages/SearchLight/OxfJI/src/Migration.jl:155
 [4] top-level scope
   @ REPL[44]:1

To reproduce Create new MVC app without dbadapter Genie.newapp("demoapp")

add config

env: ENV["GENIE_ENV"]

dev:
  adapter: SQLite
  database: db/netflix_catalog.sqlite
  config:
julia> SearchLight.Configuration.load()
julia> SearchLight.Configuration.load() |> SearchLight.connect
julia> SearchLightSQLite.CONNECTIONS
julia> SearchLight.Migrations.create_migrations_table()

create new resource

Genie.newresource("pkgrequest")

add this to migrations file _create_table_pkg....

module CreateTablePkgrequests

import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table

function up()
  create_table(:pkgrequests) do
    [
      primary_key()
      column(:uuid, :string)
      column(:org, :string)
    ]
  end

  add_index(:pkgrequests, :uuid)
  add_index(:pkgrequests, :org)
end

function down()
  drop_table(:pkgrequests)
end

end

"""
edit something like this
"""
SearchLight.Migration.status()
SearchLight.Migration.last_up()

Expected behavior A clear and concise description of what you expected to happen.

Additional context Please include the output of julia> versioninfo()

Julia Version 1.6.2
Commit 1b93d53fc4 (2021-07-14 15:36 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.7.0)
  CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, haswell)
Environment:
  JULIA_EDITOR = vim
  JULIA_REVISE = auto

pkg> st

  [c43c736e] Genie v4.2.0 `https://github.com/GenieFramework/Genie.jl.git#master`
  [6d011eab] Inflector v1.0.1
  [e6f89c97] LoggingExtras v0.4.7
  [739be429] MbedTLS v1.0.3
  [340e8cb6] SearchLight v1.0.2
  [21a827c4] SearchLightSQLite v1.0.0
AbhimanyuAryan commented 2 years ago

accidentally left string at end of _createmigrations....jl file

migration file should return module