gamesmstr Posted September 14, 2010 Share Posted September 14, 2010 I have an interesting problem. I run a game and I occasionally delete inactive members. The deleted members are held in a database which has an identical structure to the main player database in case I need to undelete someone who returns. My problem is that I make changes to the games (updates etc) and that main main player database structure sometimes changes. What I would like to do is have the delete database update it's structure WITHOUT modifying it's data. I've ton up the net looking for simple ways of doing this. Does anyone have any input? Quote Link to comment https://forums.phpfreaks.com/topic/213342-matching-table-data-structures/ Share on other sites More sharing options...
Pikachu2000 Posted September 14, 2010 Share Posted September 14, 2010 Leave them in the same table and set a flag in a field to indicate if they are inactive. Quote Link to comment https://forums.phpfreaks.com/topic/213342-matching-table-data-structures/#findComment-1110794 Share on other sites More sharing options...
gamesmstr Posted September 14, 2010 Author Share Posted September 14, 2010 The reason I delete them is to keep the tables streamlined. This game uses a TON of queries. Quote Link to comment https://forums.phpfreaks.com/topic/213342-matching-table-data-structures/#findComment-1110798 Share on other sites More sharing options...
fenway Posted September 15, 2010 Share Posted September 15, 2010 The reason I delete them is to keep the tables streamlined. This game uses a TON of queries. You can't delete the data AND not delete the data. Flag's aren't a problem. Quote Link to comment https://forums.phpfreaks.com/topic/213342-matching-table-data-structures/#findComment-1111371 Share on other sites More sharing options...
ignace Posted September 15, 2010 Share Posted September 15, 2010 Put the inactive accounts into an ARCHIVE database table. Write a script that performs the "upgrade" with the new database table. Execute that script whenever an old account has to be re-newed (admin section?). The only one that may support this is a Master/Slave set-up but I doubt you want to go for this more expensive solution. I also thought about Federated but that one doesn't do the trick as the master table can be different (in the number of columns) from the slave table. Quote Link to comment https://forums.phpfreaks.com/topic/213342-matching-table-data-structures/#findComment-1111460 Share on other sites More sharing options...
gamesmstr Posted September 16, 2010 Author Share Posted September 16, 2010 The reason I delete them is to keep the tables streamlined. This game uses a TON of queries. You can't delete the data AND not delete the data. Flag's aren't a problem. Lol.. Delete was probably not the correct word. I move them to a Deleted Player Table.... Quote Link to comment https://forums.phpfreaks.com/topic/213342-matching-table-data-structures/#findComment-1111524 Share on other sites More sharing options...
gamesmstr Posted September 16, 2010 Author Share Posted September 16, 2010 Put the inactive accounts into an ARCHIVE database table. Write a script that performs the "upgrade" with the new database table. Execute that script whenever an old account has to be re-newed (admin section?). The only one that may support this is a Master/Slave set-up but I doubt you want to go for this more expensive solution. I also thought about Federated but that one doesn't do the trick as the master table can be different (in the number of columns) from the slave table. Master/Slave setup sounds like exactly what I need. Any suggestions where I can do some research on how to set that up? (Yes, I actually like researching. I learn more that way ) Quote Link to comment https://forums.phpfreaks.com/topic/213342-matching-table-data-structures/#findComment-1111525 Share on other sites More sharing options...
ignace Posted September 16, 2010 Share Posted September 16, 2010 http://dev.mysql.com/doc/refman/5.5/en/replication.html Quote Link to comment https://forums.phpfreaks.com/topic/213342-matching-table-data-structures/#findComment-1111607 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.