Ticket #46 (closed review: fixed)

Opened 21 months ago

Last modified 20 months ago

Open a database directly at schema version X, without evolving from version 1

Reported by: mscott Owned by: mscott
Priority: high Milestone: Schevo 3.1a1
Component: Schevo Keywords:
Cc:

Description

There is no way to create a new database starting at schema version X (where X > 1); one can only create a database starting at version 1 then migrate to the desired version.

Add the ability to create a new database starting at an arbitrary schema version.

Also create a function that will take a schema path and schema version as input, and create two in-memory databases -- one that starts at version 1 and migrates to the desired version, and another that starts at the desired version. It will then compare the values and structures of each database to ensure that they are identical.

Change History

Changed 21 months ago by mscott

  • owner set to mscott
  • priority changed from normal to high
  • status changed from new to assigned

Changed 21 months ago by mscott

  • type changed from discussion to implementation

r3125 is a partial merge of this branch to trunk, reviewed by pobrien

The only unimplemented feature of this ticket is the database comparator. Per discussion in IRC, the comparator will perform a comparison between databases that determines if they are functionally the same. That is, certain underlying implementation details will be ignored, such as entity OIDs and revisions, and the fact that iterating over an extent returns entities in OID order.

The implementation of the comparator will be a little more complicated because of this, but will enforce cleaner design of database evolution, and free the developer from having to do odd tricks with evolution simply to satisfy the comparator.

Changed 21 months ago by mscott

schevo.database.equivalent is coming along decently.

Todo:

  • equivalence tests for all field types
  • non-equivalence tests for all field types
  • tests that include UNASSIGNED values
  • super-easy way to include a test case in your app that will take a schema package location and a maximum version, and have it compare evolving with starting at a particular version; for instance if there are 4 schema versions, it would test 1..2 against 2, 2..3 against 3, then 3..4 against 4.
  • command-line tool, "schevo db compare DBFILE1 DBFILE2" that will tell you if the two databases are functionally equivalent

Changed 20 months ago by mscott

"schevo db inject" needs to open the database just enough to figure out what version it has, in order to read the correct schema from disk.

Changed 20 months ago by mscott

"schevo db inject" fixed.

Changed 20 months ago by mscott

"schevo db compare" is in at r3151

Changed 20 months ago by mscott

super-easy test case is in at r3153

Changed 20 months ago by mscott

Equivalence tests for all field types is in a previous rev, as are tests that include UNASSIGNED.

After getting non-equivalence tests done, this will be ready for final review/merge/close.

Changed 20 months ago by mscott

Ready for review and merge!

Changed 20 months ago by mscott

  • type changed from implementation to review

Changed 20 months ago by mscott

Docs about 'schevo' tool, including changes made in this branch, at r3172

Changed 20 months ago by mscott

  • status changed from assigned to closed
  • resolution set to fixed

Reviewed by pobrien, merged at r3191

Note: See TracTickets for help on using tickets.