Revert "Revert "Merge pull request #564 from sharetribe/transaction-model""

This reverts commit 98ab0712479508f53d64e3a5e1f5b485bccd7cab.
Revert "Revert "Fix dublicated migration in structure.sql""

This reverts commit c12bddc2eddce831193c959041624562f3271e6e.
Revert "Revert "Fix more duplicates""

This reverts commit 29597191fd61573b4cc5d88c6a0c12180c0ddcaa.
Revert "Revert "Run migrations""

This reverts commit 7a5194745b781a999d9a4aab24433d11f84317b6.
Add indexes
Run indices and annotate
Add last activity transaction
Rename last activity to last transition
Transition commands to Transaction Service
Remove methods that were used for refactoring only
Move last transition data to transactions
Add comment about moving transaction admin query logic
Quoting for Array
Iteration on inbox service
Move last message and transition queries to corresponding services
Optimize by adding current state to transactions
Update current_state when status changed
Change queries to use current_state
Remove commment
Migrate data to current state