Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

4.5 KB
Raw Blame
## Create and configure custom_viz_plugin table for custom visualization plugins

databaseChangeLog:
  - logicalFilePath: migrations/062_update_migrations.yaml
  - changeSet:
      id: v62.2026-04-09T10:00:00
      author: sgavrylov
      comment: Create custom_viz_plugin table for custom visualization plugins
      preConditions:
        - onFail: MARK_RAN
        - not:
            - tableExists:
                tableName: custom_viz_plugin
      changes:
        - createTable:
            tableName: custom_viz_plugin
            remarks: Stores registered custom visualization plugins uploaded as zip bundles
            columns:
              - column:
                  name: id
                  type: int
                  autoIncrement: true
                  constraints:
                    primaryKey: true
                    nullable: false
              - column:
                  name: identifier
                  type: varchar(254)
                  remarks: Unique identifier used as visualization display type. Comes from the manifest "name" field.
                  constraints:
                    nullable: false
                    unique: true
              - column:
                  name: display_name
                  type: varchar(254)
                  remarks: Human-readable name from the plugin manifest
                  constraints:
                    nullable: false
              - column:
                  name: status
                  type: varchar(32)
                  remarks: Plugin status - active or error
                  constraints:
                    nullable: false
              - column:
                  name: error_message
                  type: ${text.type}
                  remarks: Last error message if status is error
                  constraints:
                    nullable: true
              - column:
                  name: bundle
                  type: ${blob.type}
                  remarks: Raw bytes of the uploaded zip bundle. Null for dev-only plugins served from a dev server.
                  constraints:
                    nullable: true
              - column:
                  name: bundle_hash
                  type: varchar(64)
                  remarks: SHA-256 hex of the uploaded bundle, used as the on-disk cache key and HTTP ETag. Null for dev-only plugins.
                  constraints:
                    nullable: true
              - column:
                  name: created_at
                  type: ${timestamp_type}
                  remarks: Timestamp when the plugin was registered
                  constraints:
                    nullable: false
              - column:
                  name: updated_at
                  type: ${timestamp_type}
                  remarks: Timestamp when the plugin was last updated
                  constraints:
                    nullable: false
              - column:
                  name: enabled
                  type: ${boolean.type}
                  defaultValueBoolean: true
                  remarks: Whether the plugin is enabled for use in dashboards and questions
                  constraints:
                    nullable: false
              - column:
                  name: icon
                  type: varchar(254)
                  remarks: Icon from plugin manifest - asset path resolved to a URL
                  constraints:
                    nullable: true
              - column:
                  name: manifest
                  type: ${text.type}
                  remarks: JSON manifest from metabase-plugin.json in the uploaded bundle
              - column:
                  name: metabase_version
                  type: varchar(254)
                  remarks: Metabase version range requirement from manifest (e.g. ">=1.59 <1.62")
              - column:
                  name: dev_bundle_url
                  type: varchar(1024)
                  remarks: Dev server URL for hot-reload development (e.g. http://localhost:5174)

  - changeSet:
      id: v62.2026-04-24T10:00:01
      author: bronsa
      comment: Use longblob for custom_viz_plugin.bundle on MySQL/MariaDB so it can hold multi-MB zip uploads
      changes:
        - modifyDataType:
            tableName: custom_viz_plugin
            columnName: bundle
            newDataType: longblob
      rollback:
        - modifyDataType:
            tableName: custom_viz_plugin
            columnName: bundle
            newDataType: ${blob.type}
      preConditions:
        - onFail: MARK_RAN
        - dbms:
            type: mysql,mariadb