Fix database queries related to the origin-revision layer
This required allowing null dates in the revision
table so that revision can be added
by the origin-revision layer algorithm but not recognized as already processed by the
revision-content layer. Revision and origin entries are now inserted in the database
prior to inserting rows to revision_in_origin and revision_before_revision relations,
so that internal ids are properly resolved.
Depends on !52 (closed)
Migrated from D5943 (view on Phabricator)