Add ORM models for the simulation data

- add new ORM models `ReplaySimulation` and `ReplayedOrder`
  to store the data generated by the routing simulations
- add migrations script to create the corresponding database tables
  + create "replay_simulations" and "replayed_orders" tables
  + add missing check constraints to "orders" table
  + add unique constraint to "orders" table to enable compound key
  + drop unnecessary check constraints from the "orders" table
- add tests for the new ORM models
  + add `simulation`, `replayed_order`, `make_replay_order()`, and
    `pre_order` fixtures
  + add `ReplayedOrderFactor` faker class
- fix some typos
This commit is contained in:
Alexander Hess 2021-09-16 11:58:55 +02:00
commit e4e543bd40
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
19 changed files with 1677 additions and 10 deletions

View file

@ -106,6 +106,7 @@ make_address = fake_data.make_address
make_courier = fake_data.make_courier
make_customer = fake_data.make_customer
make_order = fake_data.make_order
make_replay_order = fake_data.make_replay_order
make_restaurant = fake_data.make_restaurant
address = fake_data.address
@ -114,6 +115,10 @@ city_data = fake_data.city_data
courier = fake_data.courier
customer = fake_data.customer
order = fake_data.order
pre_order = fake_data.pre_order
replayed_order = fake_data.replayed_order
restaurant = fake_data.restaurant
grid = fake_data.grid
pixel = fake_data.pixel
simulation = fake_data.simulation
simulation_data = fake_data.simulation_data