r/DatabaseHelp • u/Bluhb_ • Sep 24 '20
Reinserting every row of table
Hello,
I'm building an application that will store it's settings in a DB. Now I'm looking at changing these settings. From the menu where you can change the settings I get all settings when they are applied. My plan was to just drop the settings table (or delete every row, what's better?) and then recreate the table with the new settings.
Is dropping and recreating a table considered bad practice? Because it sure feels like it. Is there any other(better) way to do something like this?
Kind regards and thanks in advance!
Bluhb_
2
Upvotes
View all comments
Show parent comment
1
u/Bluhb_ Sep 25 '20
Yeah I rewrote a part and now I have the ID for my setting. But it's still updating all the rows of the table(because every setting could change everytime I get them). It's also not a simple key value pair but a complete row of 12 values, where 5 values are original and the other 5 are aliases and 2 are extra settings. Unfortunate not as easy as just key value :(