Anonymous

Project:Box identification: Difference between revisions

From London Hackspace Wiki
Line 33: Line 33:
=== Database ===
=== Database ===
* Boxes shouldn't be deleted from the database, nor should the owner_id column be set to NULL, as this could result in the loss of useful information such as who owned the box last. Instead, boxes can be marked as inactive or unowned.
* Boxes shouldn't be deleted from the database, nor should the owner_id column be set to NULL, as this could result in the loss of useful information such as who owned the box last. Instead, boxes can be marked as inactive or unowned.
* Created migration scripts to upgrade and downgrade these changes. The benefit is it makes it easy to seed the database with valid locations. It also minimises the risk of the changes causing a problem to the live database since it migration is transactional and will rollback if it fails rather than leave the database in a half migrated state.
* Created migration scripts to upgrade and downgrade any database changes. The benefit of this is it makes it easy to seed the database with valid locations while minimising the risk of the changes causing a problem to the live database through a failed action (the migration is transactional so an error will cause it to rollback to the previous stable state and not leave it in a horrible half migrated mess)


=== Database Design ===
=== Database Design ===