Skip to content Skip to sidebar Skip to footer

Sqlexception On Db:test:load With Rails

I've been working on a small but somewhat complex Rails application with multiple has_and_belongs_to_many relationships. It's open source, and the code is here. Everything was wo

Solution 1:

What worked for me was to delete schema.rb, which is the schema definition file.

(The first paragraph of comments within this file recommends deleting it and generating a new one, rather than editing it.)

Then just run rake db:migrate, which performs all the migrations and re-creates the schema.rb file.

Solution 2:

I got the similar error either and I have no idea. But when I delete those code, in this case,

try delete these line:

create_table "sqlite_sp_functions", :id => false, :force => truedo|t|
  t.text "name"
  t.text "text"end# Could not dump table "sqlite_stat1" because of following StandardError#   Unknown type '' for column 'tbl'# Could not dump table "sqlite_stat3" because of following StandardError#   Unknown type '' for column 'tbl'

create_table "sqlite_vs_links_names", :id => false, :force => truedo|t|
  t.text "name"
  t.text "alias"end

create_table "sqlite_vs_properties", :id => false, :force => truedo|t|
  t.text "parentType"
  t.text "parentName"
  t.text "propertyName"
  t.text "propertyValue"end

create_table "sqlite_vsp_diagrams", :id => false, :force => truedo|t|
  t.text "name"
  t.text "diadata"
  t.text "comment"
  t.text "preview"end

then rake test:prepare might work.

Solution 3:

Add the following config line to config/application.rb or in config/environments/development.rb:

ActiveRecord::SchemaDumper.ignore_tables = /^sqlite_*/

This will ignore all tables starting with "sqlite_" in your database during the schema dump.

Post a Comment for "Sqlexception On Db:test:load With Rails"