themightychris / db-to-git

Dump your database into git
MIT License
2 stars 1 forks source link

How to handle tables that don't have primary keys #2

Open themightychris opened 8 years ago

themightychris commented 8 years ago
  1. Just not support and skip them?
  2. Use the hash of a record's subtree as its name in the table's tree with a number appended for duplicates as needed?
  3. Some sort of numbering or UUID scheme? It needs to be consistent though to minimize noise when diffing two disconnected dumps of the same data
timwis commented 7 years ago

Just not support and skip them?

I'd lean towards this one, but first ask the question: Is there any scenario in a database when not having a primary key in a table is good practise?

themightychris commented 7 years ago

For something like a log table you wouldn't have a primary key necessarily, the bigger use case is tables with compound keys (e.g. xref tables), which maybe could be handled by reading the primary key config and generating a directory name that concats the compound keys with some delimiter