Best practice advise for deleting tables in PHP/MySQL framework? -
what best practices tips tinkering, deleting tables, making reversible changes in mysql (not production) testing server? in case i'm learning php/mysql framework.
the general tool have in toolbox rename files before delete them. if there problem can return file original name. imagine should ok apply same practice database, since clients can lose connection host. yet, how web application framework proceed when referential integrity broken in 1 place?
i guess referring transactions. innodb engine in mysql supports transactions foreign key constraints.
in transactional design, can execute bunch of queries need executed single entity in order meaningful , maintain data integrity. transaction started , if goes wrong rollback, reverting every change done far, or committing entire set of modifications in database.
foreign keys constraints referential data. in master-detail relationship cannot e.g. refer master record not exist. if there table comments user_id referring users.id field , not allowed enter comment non-existent user.
read more here if http://dev.mysql.com/doc/refman/5.0/en/innodb-transaction-model.html , foreign keys http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html
Comments
Post a Comment