ComPlat / chemotion_ELN

Electronic Lab Notebook
https://www.chemotion.net
GNU Affero General Public License v3.0
119 stars 45 forks source link

`bundle exec rails db:setup` fails in development #1941

Closed JanCBrammer closed 4 weeks ago

JanCBrammer commented 1 month ago

bundle exec rails db:setup fails with

rails aborted!
ActiveModel::UnknownAttributeError: unknown attribute 'password' for Device.
/home/chemotion-dev/app/db/seeds/development/devices.seed.rb:41:in `block in <main>'
/home/chemotion-dev/app/db/seeds/development/devices.seed.rb:39:in `each'
/home/chemotion-dev/app/db/seeds/development/devices.seed.rb:39:in `<main>'
/home/chemotion-dev/app/db/seeds.rb:15:in `block (2 levels) in <main>'
/home/chemotion-dev/app/db/seeds.rb:13:in `each'
/home/chemotion-dev/app/db/seeds.rb:13:in `block in <main>'
/home/chemotion-dev/app/db/seeds.rb:4:in `each'
/home/chemotion-dev/app/db/seeds.rb:4:in `<main>'
Tasks: TOP => db:setup => db:seed
(See full trace by running task with --trace)

Potentially related to https://github.com/ComPlat/chemotion_ELN/pull/1736?

cbuggle commented 1 month ago

I just stumbled over these seeds as well.

Obviously Device is no longer a subclass of User thus no longer inherits "password".

https://github.com/ComPlat/chemotion_ELN/pull/1736/files#diff-0b946f68fbc439d040baed2ac63b3c931b37ef50386b5994b15293f4eeae349aL50

I guess this should be fixed in the seeds then? On an unrelated note some of the seeds are not idempotent which might be coped with in one go?

JanCBrammer commented 1 month ago

I guess this should be fixed in the seeds then?

Do you want to give it a go? I'm happy to review.

On an unrelated note some of the seeds are not idempotent which might be coped with in one go?

Could you elaborate? Idempotent as in "when I seed the database multiple times, the seeded data aren't identical over time"?

JanCBrammer commented 1 month ago

See #1945.

PiTrem commented 1 month ago

Hi @cbuggle @JanCBrammer, started a discussion on the topic: https://github.com/ComPlat/chemotion_ELN/discussions/1949

any input is welcome.