added PostedTransaction foreign keys and custom uniqueness constraints