On Thursday, July 26, 2018 at 2:44:10 PM UTC-6, Jeremy Evans wrote:
>
> On Thursday, July 26, 2018 at 1:36:00 PM UTC-7, Jeremy Evans wrote:
>>
>> On Thursday, July 26, 2018 at 1:18:26 PM UTC-7, James wrote:
>>>
>>> On Thursday, July 26, 2018 at 12:38:16 PM UTC-6, Jeremy Evans wrote:
>>>>
>>>> On Thursday, July 26, 2018 at 10:52:22 AM UTC-7, James wrote:
>>>>>
>>>>> I created an empty project, copied some of the schema dumped using
>>>>> sequel -d:
>>>>>
>>>>> Sequel.migration do
>>>>> change do
>>>>> create_table(:items) do
>>>>> primary_key :id
>>>>> Integer :product_id
>>>>> String :part_number, :size=>34, :null=>false
>>>>> BigDecimal :price, :default=>BigDecimal("0.0"), :null=>false
>>>>> BigDecimal :weight, :default=>BigDecimal("0.0"), :null=>false
>>>>> BigDecimal :length, :default=>BigDecimal("0.0"), :null=>false
>>>>> BigDecimal :width, :default=>BigDecimal("0.0"), :null=>false
>>>>> BigDecimal :height, :default=>BigDecimal("0.0"), :null=>false
>>>>> end
>>>>> end
>>>>> end
>>>>>
>>>>> Ran sequel -m db/migrate/ sqlite://db/test.sqlite3 and got the
>>>>> following error:
>>>>>
>>>>> Error: Sequel::DatabaseError: SQLite3::SQLException: duplicate column
>>>>> name: 0.0
>>>>> /home/james/.gem/ruby/2.5.0/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:in
>>>>>
>>>>> `initialize'
>>>>>
>>>>> Changing the default values to 0.0 allows the migration to run
>>>>> successfully. Not sure if this is enough to get you going? When I use
>>>>> the
>>>>> sequel -c command to copy the database, I imagine Sequel is generating
>>>>> the
>>>>> same default values of BigDecimal("0.0").
>>>>>
>>>>
>>>> Your bug is that your BigDecimal('0.0') calls are creating columns
>>>> named 0.0 (notice how the same method is called in two places on the 5
>>>> lines). You want to switch to Kernel::BigDecimal('0.0') for the default
>>>> values.
>>>>
>>>
>>> This migration was created by bin/sequel -d, and is likely why I am
>>> having issues with bin/sequel -c. Don't you think?
>>>
>>
>> Agreed, sorry for not catching that earlier. That is a bug that should
>> be fixed, I'll work on it shortly.
>>
>
> Fixed:
> https://github.com/jeremyevans/sequel/commit/b45cdab047f139d0d415ecf36b852b9cc1843ba4
>
Thank you Jeremy! :)
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.