Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/db/tables/featureFlags.ts uses modified_at whereas other tables use updated_at #3473

Open
pdehaan opened this issue Sep 26, 2023 · 1 comment
Labels
jira-synced Jira task created for this

Comments

@pdehaan
Copy link
Collaborator

pdehaan commented Sep 26, 2023

Pretty tiny nit, but… was randomly trying to grep for knex+.update() statements without an updated_at column, but came across something possibly odd.

git grep -P -A6 "\.update\(" | grep -Eo "\s[a-z_]+_at: knex.fn.now\(\)" | sort | uniq -c
   1  deleted_at: knex.fn.now()
   6  modified_at: knex.fn.now()
  18  updated_at: knex.fn.now()

Looks like the majority of .update() queries are using an updated_at column, it looks like featureFlags.ts might be an outlier w/ modified_at:

git grep -P -A6 "\.update\(" | grep -E "\s[a-z_]+_at: knex.fn.now\(\)" | sort | uniq -c
   1 src/db/tables/emailAddresses.js-            updated_at: knex.fn.now()
   2 src/db/tables/emailAddresses.js-      updated_at: knex.fn.now()
   1 src/db/tables/emailAddresses.js-      updated_at: knex.fn.now(),
   1 src/db/tables/featureFlags.ts-      deleted_at: knex.fn.now(),
   6 src/db/tables/featureFlags.ts-      modified_at: knex.fn.now(),
   1 src/db/tables/onerep_scans.ts-      updated_at: knex.fn.now(),
   2 src/db/tables/onerep_scans.ts-    updated_at: knex.fn.now(),
   2 src/db/tables/subscribers.js-        updated_at: knex.fn.now(),
   9 src/db/tables/subscribers.js-      updated_at: knex.fn.now(),

Conversely, we can grep by knex.fn.now():

git grep -Po "\b[a-z_]+: knex.fn.now\(\)" src/db/tables | grep -v "ts-ignore" | sort | uniq -c
   4 src/db/tables/emailAddresses.js:updated_at: knex.fn.now()
   1 src/db/tables/featureFlags.ts:deleted_at: knex.fn.now()
   6 src/db/tables/featureFlags.ts:modified_at: knex.fn.now()
   1 src/db/tables/onerep_profiles.ts:created_at: knex.fn.now()
   2 src/db/tables/onerep_scans.ts:created_at: knex.fn.now()
   3 src/db/tables/onerep_scans.ts:updated_at: knex.fn.now()
  12 src/db/tables/subscribers.js:updated_at: knex.fn.now()
@EMMLynch EMMLynch added the jira-synced Jira task created for this label Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira-synced Jira task created for this
Projects
None yet
Development

No branches or pull requests

3 participants
@pdehaan @EMMLynch and others