tree: 7cb8c1b767d48e8e6fe1f2110103c85079fd0cc6 [path history] [tgz]
  1. BUILD.bazel
  3. cdb.sql
  4. cockroachdb/
  5. test.sql

SQL Migrations

Pref can use SQL backends to store both trace data and other data like shortcuts and alerts. We need to have a system in place that allows changing the schema of the database and also upgrading an existing database to the schema that the version of Perf expects. To do that we use the library.

Each directory below here represents a supported SQL dialect. Note that the directory names should match the values of sql.Dialect. Each directory contains a series of SQL files that migrate the database schema from one version to the next. The version number is the 0-padded prefix of each file. Also note that there is both an .up. and .down. version of each migration, so we can smoothly migrate in both directions. There are also tests that ensure that the migrations work in both directions.