SQL - Use models metadata to create an empty database for tests
Currently we use migrations to create a database for each test. Such approach has many issues related to our current migrations engine. Most of them are related to the fact that sqlite doesn't support some of the features of migrations engine (ALTER TABLE, etc.)
Instead of using migrations we could create an empty database using models metadata. This will allow us to fix issues mentioned above + improve performance of sql tests.
To use metadata for creating an empty DB we need to be sure that models and migrations will create the same database structure in result.
We need to implement a test that will compare DB structure for migrations and models and fix any discrepancies found. We consider that migrations provide the correct state (since it's how it's used in production).
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- Alexei Kornienko
- Direction:
- Needs approval
- Assignee:
- Alexei Kornienko
- Definition:
- Obsolete
- Series goal:
- None
- Implementation:
-
Unknown
- Milestone target:
- None
- Started by
- Completed by
- gordon chung
Related branches
Related bugs
Sprints
Whiteboard
marking obsolete as original author has moved on to other things and there's a lot of ambiguity to the scope of task -- gordc (14.7.15)
Work Items
Dependency tree

* Blueprints in grey have been implemented.