hil icon indicating copy to clipboard operation
hil copied to clipboard

init_db is more complicated than it needs to be.

Open zenhack opened this issue 11 years ago • 1 comments

It occured to me that I'd never explicitly checked the contract for sqlalchemy's Metadata.create_all(), so I did, and found out that supposedly it should be okay to run it on a database which already has the tables.

This gives us some opportunity for simplification. We should be able to get rid of the conditionals for the dell driver as well; SQL has facilities to ignore duplicate insertions for you, so we just need to figure out what those map to in sqlalchemy.

init_db is one of the tricker bits of the code, and I think worth cleaning up. This would obviate the create parameter, and the uri parameter already isn't really needed - we can just use cfg.set.

Thoughts?

zenhack avatar Aug 02 '14 04:08 zenhack

What should happen if we run init_db with the Dell driver, then change the dell driver's VLAN config, then run init_db again? I don't think there's any very reasonable behavior here.

gsilvis avatar Aug 18 '14 16:08 gsilvis