evilmartians / evil-seed

A Gem for creating partial anonymized dumps of your database using your app model relations.
MIT License
447 stars 19 forks source link

Ignore generated columns #15

Closed cmer closed 1 year ago

cmer commented 1 year ago

Is there an easy way to ignore specific columns, specifically generated columns?

Error:
BasicsTest#test_basic_runthrough:
ActiveRecord::StatementInvalid: PG::GeneratedAlways: ERROR:  cannot insert a non-DEFAULT value into column "full_name"
DETAIL:  Column "full_name" is a generated column.

    test/system/basics_test.rb:26:in `block (2 levels) in init_seeds'
    test/system/basics_test.rb:25:in `each'
    test/system/basics_test.rb:25:in `block in init_seeds'
    test/system/basics_test.rb:19:in `init_seeds'
    test/system/basics_test.rb:37:in `block in <class:BasicsTest>'
cmer commented 1 year ago

Does this make sense? https://github.com/evilmartians/evil-seed/pull/16

Envek commented 1 year ago

Released in 0.4.0, thanks for the pull request.