Skip to content
Snippets Groups Projects
Commit 65c89bc8 authored by Atte Keinänen's avatar Atte Keinänen
Browse files

Revert "Remove async fuckup" (because async stuff leaked to master too early)

This reverts commit 7db972e4.
parent b9290916
Branches
Tags
No related merge requests found
......@@ -3843,3 +3843,87 @@ databaseChangeLog:
sql: drop table if exists computation_job_result cascade
- sql:
sql: drop table if exists computation_job cascade
# NOTE Atte Keinänen 9/28/17: This was originally in changeset 65 as explained above
- changeSet:
id: 67
author: attekei
changes:
- createTable:
tableName: computation_job
remarks: 'Stores submitted async computation jobs.'
columns:
- column:
name: id
type: int
autoIncrement: true
constraints:
primaryKey: true
nullable: false
- column:
constraints:
deferrable: false
foreignKeyName: fk_computation_job_ref_user_id
initiallyDeferred: false
references: core_user(id)
name: creator_id
type: int
- column:
name: created_at
type: DATETIME
constraints:
nullable: false
- column:
name: updated_at
type: DATETIME
constraints:
nullable: false
- column:
name: type
type: varchar(254)
constraints:
nullable: false
- column:
name: status
type: varchar(254)
constraints:
nullable: false
- createTable:
tableName: computation_job_result
remarks: 'Stores results of async computation jobs.'
columns:
- column:
name: id
type: int
autoIncrement: true
constraints:
primaryKey: true
nullable: false
- column:
constraints:
deferrable: false
foreignKeyName: fk_computation_result_ref_job_id
initiallyDeferred: false
nullable: false
references: computation_job(id)
name: job_id
type: int
- column:
name: created_at
type: DATETIME
constraints:
nullable: false
- column:
name: updated_at
type: DATETIME
constraints:
nullable: false
- column:
name: permanence
type: varchar(254)
constraints:
nullable: false
- column:
name: payload
type: text
constraints:
nullable: false
......@@ -29,6 +29,8 @@
[card-label :refer [CardLabel]]
[collection :refer [Collection]]
[collection-revision :refer [CollectionRevision]]
[computation-job :refer [ComputationJob]]
[computation-job-result :refer [ComputationJobResult]]
[dashboard :refer [Dashboard]]
[dashboard-card :refer [DashboardCard]]
[dashboard-card-series :refer [DashboardCardSeries]]
......@@ -98,6 +100,8 @@
CollectionRevision
DashboardFavorite
Dimension
ComputationJob
ComputationJobResult
;; migrate the list of finished DataMigrations as the very last thing (all models to copy over should be listed above this line)
DataMigrations])
......
(ns metabase.models.computation-job
(:require [metabase.api.common :as api]
[metabase.models.interface :as i]
[metabase.util :as u]
[toucan.models :as models]))
(models/defmodel ComputationJob :computation_job)
(defn- creator?
[{:keys [creator_id]}]
(= creator_id api/*current-user-id*))
(u/strict-extend (class ComputationJob)
models/IModel
(merge models/IModelDefaults
{:types (constantly {:status :keyword
:type :keyword})
:properties (constantly {:timestamped? true})})
i/IObjectPermissions
(merge i/IObjectPermissionsDefaults
{:can-read? creator?
:can-write? creator?}))
(ns metabase.models.computation-job-result
(:require [metabase.models.interface :as i]
[metabase.util :as u]
[toucan.models :as models]))
(models/defmodel ComputationJobResult :computation_job_result)
(u/strict-extend (class ComputationJobResult)
models/IModel
(merge models/IModelDefaults
{:types (constantly {:permanence :keyword
:payload :json})
:properties (constantly {:timestamped? true})}))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment