diff --git a/resources/migrations/000_migrations.yaml b/resources/migrations/000_migrations.yaml index f23f5140e35f3d9c6219781ea37b761698e4206c..effa4ca930fb483a2f83f53a89ef5d4132c86f7b 100644 --- a/resources/migrations/000_migrations.yaml +++ b/resources/migrations/000_migrations.yaml @@ -3717,6 +3717,18 @@ databaseChangeLog: initiallyDeferred: false nullable: true references: metabase_field(id) + - column: + name: created_at + type: DATETIME + remarks: 'The timestamp of when the dimension was created.' + constraints: + nullable: false + - column: + name: updated_at + type: DATETIME + remarks: 'The timestamp of when these dimension was last updated.' + constraints: + nullable: false - addUniqueConstraint: tableName: dimensions columnNames: field_id, name diff --git a/src/metabase/models/dimensions.clj b/src/metabase/models/dimensions.clj index c51046defe7424b8456f653b2ab88fc76deb09c0..d084da7bbe601700152b12853bdb899b04996622 100644 --- a/src/metabase/models/dimensions.clj +++ b/src/metabase/models/dimensions.clj @@ -12,4 +12,5 @@ (u/strict-extend (class Dimensions) models/IModel (merge models/IModelDefaults - {:types (constantly {:type :keyword})})) + {:types (constantly {:type :keyword}) + :properties (constantly {:timestamped? true})})) diff --git a/test/metabase/api/table_test.clj b/test/metabase/api/table_test.clj index c5476ce042c56a790311f493594ac674227f00ad..0f1356135a0225e8a160e4028b9fff7c649ba8ae 100644 --- a/test/metabase/api/table_test.clj +++ b/test/metabase/api/table_test.clj @@ -545,7 +545,7 @@ (select-keys [:id :table_id :name :values :dimensions]) (update :dimensions (fn [dim] (if (map? dim) - (dissoc dim :id) + (dissoc dim :id :created_at :updated_at) dim)))))) ;; ## GET /api/table/:id/query_metadata