PHP Fatal error: entity type does not exist

If you somehow get into this nasty problem, you have probably made some big mistake and now you are missing entity definition in your database. To quickly fix that you need to recreate it, you can use drush for it.  So if you are lucky find in code where this entity was added, probably in some hook_update in module.install file 

Database tables created that are not from entity definitions

If you browse around the DB tables in your drupal site, you might stumble into tables with double underscore names like commerce_order__shipments, this is most probably a table created as part of drupal field API system, mostly created as a multivalue field for some entity. It could be created when user creates field in UI or it could be programmatically made, like here

How to find hook_update_N, current N value

To find it via drush, run this command 

drush php:eval "echo drupal_get_installed_schema_version('modul_name');"

also if you want to look it up with some DB admin tool, look under table `key_value`,  `system.schema` collection row, with a `name` of your module and you will get value of last run update.

Dumping and exporting DB with drush and piping to ZIP

If you want to import DB that is in ZIP format with one line

gunzip -c my_db.sql.gz | drush sqlc

to dump DB to ZIP file write this

drush sql-dump --gzip --result-file=my_db.sql

you will end up with my_db.sql.gz file.