Skip to content
Snippets Groups Projects
Commit baba8af0 authored by Tom Robinson's avatar Tom Robinson
Browse files

Add Table 'visibility_type' field

parent f97ce66f
Branches
Tags
No related merge requests found
{
"databaseChangeLog": [
{
"changeSet": {
"id": "9",
"author": "tlrobinson",
"changes": [
{
"addColumn": {
"tableName": "metabase_table",
"columns": [
{
"column": {
"name": "visibility_type",
"type": "varchar(254)"
}
}
]
}
}
]
}
}
]
}
......@@ -6,6 +6,7 @@
{"include": {"file": "migrations/005_add_org_report_tz_column.json"}},
{"include": {"file": "migrations/006_disconnect_orgs.json"}},
{"include": {"file": "migrations/007_add_field_parent_id.json"}},
{"include": {"file": "migrations/008_add_display_name_columns.json"}}
{"include": {"file": "migrations/008_add_display_name_columns.json"}},
{"include": {"file": "migrations/009_add_table_visibility_type_column.json"}}
]
}
......@@ -16,6 +16,11 @@
[symb value :nillable]
(checkp-contains? table/entity-types symb (keyword value)))
(defannotation TableVisibilityType
"Param must be one of `hidden`, `technical`, or `cruft`."
[symb value :nillable]
(checkp-contains? table/visibility-types symb (keyword value)))
(defendpoint GET "/"
"Get all `Tables`."
[]
......@@ -36,14 +41,16 @@
(defendpoint PUT "/:id"
"Update `Table` with ID."
[id :as {{:keys [display_name entity_type description]} :body}]
{display_name NonEmptyString,
entity_type TableEntityType}
[id :as {{:keys [display_name entity_type visibility_type description]} :body}]
{display_name NonEmptyString,
entity_type TableEntityType,
visibility_type TableVisibilityType}
(write-check Table id)
(check-500 (upd-non-nil-keys Table id
:display_name display_name
:entity_type entity_type
:description description))
:display_name display_name
:entity_type entity_type
:visibility_type visibility_type
:description description))
(Table id))
(defendpoint GET "/:id/fields"
......
......@@ -12,6 +12,10 @@
"Valid values for `Table.entity_type` (field may also be `nil`)."
#{:person :event :photo :place})
(def ^:const visibility-types
"Valid values for `Table.visibility_type` (field may also be `nil`)."
#{:hidden :technical :cruft})
(defrecord TableInstance []
clojure.lang.IFn
(invoke [this k]
......@@ -23,6 +27,7 @@
[(table :metabase_table)
(hydration-keys table)
(types :entity_type :keyword)
(types :visibility_type :keyword)
timestamped]
(post-select [_ {:keys [id db db_id description] :as table}]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment