Skip to content

Problems with SQLite #49

@Xanders

Description

@Xanders

Hello! MiniRecord is awesome, especially with MySQL. While using with SQLite I have some problems with it:

  • When I use decimal columns, everytime I call auto_upgrade! it re-create tables. My English is terrible, so let me show example:
class Some < ActiveRecord::Base
  field :one, :two, :three, as: :decimal, scale: 2
end
...
Some.auto_upgrade! # happyness
Some.auto_upgrade! # oh:
# [MiniRecord] Detected schema change for somes.one#scale from nil to 2
# [MiniRecord] Changing column somes.one to new type decimal
# re-creating table with tempolary table for each column
Some.auto_upgrade! # and again...
  • [critical] While creating tempolaty tables on re-creating there are exceptions on binary fields (there was MessagePack objects in my case):
SQLite3::SQLException: unrecognized token: "<binary_data_here>": INSERT INTO "altered_somes" ...

So, changing fields with MiniRecord is impossible with any binary data in table.

  • When using MySQL there is a warning:
Error adding decimal column: precision cannot be empty if scale if specified

But when using SQLite there is no any warnings. And in AR's migrations there is no such warning too.

Of cource, all of that are not End of the World, because I can use MySQL instead, but maybe it will usefull information for you. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions