Stores period_start as text by default, but it has to be date time field so that it will be used as expected.
But to avoid the hiccups like previous couch2pg run, we should ensure that for any supported cht version, doc->>{'meta','time'} can always be converted to valid date time.
Why we need this change?
We are now seeing that some partners have more than 10 million feedback docs. We'll want to filter those date by date time for analytical purpose and probably create index to optimize the query. But, with current view structure, it is not possible to do so.
The following line:
https://github.com/medic/cht-couch2pg/blob/3e38727075c0132fad3f3e41c4a4461b202519de/libs/medic-users-meta/migrations/202102191153.do.54-create-couchdb-users-meta-table.sql#L10
Stores period_start as text by default, but it has to be date time field so that it will be used as expected.
But to avoid the hiccups like previous couch2pg run, we should ensure that for any supported cht version,
doc->>{'meta','time'}
can always be converted to valid date time.Why we need this change? We are now seeing that some partners have more than 10 million feedback docs. We'll want to filter those date by date time for analytical purpose and probably create index to optimize the query. But, with current view structure, it is not possible to do so.