Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Aug 01, 2024
  2. Jul 08, 2024
  3. Jan 09, 2024
  4. Jan 03, 2024
  5. Dec 20, 2023
  6. Nov 15, 2023
  7. Nov 08, 2023
  8. Nov 07, 2023
  9. Mar 13, 2023
  10. Feb 23, 2023
  11. Feb 21, 2023
    • dpsutton's avatar
      Custom migrations (#28175) · 30e731e3
      dpsutton authored
      
      * Custom migrations
      
      Current syntax:
      
      specify the migration with
      ```
        - changeSet:
            id: v46.00-080
            author: dpsutton
            comment: Uppercases all Card names
            changes:
              - customChange:
                  class: "metabase.db.custom_migrations.ReversibleUppercaseCards"
      ```
      
      and in the new namespace metabase.db.custom-migrations:
      
      ```clojure
      (defmigration UppercaseCards
        (db/execute! {:update :report_card
                      :set    {:name :%upper.name}}))
      
      (def-reversible-migration ReversibleUppercaseCards
        (db/execute! {:update :report_card
                      :set    {:name :%upper.name}})
        (db/execute! {:update :report_card
                      :set    {:name :%lower.name}}))
      ```
      
      * Use db provided by liquibase
      
      * edit docstring
      
      * set *warn-on-reflection* to fix lint error & rebase
      
      ---------
      
      Co-authored-by: default avatarNoah Moss <noahbmoss@gmail.com>
      Co-authored-by: default avatarNoah Moss <32746338+noahmoss@users.noreply.github.com>
      Unverified
      30e731e3
  12. Dec 29, 2022
  13. Dec 15, 2022
  14. Dec 09, 2022
    • Cam Saul's avatar
      Make Dimension unique on `field_id` and deduplicate (#27062) · 622558a1
      Cam Saul authored
      * Make Dimension unique on `field_id` and deduplicate
      
      * Fix rollback for new migrations
      
      * Don't require migration comments to contain 'added' anymore since it's part of the version ID now
      
      * Don't require 'Added <version>' in migration comments anymore
      
      * Fix SerDes test that created duplicate dimensions for one Field
      
      * Silly fix to fix MySQL 5.7
      Unverified
      622558a1
  15. Nov 28, 2022
  16. Mar 14, 2022
    • Cam Saul's avatar
      Upgrade Liquibase to latest version; remove final Java source file and need... · aaf1b601
      Cam Saul authored
      Upgrade Liquibase to latest version; remove final Java source file and need for `clojure -X:deps prep` (#20611)
      
      * Upgrade Liquibase to latest version
      
      * Try adjusting log
      
      * Fix checksums for the TWO migrations with ID = 32
      
      * FINALLY get Liquibase to use Log4j2
      
      * Set Liquibase ConsoleUIService OutputStream to null OutputStream
      
      * Manually define a package for our H2 proxy class so Java 8 works
      
      * Fix package-name determination code
      
      * Update migrations file spec
      
      * `databasechangelog` shouldn't be upper-case
      
      * Lower-case quartz table names
      
      * More MySQL fixes :wrench:
      
      * Properties for all the Quartz tables :cry:
      
      * Formatting tweaks [ci skip]
      
      * Revert a few more busted changes
      
      * Fix more busted changes
      
      * Bump Liquibase version to 4.8.0 to fix MySQL defaultValueBoolean bug
      
      * OMG I think I finally fixed MySQL
      
      * Remove Java source file and prep-deps code
      
      * Remove two more references to bin/prep.sh
      
      * Minor cleanup
      
      * Revert unneeded changes
      
      * Fix busted indentation
      
      * Don't search inside java/ anymore since it's G-O-N-E
      
      * Appease the namespace linter
      
      * Update src/metabase/db/liquibase/h2.clj
      Unverified
      aaf1b601
  17. Nov 23, 2021
  18. Nov 04, 2021
    • Jeff Evans's avatar
      Change all active TEXT columns in MySQL app DB to LONGTEXT (#18749) · b4610877
      Jeff Evans authored
      
      * Change all active TEXT columns in MySQL app DB to LONGTEXT
      
      Add new text.type Liquibase property to dynamically select the correct text type to use, per DB (which is LONGTEXT for MySQL), very similar to the existing blob.type one
      
      Adding new migrations that update all existing app DB TEXT columns to LONGTEXT columns, only for mariadb/mysql
      
      Update migrations linter to ensure no new text types get added, via a new predicate that searches for text types being added
      
      Do the same logic for "blob" now (should be "${blob.type}"), update rule and test
      
      Add test for migrations, that checks the new types, for all types in scope for this PR, to ensure that they have all been changed to their expected DB-specific type (either LONGTEXT for MySQL or TEXT/CLOB for others)
      
      Updating a couple migrations to remove special casing that was originally done only for MySQL to simply make them universally "${text.type}", in order to unify behavior and reduce surprises going forward
      
      Co-authored-by: default avatarCam Saul <github@camsaul.com>
      Unverified
      b4610877
  19. Nov 03, 2021
    • Cam Saul's avatar
      Add index to ModerationReview moderated_item_type + moderated_item_id (#18799) · 7d614623
      Cam Saul authored
      * Revert changes from Jeff's PR
      
      * Add index to ModerationReview moderated_item_type + moderated_item_id
      
      * Add to 0.41.2 instead
      
      * Require explicit index name for createIndex
      
      * Move 41.2 migrations to after the 41.0 migrations
      
      * Adopt new migration numbering scheme
      
      * Fix comments
      
      * Fix MySQL + MariaDB insanity
      
      * Fix ID range validation
      
      * Actually 382 is the last legacy ID
      
      * Improved validation and tests
      
      * Adopt the new-new migration ID format.
      
      * Test fixes :wrench:
      Unverified
      7d614623
    • Cam Saul's avatar
      Adopt new migration numbering scheme (#18821) · 2fee04b7
      Cam Saul authored
      * Adopt new migration numbering scheme
      
      * Fix comments
      
      * Fix MySQL + MariaDB insanity
      
      * Fix ID range validation
      
      * Actually 382 is the last legacy ID
      
      * Improved validation and tests
      
      * Adopt the new-new migration ID format.
      
      * Test fixes :wrench:
      Unverified
      2fee04b7
  20. Oct 19, 2021
    • Dennis Schridde's avatar
      Fix precondition of change set 97 (#16095) · 2d88ae48
      Dennis Schridde authored
      * Fix precondition of change set 97
      
      Without the `type` and with the space Liquibase is unable to parse this
      precondition.
      
      During `lein test` it outputs:
      ```
      [clojure-agent-send-off-pool-0] DEBUG liquibase.changelog - Running Changeset:migrations/000_migrations.yaml::97::senior
      [clojure-agent-send-off-pool-0] DEBUG liquibase.executor - Changeset migrations/000_migrations.yaml::97::senior
      [clojure-agent-send-off-pool-0] DEBUG liquibase.executor - Added 0.32.0
      [clojure-agent-send-off-pool-0] INFO  liquibase.changelog - Marking ChangeSet: migrations/000_migrations.yaml::97::senior ran despite precondition failure due to onFail='MARK_RAN':
                liquibase.yaml : DBMS Precondition failed: expected null, got h2
      
      [clojure-agent-send-off-pool-0] DEBUG liquibase.changelog - Skipping ChangeSet: migrations/000_migrations.yaml::97::senior
      [clojure-agent-send-off-pool-0] DEBUG liquibase.executor - Executing with the 'jdbc' executor
      [clojure-agent-send-off-pool-0] DEBUG liquibase.executor - 1 row(s) affected
      ```
      
      After this change the output changes to:
      ```
      [clojure-agent-send-off-pool-0] DEBUG liquibase.changelog - Running Changeset:migrations/000_migrations.yaml::97::senior
      [clojure-agent-send-off-pool-0] DEBUG liquibase.executor - Changeset migrations/000_migrations.yaml::97::senior
      [clojure-agent-send-off-pool-0] DEBUG liquibase.executor - Added 0.32.0
      [clojure-agent-send-off-pool-0] INFO  liquibase.changelog - Marking ChangeSet: migrations/000_migrations.yaml::97::senior ran despite precondition failure due to onFail='MARK_RAN':
                liquibase.yaml : DBMS Precondition failed: expected mysql,mariadb, got h2
      
      [clojure-agent-send-off-pool-0] DEBUG liquibase.changelog - Skipping ChangeSet: migrations/000_migrations.yaml::97::senior
      [clojure-agent-send-off-pool-0] DEBUG liquibase.executor - Executing with the 'jdbc' executor
      [clojure-agent-send-off-pool-0] DEBUG liquibase.executor - 1 row(s) affected
      ```
      
      For documentation of the syntax cf.
       https://docs.liquibase.com/concepts/advanced/preconditions.html
      
      
      
      * Extend migration linter to check dbms preconditions
      
      * Also validate the `type` field of the `dbms` precondition
      
      Co-authored-by: default avatardpsutton <dan@dpsutton.com>
      Unverified
      2d88ae48
  21. Aug 05, 2021
  22. Feb 25, 2021
    • Cam Saul's avatar
      Optimize relative datetime filters (#14835) · 538e5e38
      Cam Saul authored
      1. Rename optimize-datetime-filters middleware -> optimize-temporal-filters (it's more accurate, because this also
      optimizes date or time filter clauses)
      
      2. optimize-temporal-filters middleware now optimizes relative-datetime clauses (which represent a moment in time
      relative to when the query is ran, e.g. "last month") in addition to absolute-datetime clauses (which represent an
      absolute moment in time, e.g. 2021-02-15T14:40:00-08:00) . This middleware rewrites queries so we filter against
      specific temporal ranges without casting the column itself, meaning we can leverage indexes on that column. See #11837
      for more details
      
      3. Added new validate-temporal-bucketing middleware that throws an Exception if you try to do something that makes no
      sense, e.g. bucket a DATE field by :time or a TIME field by :month. This is a better situation then running the query
      and waiting for the DB to complain. (In practice, I don't think the FE client would let you generate a query like this
      in the first place)
      
      4. Fix random test failures for MySQL in task-history-cleanup-test
      Unverified
      538e5e38
  23. Jan 08, 2021
  24. Dec 16, 2020
    • Cam Saul's avatar
      CI: Check Liquibase 000_migrations.yaml against core.spec (#14097) · 6d9a7355
      Cam Saul authored
      * add step to validate Liquibase migrations to CI
      
      * addColumn should only allow one column.
      
      * Only allow one column added per addColumn change
      
      * Add strict-mode for change sets
      
      * Check that migrations are in order/IDs are unique
      
      * Fix CI
      
      * Tests for the linter!!
      
      * Require remarks when adding new Tables
      
      * Fix CI
      Unverified
      6d9a7355
Loading