Skip to content
Snippets Groups Projects
Unverified Commit d3837c21 authored by dpsutton's avatar dpsutton Committed by GitHub
Browse files

Make `parameter_card.parameter_id` long enough for a uuid (#27770)

* Make `parameter_card.parameter_id` long enough for a uuid

was char(32). This is a common type for identifiers in our migrations
file, but unfortunately not great for ids.

```clojure
user=> (count (str (random-uuid)))
36
```

It seems like dashboards use shorter ids but cards use uuids.

* make it varying

from a test failure:

```
expected: [{:card_id 813,
            :parameter_id "_CATEGORY_NAME_",
            :parameterized_object_id 815,
            :parameterized_object_type :card}]
  actual: [#metabase.models.parameter_card.ParameterCardInstance
           {:card_id 813,
            :created_at #<java.time.OffsetDateTime@702e9037 2023-01-19T15:09:39.355894Z>,
            :id 36,
            :parameter_id "_CATEGORY_NAME_                     ",
            :parameterized_object_id 815,
            :parameterized_object_type :card,
            :updated_at #<java.time.OffsetDateTime@5db7ac60 2023-01-19T15:09:39.355894Z>}]
```

"_CATEGORY_NAME_" vs "_CATEGORY_NAME_                     "
parent e9a744b7
No related branches found
No related tags found
No related merge requests found
...@@ -13933,6 +13933,17 @@ databaseChangeLog: ...@@ -13933,6 +13933,17 @@ databaseChangeLog:
name: context name: context
indexName: idx_query_execution_context indexName: idx_query_execution_context
- changeSet:
id: v46.00-057
author: dpsutton
comment: Added 0.46.0 -- parameter_card.parameter_id long enough to hold a uuid
changes:
- modifyDataType:
tableName: parameter_card
columnName: parameter_id
newDataType: varchar(36)
rollback: #nothing to do, char(32) or char(36) are equivalent
# >>>>>>>>>> DO NOT ADD NEW MIGRATIONS BELOW THIS LINE! ADD THEM ABOVE <<<<<<<<<< # >>>>>>>>>> DO NOT ADD NEW MIGRATIONS BELOW THIS LINE! ADD THEM ABOVE <<<<<<<<<<
######################################################################################################################## ########################################################################################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment