Commit Graph

4 Commits

Author SHA1 Message Date
Cody Cutrer d93722cffe RuboCop: Layout db
Change-Id: Ief74cf9f6aae31e77f7262d83e2541d7ee706e4c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274071
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 16:01:55 +00:00
Simon Williams a9be0af4ce handle attempting to create duplicate auditor partitions
closes #1853
closes #1857

When creating auditor partitions, we first call
"create_initial_partitionns" and then we explicitly create the last 12
months worth of partitions. If there is no existing data in the
database, creating initial partitions does nothing, but if there is, it
may create some of the previous 12 months worth of tables. So we need to
only create those if they don't already exist.

test plan:
- In a state where you only have the base auditor tables, with data in
  them, run this migration.
- It should work

Change-Id: I374c4d2ec4736b1e9640543369aa03994a1c6ac8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265579
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2021-05-24 15:07:32 +00:00
Cody Cutrer 809904d8b6 add frozen_string_literal comment to migrations
Change-Id: Idf4ddb29567c1dfab9f01b09c7a1056367ae7b44
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261814
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2021-03-30 18:14:36 +00:00
Ethan Vizitei 95aca3787c auditor models and migrations
refs CNVS-48876
flag = none

The only goal for this PS is to get the
tables and models in place to handle auditors
data being written to PG instead of cassanrda.

No actual new writing happens in this change.

create the first couple partitions as a migration
and the previous 12 to have room for backfilling

include partitions migrations for keeping indices
on individual partitions

cron-ify partitioner to keep pre-creating
new partitions for auditor tables

TEST PLAN:
  * migrate the database
  * do things that trigger auditor writes
    - login
    - change grades
    - publish courses
  * nothing should have changed or broken
  * auditors tables should be completely empty in PG
  * create the first few partitions as a migration

Change-Id: If4e2446a82fb1c91e992a28e62918ff8d8a8c73a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234064
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-04-16 20:02:49 +00:00