Skip to content

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

Fix uploads not being immediately editable (#62795)

Chris Truter00a034905b03
diff --git a/src/metabase/upload/impl.clj b/src/metabase/upload/impl.clj
index b08f27af12a..ddd2e4c1c8f 100644
--- a/src/metabase/upload/impl.clj
+++ b/src/metabase/upload/impl.clj
@@ -539,7 +539,7 @@
table (sync/create-table! db {:name table-name
:schema (not-empty schema)
:display_name display-name})
- _set_is_upload (t2/update! :model/Table (:id table) {:is_upload true, :data_authority :authoritative})
+ _set_is_upload (t2/update! :model/Table (:id table) {:is_upload true, :data_authority :authoritative, :is_writable true})
_sync (scan-and-sync-table! db table)
_set_names (set-display-names! (:id table) columns)
;; Set the display_name of the auto-generated primary key column to the same as its name, so that if users
diff --git a/test/metabase/upload/impl_test.clj b/test/metabase/upload/impl_test.clj
index 38a2b1f6d5e..0190ee7d81a 100644
--- a/test/metabase/upload/impl_test.clj
+++ b/test/metabase/upload/impl_test.clj
@@ -586,6 +586,8 @@
(->> (t2/select :model/Field :table_id (:id table))
(sort-by :database_position)
(map (juxt (comp u/lower-case-en :name) identity))))))
+ (testing "Check that table can be written via data-editing"
+ (true? (t2/select-one-fn :is_writable [:model/Table :is_writable] (:id table))))
(testing "Check the data was uploaded into the table"
(is (= 2
(count (rows-for-table table)))))))))))