Skip to content

Migration with SQLite failed #316

@UweWagner403

Description

@UweWagner403

Based on the example model Article, the expanded model look like this:

class Article < Marten::Model
with_timestamp_fields
field :id, :big_int, primary_key: true, auto: true
field :title, :string, max_size: 255
field :content, :text
field :quelle, :string, max_size: 255, blank: true, default: nil
field :created_at, :date_time, auto_now_add: true, blank: true
field :updated_at, :date_time, auto_now: true, blank: true
end

marten genmigrations generate:
def plan
change_column :main_article, :quelle, :string, max_size: 255
end

I noticed the constraints blank: true and default: nil are not noticed.

marten migrate gives an error: "Unhandled exception: NOT NULL constraint failed: new_main_article.quelle (SQLite3::Exception)".

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