datacube-core icon indicating copy to clipboard operation
datacube-core copied to clipboard

This is going to log every time they run `init`, even if they already have applied this update.

Open whatnick opened this issue 4 years ago • 2 comments

This is going to log every time they run init, even if they already have applied this update.

By convention, I usually wrapped them in a check previously:

if not pg_column_exists(engine, schema_qualified('dataset'), 'updated'):
    _LOG.info("Adding Update Triggers")
    with engine.connect() as c:
        c.execute('begin')
        install_timestamp_trigger(c)
        .... etc

(of course, no need to check other columns exist as they're all applied together in one transaction.)

The actual SQL looks idempotent so this is all an extremely minor gripe.

Originally posted by @jeremyh in https://github.com/opendatacube/datacube-core/pull/951

whatnick avatar May 25 '20 03:05 whatnick

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 22 '20 04:09 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 12 '21 03:03 stale[bot]

This has been resolved with the new PostGIS database driver, and is a wontfix for the old PostgreSQL driver.

omad avatar May 23 '23 01:05 omad