Skip to content
This repository was archived by the owner on Apr 17, 2018. It is now read-only.
This repository was archived by the owner on Apr 17, 2018. It is now read-only.

Better fallback for defauls on autoupgrade opration? #43

Open
@carlosacp

Description

@carlosacp

I Tried

class A
include DataMapper::Resource
property :id, Serial
property :no_recipes_with, Object, default: ""
end

and when autoupgrade :

rake db:autoupgrade
rake aborted!
BLOB/TEXT column 'no_recipes_with' can't have a default value

(mysql)

But if I remove the default value, upgrade the database, and put the default value again back, it works.
Wouldn't be a better fall back if it uses de default value in model objects in this cases?
Or I'm not supposed to use default value if upgrade fails?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions