Search code examples
phpredbean

What happens to unused fields


Since RedBean creates all columns by itself what would happen if I don't need a field any more. Is there an easy way to remove it without deleting the table and lose all data?

Can this be solved automaticaly or how would RedBean react if I delete the column manually?


Solution

  • Delete the table column in the usual way from your MySQL client (say, phpMyAdmin or SQLYog) or from the MySQL console.

    RedBean can't get confused by this "external meddling" that you're worried about, because it runs on each PHP script execution and, to the best of my knowledge, carries no state across invocations. It's really just an abstraction over data storage.

    Interestingly, the RedBean Wiki doesn't appear to talk about this sort of thing at all.