alphagov / trade-tariff-backend

Enabling the population and distribution via API of UK Customs tariffs and duties
MIT License
7 stars 6 forks source link

Expose metadata about applied Taric/Chief updates. #72

Closed saulius closed 11 years ago

saulius commented 11 years ago

This change is for https://www.pivotaltracker.com/story/show/44373841.

Exposes latest applied update info.

jabley commented 11 years ago

Am I missing a schema migration here?

Started GET "/updates" for 127.0.0.1 at 2013-02-13 16:44:13 +0000
16:44:13 tradetariffapi.1                        | Processing by Api::V1::UpdatesController#index as JSON
16:44:13 tradetariffapi.1                        | Mysql2::Error: Table 'tariff_development.base_updates' doesn't exist: DESCRIBE `base_updates`
16:44:13 tradetariffapi.1                        | Mysql2::Error: Table 'tariff_development.base_updates' doesn't exist: SELECT * FROM `base_updates` LIMIT 1
16:44:13 tradetariffapi.1                        | (0.000609s) DESCRIBE `tariff_updates`
16:44:13 tradetariffapi.1                        | (0.000555s) SELECT * FROM (SELECT * FROM `tariff_updates` ORDER BY `issue_date` DESC) AS `t1` WHERE (`state` = 'A') GROUP BY `update_type` LIMIT 1
16:44:13 tradetariffapi.1                        | (0.000287s) SELECT * FROM (SELECT * FROM `tariff_updates` ORDER BY `issue_date` DESC) AS `t1` WHERE (`state` = 'A') GROUP BY `update_type`
16:44:13 tradetariffapi.1                        |   Rendered api/v1/updates/index.json.rabl (2.0ms)
saulius commented 11 years ago

This is Sequel trying to guess table name. Made it explicit in the commit above. Will rename BaseUpdate to TariffUpdate after I finish the db/oplog story.