From c734cfb8d16b1a4a20e3fb03b3afdf052fa53fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Fri, 6 Aug 2021 14:10:24 +0200 Subject: [PATCH] Adding support for patch blocks (#877) * Adding support for patch blocks * Adding some improvements * Adding api integration test for patch * Adding SQL store tests * Regenerating autogenerated code * Fix linter errors * Remove wrong update of the swagger file * Update server/model/block.go Co-authored-by: Miguel de la Cruz * Fix gofmt Co-authored-by: Miguel de la Cruz --- server/api/api.go | 78 ++ server/app/blocks.go | 15 + server/client/client.go | 14 + server/go.tools.mod | 2 +- server/go.tools.sum | 18 + server/integrationtests/blocks_test.go | 97 ++ server/model/block.go | 65 + server/services/metrics/metrics.go | 17 + server/services/store/mockstore/mockstore.go | 288 +++-- server/services/store/sqlstore/blocks.go | 22 + .../store/sqlstore/initializations/bindata.go | 95 +- .../store/sqlstore/migrations/bindata.go | 698 ++++++++--- server/services/store/store.go | 3 +- server/services/store/storetests/blocks.go | 125 ++ .../docs/html/.openapi-generator/VERSION | 2 +- server/swagger/docs/html/index.html | 1102 ++++++++++++----- server/swagger/swagger.yml | 74 ++ webapp/src/blocks/block.ts | 12 +- .../src/components/cardDetail/cardDetail.tsx | 2 +- webapp/src/components/content/textElement.tsx | 2 +- webapp/src/components/table/tableRow.tsx | 2 +- .../src/components/viewHeader/viewHeader.tsx | 2 +- webapp/src/components/viewTitle.tsx | 4 +- webapp/src/mutator.ts | 17 +- webapp/src/octoClient.ts | 12 +- 25 files changed, 2148 insertions(+), 620 deletions(-) diff --git a/server/api/api.go b/server/api/api.go index aa4a6e3b6..7b338ba8c 100644 --- a/server/api/api.go +++ b/server/api/api.go @@ -67,6 +67,7 @@ func (a *API) RegisterRoutes(r *mux.Router) { apiv1.HandleFunc("/workspaces/{workspaceID}/blocks", a.sessionRequired(a.handleGetBlocks)).Methods("GET") apiv1.HandleFunc("/workspaces/{workspaceID}/blocks", a.sessionRequired(a.handlePostBlocks)).Methods("POST") apiv1.HandleFunc("/workspaces/{workspaceID}/blocks/{blockID}", a.sessionRequired(a.handleDeleteBlock)).Methods("DELETE") + apiv1.HandleFunc("/workspaces/{workspaceID}/blocks/{blockID}", a.sessionRequired(a.handlePatchBlock)).Methods("PATCH") apiv1.HandleFunc("/workspaces/{workspaceID}/blocks/{blockID}/subtree", a.attachSession(a.handleGetSubTree, false)).Methods("GET") apiv1.HandleFunc("/workspaces/{workspaceID}/blocks/export", a.sessionRequired(a.handleExport)).Methods("GET") @@ -549,6 +550,83 @@ func (a *API) handleDeleteBlock(w http.ResponseWriter, r *http.Request) { auditRec.Success() } +func (a *API) handlePatchBlock(w http.ResponseWriter, r *http.Request) { + // swagger:operation PATCH /api/v1/workspaces/{workspaceID}/blocks/{blockID} patchBlock + // + // Partially updates a block + // + // --- + // produces: + // - application/json + // parameters: + // - name: workspaceID + // in: path + // description: Workspace ID + // required: true + // type: string + // - name: blockID + // in: path + // description: ID of block to patch + // required: true + // type: string + // - name: Body + // in: body + // description: block patch to apply + // required: true + // schema: + // "$ref": "#/definitions/BlockPatch" + // security: + // - BearerAuth: [] + // responses: + // '200': + // description: success + // default: + // description: internal error + // schema: + // "$ref": "#/definitions/ErrorResponse" + + ctx := r.Context() + session := ctx.Value(sessionContextKey).(*model.Session) + userID := session.UserID + + vars := mux.Vars(r) + blockID := vars["blockID"] + + container, err := a.getContainer(r) + if err != nil { + a.noContainerErrorResponse(w, r.URL.Path, err) + return + } + + requestBody, err := ioutil.ReadAll(r.Body) + if err != nil { + a.errorResponse(w, r.URL.Path, http.StatusInternalServerError, "", err) + return + } + + var patch *model.BlockPatch + err = json.Unmarshal(requestBody, &patch) + if err != nil { + a.errorResponse(w, r.URL.Path, http.StatusInternalServerError, "", err) + return + } + + auditRec := a.makeAuditRecord(r, "patchBlock", audit.Fail) + defer a.audit.LogRecord(audit.LevelModify, auditRec) + auditRec.AddMeta("blockID", blockID) + + err = a.app.PatchBlock(*container, blockID, patch, userID) + if err != nil { + a.errorResponse(w, r.URL.Path, http.StatusInternalServerError, "", err) + return + } + + a.logger.Debug("PATCH Block", mlog.String("blockID", blockID)) + jsonStringResponse(w, http.StatusOK, "{}") + + auditRec.Success() +} + func (a *API) handleGetSubTree(w http.ResponseWriter, r *http.Request) { // swagger:operation GET /api/v1/workspaces/{workspaceID}/blocks/{blockID}/subtree getSubTree // diff --git a/server/app/blocks.go b/server/app/blocks.go index 3f58f6e9b..8c94d90ca 100644 --- a/server/app/blocks.go +++ b/server/app/blocks.go @@ -29,6 +29,21 @@ func (a *App) GetParentID(c store.Container, blockID string) (string, error) { return a.store.GetParentID(c, blockID) } +func (a *App) PatchBlock(c store.Container, blockID string, blockPatch *model.BlockPatch, userID string) error { + err := a.store.PatchBlock(c, blockID, blockPatch, userID) + if err != nil { + return err + } + a.metrics.IncrementBlocksPatched(1) + block, err := a.store.GetBlock(c, blockID) + if err != nil { + return nil + } + a.wsServer.BroadcastBlockChange(c.WorkspaceID, *block) + go a.webhook.NotifyUpdate(*block) + return nil +} + func (a *App) InsertBlock(c store.Container, block model.Block, userID string) error { err := a.store.InsertBlock(c, &block, userID) if err == nil { diff --git a/server/client/client.go b/server/client/client.go index 2190caa3b..c27b20a73 100644 --- a/server/client/client.go +++ b/server/client/client.go @@ -87,6 +87,10 @@ func (c *Client) DoAPIPost(url, data string) (*http.Response, error) { return c.DoAPIRequest(http.MethodPost, c.APIURL+url, data, "") } +func (c *Client) DoAPIPatch(url, data string) (*http.Response, error) { + return c.DoAPIRequest(http.MethodPatch, c.APIURL+url, data, "") +} + func (c *Client) DoAPIPut(url, data string) (*http.Response, error) { return c.DoAPIRequest(http.MethodPut, c.APIURL+url, data, "") } @@ -154,6 +158,16 @@ func (c *Client) GetBlocks() ([]model.Block, *Response) { return model.BlocksFromJSON(r.Body), BuildResponse(r) } +func (c *Client) PatchBlock(blockID string, blockPatch *model.BlockPatch) (bool, *Response) { + r, err := c.DoAPIPatch(c.GetBlockRoute(blockID), toJSON(blockPatch)) + if err != nil { + return false, BuildErrorResponse(r, err) + } + defer closeBody(r) + + return true, BuildResponse(r) +} + func (c *Client) InsertBlocks(blocks []model.Block) (bool, *Response) { r, err := c.DoAPIPost(c.GetBlocksRoute(), toJSON(blocks)) if err != nil { diff --git a/server/go.tools.mod b/server/go.tools.mod index a07ea2bc8..6b98d9c20 100644 --- a/server/go.tools.mod +++ b/server/go.tools.mod @@ -3,6 +3,6 @@ module github.com/mattermost/focalboard/server go 1.16 require ( - github.com/golang/mock v1.5.0 + github.com/golang/mock v1.6.0 github.com/jteeuwen/go-bindata v3.0.7+incompatible // indirect ) diff --git a/server/go.tools.sum b/server/go.tools.sum index 733e7afa5..386850841 100644 --- a/server/go.tools.sum +++ b/server/go.tools.sum @@ -2,23 +2,41 @@ github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/jteeuwen/go-bindata v3.0.7+incompatible h1:91Uy4d9SYVr1kyTJ15wJsog+esAZZl7JmEfTkwmhJts= github.com/jteeuwen/go-bindata v3.0.7+incompatible/go.mod h1:JVvhzYOiGBnFSYRyV00iY8q7/0PThjIYav1p9h5dmKs= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190425150028-36563e24a262 h1:qsl9y/CJx34tuA7QCPNp86JNJe4spst6Ff8MjvPUdPg= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e h1:aZzprAO9/8oim3qStq3wc1Xuxx4QmAGriC4VU4ojemQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/server/integrationtests/blocks_test.go b/server/integrationtests/blocks_test.go index daab1d006..822aa80eb 100644 --- a/server/integrationtests/blocks_test.go +++ b/server/integrationtests/blocks_test.go @@ -148,6 +148,103 @@ func TestPostBlock(t *testing.T) { }) } +func TestPatchBlock(t *testing.T) { + th := SetupTestHelper().InitBasic() + defer th.TearDown() + + blockID := utils.CreateGUID() + + block := model.Block{ + ID: blockID, + RootID: blockID, + CreateAt: 1, + UpdateAt: 1, + Type: "board", + Title: "New title", + Fields: map[string]interface{}{"test": "test value", "test2": "test value 2"}, + } + + _, resp := th.Client.InsertBlocks([]model.Block{block}) + require.NoError(t, resp.Error) + + blocks, resp := th.Client.GetBlocks() + require.NoError(t, resp.Error) + initialCount := len(blocks) + + t.Run("Patch a block basic field", func(t *testing.T) { + newTitle := "Updated title" + blockPatch := &model.BlockPatch{ + Title: &newTitle, + } + + _, resp := th.Client.PatchBlock(blockID, blockPatch) + require.NoError(t, resp.Error) + + blocks, resp := th.Client.GetBlocks() + require.NoError(t, resp.Error) + require.Len(t, blocks, initialCount) + + var updatedBlock model.Block + for _, b := range blocks { + if b.ID == blockID { + updatedBlock = b + } + } + require.NotNil(t, updatedBlock) + require.Equal(t, "Updated title", updatedBlock.Title) + }) + + t.Run("Patch a block custom fields", func(t *testing.T) { + blockPatch := &model.BlockPatch{ + UpdatedFields: map[string]interface{}{ + "test": "new test value", + "test3": "new field", + }, + } + + _, resp := th.Client.PatchBlock(blockID, blockPatch) + require.NoError(t, resp.Error) + + blocks, resp := th.Client.GetBlocks() + require.NoError(t, resp.Error) + require.Len(t, blocks, initialCount) + + var updatedBlock model.Block + for _, b := range blocks { + if b.ID == blockID { + updatedBlock = b + } + } + require.NotNil(t, updatedBlock) + require.Equal(t, "new test value", updatedBlock.Fields["test"]) + require.Equal(t, "new field", updatedBlock.Fields["test3"]) + }) + + t.Run("Patch a block to remove custom fields", func(t *testing.T) { + blockPatch := &model.BlockPatch{ + DeletedFields: []string{"test", "test3", "test100"}, + } + + _, resp := th.Client.PatchBlock(blockID, blockPatch) + require.NoError(t, resp.Error) + + blocks, resp := th.Client.GetBlocks() + require.NoError(t, resp.Error) + require.Len(t, blocks, initialCount) + + var updatedBlock model.Block + for _, b := range blocks { + if b.ID == blockID { + updatedBlock = b + } + } + require.NotNil(t, updatedBlock) + require.Equal(t, nil, updatedBlock.Fields["test"]) + require.Equal(t, "test value 2", updatedBlock.Fields["test2"]) + require.Equal(t, nil, updatedBlock.Fields["test3"]) + }) +} + func TestDeleteBlock(t *testing.T) { th := SetupTestHelper().InitBasic() defer th.TearDown() diff --git a/server/model/block.go b/server/model/block.go index f86c4a3bb..21fafd358 100644 --- a/server/model/block.go +++ b/server/model/block.go @@ -57,6 +57,38 @@ type Block struct { DeleteAt int64 `json:"deleteAt"` } +// BlockPatch is a patch for modify blocks +// swagger:model +type BlockPatch struct { + // The id for this block's parent block. Empty for root blocks + // required: false + ParentID *string `json:"parentId"` + + // The id for this block's root block + // required: false + RootID *string `json:"rootId"` + + // The schema version of this block + // required: false + Schema *int64 `json:"schema"` + + // The block type + // required: false + Type *string `json:"type"` + + // The display title + // required: false + Title *string `json:"title"` + + // The block updated fields + // required: false + UpdatedFields map[string]interface{} `json:"updatedFields"` + + // The block removed fields + // required: false + DeletedFields []string `json:"deletedFields"` +} + // Archive is an import / export archive. type Archive struct { Version int64 `json:"version"` @@ -84,3 +116,36 @@ func (b Block) LogClone() interface{} { Type: b.Type, } } + +// Patch returns an update version of the block. +func (p *BlockPatch) Patch(block *Block) *Block { + if p.ParentID != nil { + block.ParentID = *p.ParentID + } + + if p.RootID != nil { + block.RootID = *p.RootID + } + + if p.Schema != nil { + block.Schema = *p.Schema + } + + if p.Type != nil { + block.Type = *p.Type + } + + if p.Title != nil { + block.Title = *p.Title + } + + for key, field := range p.UpdatedFields { + block.Fields[key] = field + } + + for _, key := range p.DeletedFields { + delete(block.Fields, key) + } + + return block +} diff --git a/server/services/metrics/metrics.go b/server/services/metrics/metrics.go index 99d5d04bd..1a77efaed 100644 --- a/server/services/metrics/metrics.go +++ b/server/services/metrics/metrics.go @@ -33,6 +33,7 @@ type Metrics struct { loginFailCount prometheus.Counter blocksInsertedCount prometheus.Counter + blocksPatchedCount prometheus.Counter blocksDeletedCount prometheus.Counter blockCount *prometheus.GaugeVec @@ -104,6 +105,15 @@ func NewMetrics(info InstanceInfo) *Metrics { }) m.registry.MustRegister(m.blocksInsertedCount) + m.blocksPatchedCount = prometheus.NewCounter(prometheus.CounterOpts{ + Namespace: MetricsNamespace, + Subsystem: MetricsSubsystemBlocks, + Name: "blocks_patched_total", + Help: "Total number of blocks patched.", + ConstLabels: additionalLabels, + }) + m.registry.MustRegister(m.blocksPatchedCount) + m.blocksDeletedCount = prometheus.NewCounter(prometheus.CounterOpts{ Namespace: MetricsNamespace, Subsystem: MetricsSubsystemBlocks, @@ -162,6 +172,13 @@ func (m *Metrics) IncrementBlocksInserted(num int) { } } +func (m *Metrics) IncrementBlocksPatched(num int) { + if m != nil { + m.blocksPatchedCount.Add(float64(num)) + m.blockLastActivity.SetToCurrentTime() + } +} + func (m *Metrics) IncrementBlocksDeleted(num int) { if m != nil { m.blocksDeletedCount.Add(float64(num)) diff --git a/server/services/store/mockstore/mockstore.go b/server/services/store/mockstore/mockstore.go index 0d44f9a81..ab8cc9c9c 100644 --- a/server/services/store/mockstore/mockstore.go +++ b/server/services/store/mockstore/mockstore.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: services/store/store.go +// Source: github.com/mattermost/focalboard/server/services/store (interfaces: Store) // Package mockstore is a generated GoMock package. package mockstore @@ -36,118 +36,118 @@ func (m *MockStore) EXPECT() *MockStoreMockRecorder { } // CleanUpSessions mocks base method. -func (m *MockStore) CleanUpSessions(expireTime int64) error { +func (m *MockStore) CleanUpSessions(arg0 int64) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CleanUpSessions", expireTime) + ret := m.ctrl.Call(m, "CleanUpSessions", arg0) ret0, _ := ret[0].(error) return ret0 } // CleanUpSessions indicates an expected call of CleanUpSessions. -func (mr *MockStoreMockRecorder) CleanUpSessions(expireTime interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) CleanUpSessions(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CleanUpSessions", reflect.TypeOf((*MockStore)(nil).CleanUpSessions), expireTime) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CleanUpSessions", reflect.TypeOf((*MockStore)(nil).CleanUpSessions), arg0) } // CreateSession mocks base method. -func (m *MockStore) CreateSession(session *model.Session) error { +func (m *MockStore) CreateSession(arg0 *model.Session) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CreateSession", session) + ret := m.ctrl.Call(m, "CreateSession", arg0) ret0, _ := ret[0].(error) return ret0 } // CreateSession indicates an expected call of CreateSession. -func (mr *MockStoreMockRecorder) CreateSession(session interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) CreateSession(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSession", reflect.TypeOf((*MockStore)(nil).CreateSession), session) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSession", reflect.TypeOf((*MockStore)(nil).CreateSession), arg0) } // CreateUser mocks base method. -func (m *MockStore) CreateUser(user *model.User) error { +func (m *MockStore) CreateUser(arg0 *model.User) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CreateUser", user) + ret := m.ctrl.Call(m, "CreateUser", arg0) ret0, _ := ret[0].(error) return ret0 } // CreateUser indicates an expected call of CreateUser. -func (mr *MockStoreMockRecorder) CreateUser(user interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) CreateUser(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateUser", reflect.TypeOf((*MockStore)(nil).CreateUser), user) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateUser", reflect.TypeOf((*MockStore)(nil).CreateUser), arg0) } // DeleteBlock mocks base method. -func (m *MockStore) DeleteBlock(c store.Container, blockID, modifiedBy string) error { +func (m *MockStore) DeleteBlock(arg0 store.Container, arg1, arg2 string) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DeleteBlock", c, blockID, modifiedBy) + ret := m.ctrl.Call(m, "DeleteBlock", arg0, arg1, arg2) ret0, _ := ret[0].(error) return ret0 } // DeleteBlock indicates an expected call of DeleteBlock. -func (mr *MockStoreMockRecorder) DeleteBlock(c, blockID, modifiedBy interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) DeleteBlock(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteBlock", reflect.TypeOf((*MockStore)(nil).DeleteBlock), c, blockID, modifiedBy) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteBlock", reflect.TypeOf((*MockStore)(nil).DeleteBlock), arg0, arg1, arg2) } // DeleteSession mocks base method. -func (m *MockStore) DeleteSession(sessionId string) error { +func (m *MockStore) DeleteSession(arg0 string) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DeleteSession", sessionId) + ret := m.ctrl.Call(m, "DeleteSession", arg0) ret0, _ := ret[0].(error) return ret0 } // DeleteSession indicates an expected call of DeleteSession. -func (mr *MockStoreMockRecorder) DeleteSession(sessionId interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) DeleteSession(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSession", reflect.TypeOf((*MockStore)(nil).DeleteSession), sessionId) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSession", reflect.TypeOf((*MockStore)(nil).DeleteSession), arg0) } // GetActiveUserCount mocks base method. -func (m *MockStore) GetActiveUserCount(updatedSecondsAgo int64) (int, error) { +func (m *MockStore) GetActiveUserCount(arg0 int64) (int, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetActiveUserCount", updatedSecondsAgo) + ret := m.ctrl.Call(m, "GetActiveUserCount", arg0) ret0, _ := ret[0].(int) ret1, _ := ret[1].(error) return ret0, ret1 } // GetActiveUserCount indicates an expected call of GetActiveUserCount. -func (mr *MockStoreMockRecorder) GetActiveUserCount(updatedSecondsAgo interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetActiveUserCount(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetActiveUserCount", reflect.TypeOf((*MockStore)(nil).GetActiveUserCount), updatedSecondsAgo) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetActiveUserCount", reflect.TypeOf((*MockStore)(nil).GetActiveUserCount), arg0) } // GetAllBlocks mocks base method. -func (m *MockStore) GetAllBlocks(c store.Container) ([]model.Block, error) { +func (m *MockStore) GetAllBlocks(arg0 store.Container) ([]model.Block, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAllBlocks", c) + ret := m.ctrl.Call(m, "GetAllBlocks", arg0) ret0, _ := ret[0].([]model.Block) ret1, _ := ret[1].(error) return ret0, ret1 } // GetAllBlocks indicates an expected call of GetAllBlocks. -func (mr *MockStoreMockRecorder) GetAllBlocks(c interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetAllBlocks(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBlocks", reflect.TypeOf((*MockStore)(nil).GetAllBlocks), c) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBlocks", reflect.TypeOf((*MockStore)(nil).GetAllBlocks), arg0) } // GetBlock mocks base method. -func (m *MockStore) GetBlock(c store.Container, blockID string) (*model.Block, error) { +func (m *MockStore) GetBlock(arg0 store.Container, arg1 string) (*model.Block, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetBlock", c, blockID) + ret := m.ctrl.Call(m, "GetBlock", arg0, arg1) ret0, _ := ret[0].(*model.Block) ret1, _ := ret[1].(error) return ret0, ret1 } // GetBlock indicates an expected call of GetBlock. -func (mr *MockStoreMockRecorder) GetBlock(c, blockID interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetBlock(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlock", reflect.TypeOf((*MockStore)(nil).GetBlock), c, blockID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlock", reflect.TypeOf((*MockStore)(nil).GetBlock), arg0, arg1) } // GetBlockCountsByType mocks base method. @@ -166,78 +166,78 @@ func (mr *MockStoreMockRecorder) GetBlockCountsByType() *gomock.Call { } // GetBlocksWithParent mocks base method. -func (m *MockStore) GetBlocksWithParent(c store.Container, parentID string) ([]model.Block, error) { +func (m *MockStore) GetBlocksWithParent(arg0 store.Container, arg1 string) ([]model.Block, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetBlocksWithParent", c, parentID) + ret := m.ctrl.Call(m, "GetBlocksWithParent", arg0, arg1) ret0, _ := ret[0].([]model.Block) ret1, _ := ret[1].(error) return ret0, ret1 } // GetBlocksWithParent indicates an expected call of GetBlocksWithParent. -func (mr *MockStoreMockRecorder) GetBlocksWithParent(c, parentID interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetBlocksWithParent(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlocksWithParent", reflect.TypeOf((*MockStore)(nil).GetBlocksWithParent), c, parentID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlocksWithParent", reflect.TypeOf((*MockStore)(nil).GetBlocksWithParent), arg0, arg1) } // GetBlocksWithParentAndType mocks base method. -func (m *MockStore) GetBlocksWithParentAndType(c store.Container, parentID, blockType string) ([]model.Block, error) { +func (m *MockStore) GetBlocksWithParentAndType(arg0 store.Container, arg1, arg2 string) ([]model.Block, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetBlocksWithParentAndType", c, parentID, blockType) + ret := m.ctrl.Call(m, "GetBlocksWithParentAndType", arg0, arg1, arg2) ret0, _ := ret[0].([]model.Block) ret1, _ := ret[1].(error) return ret0, ret1 } // GetBlocksWithParentAndType indicates an expected call of GetBlocksWithParentAndType. -func (mr *MockStoreMockRecorder) GetBlocksWithParentAndType(c, parentID, blockType interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetBlocksWithParentAndType(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlocksWithParentAndType", reflect.TypeOf((*MockStore)(nil).GetBlocksWithParentAndType), c, parentID, blockType) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlocksWithParentAndType", reflect.TypeOf((*MockStore)(nil).GetBlocksWithParentAndType), arg0, arg1, arg2) } // GetBlocksWithRootID mocks base method. -func (m *MockStore) GetBlocksWithRootID(c store.Container, rootID string) ([]model.Block, error) { +func (m *MockStore) GetBlocksWithRootID(arg0 store.Container, arg1 string) ([]model.Block, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetBlocksWithRootID", c, rootID) + ret := m.ctrl.Call(m, "GetBlocksWithRootID", arg0, arg1) ret0, _ := ret[0].([]model.Block) ret1, _ := ret[1].(error) return ret0, ret1 } // GetBlocksWithRootID indicates an expected call of GetBlocksWithRootID. -func (mr *MockStoreMockRecorder) GetBlocksWithRootID(c, rootID interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetBlocksWithRootID(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlocksWithRootID", reflect.TypeOf((*MockStore)(nil).GetBlocksWithRootID), c, rootID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlocksWithRootID", reflect.TypeOf((*MockStore)(nil).GetBlocksWithRootID), arg0, arg1) } // GetBlocksWithType mocks base method. -func (m *MockStore) GetBlocksWithType(c store.Container, blockType string) ([]model.Block, error) { +func (m *MockStore) GetBlocksWithType(arg0 store.Container, arg1 string) ([]model.Block, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetBlocksWithType", c, blockType) + ret := m.ctrl.Call(m, "GetBlocksWithType", arg0, arg1) ret0, _ := ret[0].([]model.Block) ret1, _ := ret[1].(error) return ret0, ret1 } // GetBlocksWithType indicates an expected call of GetBlocksWithType. -func (mr *MockStoreMockRecorder) GetBlocksWithType(c, blockType interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetBlocksWithType(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlocksWithType", reflect.TypeOf((*MockStore)(nil).GetBlocksWithType), c, blockType) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlocksWithType", reflect.TypeOf((*MockStore)(nil).GetBlocksWithType), arg0, arg1) } // GetParentID mocks base method. -func (m *MockStore) GetParentID(c store.Container, blockID string) (string, error) { +func (m *MockStore) GetParentID(arg0 store.Container, arg1 string) (string, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetParentID", c, blockID) + ret := m.ctrl.Call(m, "GetParentID", arg0, arg1) ret0, _ := ret[0].(string) ret1, _ := ret[1].(error) return ret0, ret1 } // GetParentID indicates an expected call of GetParentID. -func (mr *MockStoreMockRecorder) GetParentID(c, blockID interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetParentID(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParentID", reflect.TypeOf((*MockStore)(nil).GetParentID), c, blockID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParentID", reflect.TypeOf((*MockStore)(nil).GetParentID), arg0, arg1) } // GetRegisteredUserCount mocks base method. @@ -256,78 +256,78 @@ func (mr *MockStoreMockRecorder) GetRegisteredUserCount() *gomock.Call { } // GetRootID mocks base method. -func (m *MockStore) GetRootID(c store.Container, blockID string) (string, error) { +func (m *MockStore) GetRootID(arg0 store.Container, arg1 string) (string, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetRootID", c, blockID) + ret := m.ctrl.Call(m, "GetRootID", arg0, arg1) ret0, _ := ret[0].(string) ret1, _ := ret[1].(error) return ret0, ret1 } // GetRootID indicates an expected call of GetRootID. -func (mr *MockStoreMockRecorder) GetRootID(c, blockID interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetRootID(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRootID", reflect.TypeOf((*MockStore)(nil).GetRootID), c, blockID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRootID", reflect.TypeOf((*MockStore)(nil).GetRootID), arg0, arg1) } // GetSession mocks base method. -func (m *MockStore) GetSession(token string, expireTime int64) (*model.Session, error) { +func (m *MockStore) GetSession(arg0 string, arg1 int64) (*model.Session, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSession", token, expireTime) + ret := m.ctrl.Call(m, "GetSession", arg0, arg1) ret0, _ := ret[0].(*model.Session) ret1, _ := ret[1].(error) return ret0, ret1 } // GetSession indicates an expected call of GetSession. -func (mr *MockStoreMockRecorder) GetSession(token, expireTime interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetSession(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSession", reflect.TypeOf((*MockStore)(nil).GetSession), token, expireTime) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSession", reflect.TypeOf((*MockStore)(nil).GetSession), arg0, arg1) } // GetSharing mocks base method. -func (m *MockStore) GetSharing(c store.Container, rootID string) (*model.Sharing, error) { +func (m *MockStore) GetSharing(arg0 store.Container, arg1 string) (*model.Sharing, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSharing", c, rootID) + ret := m.ctrl.Call(m, "GetSharing", arg0, arg1) ret0, _ := ret[0].(*model.Sharing) ret1, _ := ret[1].(error) return ret0, ret1 } // GetSharing indicates an expected call of GetSharing. -func (mr *MockStoreMockRecorder) GetSharing(c, rootID interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetSharing(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSharing", reflect.TypeOf((*MockStore)(nil).GetSharing), c, rootID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSharing", reflect.TypeOf((*MockStore)(nil).GetSharing), arg0, arg1) } // GetSubTree2 mocks base method. -func (m *MockStore) GetSubTree2(c store.Container, blockID string) ([]model.Block, error) { +func (m *MockStore) GetSubTree2(arg0 store.Container, arg1 string) ([]model.Block, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSubTree2", c, blockID) + ret := m.ctrl.Call(m, "GetSubTree2", arg0, arg1) ret0, _ := ret[0].([]model.Block) ret1, _ := ret[1].(error) return ret0, ret1 } // GetSubTree2 indicates an expected call of GetSubTree2. -func (mr *MockStoreMockRecorder) GetSubTree2(c, blockID interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetSubTree2(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubTree2", reflect.TypeOf((*MockStore)(nil).GetSubTree2), c, blockID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubTree2", reflect.TypeOf((*MockStore)(nil).GetSubTree2), arg0, arg1) } // GetSubTree3 mocks base method. -func (m *MockStore) GetSubTree3(c store.Container, blockID string) ([]model.Block, error) { +func (m *MockStore) GetSubTree3(arg0 store.Container, arg1 string) ([]model.Block, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSubTree3", c, blockID) + ret := m.ctrl.Call(m, "GetSubTree3", arg0, arg1) ret0, _ := ret[0].([]model.Block) ret1, _ := ret[1].(error) return ret0, ret1 } // GetSubTree3 indicates an expected call of GetSubTree3. -func (mr *MockStoreMockRecorder) GetSubTree3(c, blockID interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetSubTree3(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubTree3", reflect.TypeOf((*MockStore)(nil).GetSubTree3), c, blockID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubTree3", reflect.TypeOf((*MockStore)(nil).GetSubTree3), arg0, arg1) } // GetSystemSettings mocks base method. @@ -346,78 +346,78 @@ func (mr *MockStoreMockRecorder) GetSystemSettings() *gomock.Call { } // GetUserByEmail mocks base method. -func (m *MockStore) GetUserByEmail(email string) (*model.User, error) { +func (m *MockStore) GetUserByEmail(arg0 string) (*model.User, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetUserByEmail", email) + ret := m.ctrl.Call(m, "GetUserByEmail", arg0) ret0, _ := ret[0].(*model.User) ret1, _ := ret[1].(error) return ret0, ret1 } // GetUserByEmail indicates an expected call of GetUserByEmail. -func (mr *MockStoreMockRecorder) GetUserByEmail(email interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetUserByEmail(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserByEmail", reflect.TypeOf((*MockStore)(nil).GetUserByEmail), email) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserByEmail", reflect.TypeOf((*MockStore)(nil).GetUserByEmail), arg0) } // GetUserByID mocks base method. -func (m *MockStore) GetUserByID(userID string) (*model.User, error) { +func (m *MockStore) GetUserByID(arg0 string) (*model.User, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetUserByID", userID) + ret := m.ctrl.Call(m, "GetUserByID", arg0) ret0, _ := ret[0].(*model.User) ret1, _ := ret[1].(error) return ret0, ret1 } // GetUserByID indicates an expected call of GetUserByID. -func (mr *MockStoreMockRecorder) GetUserByID(userID interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetUserByID(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserByID", reflect.TypeOf((*MockStore)(nil).GetUserByID), userID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserByID", reflect.TypeOf((*MockStore)(nil).GetUserByID), arg0) } // GetUserByUsername mocks base method. -func (m *MockStore) GetUserByUsername(username string) (*model.User, error) { +func (m *MockStore) GetUserByUsername(arg0 string) (*model.User, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetUserByUsername", username) + ret := m.ctrl.Call(m, "GetUserByUsername", arg0) ret0, _ := ret[0].(*model.User) ret1, _ := ret[1].(error) return ret0, ret1 } // GetUserByUsername indicates an expected call of GetUserByUsername. -func (mr *MockStoreMockRecorder) GetUserByUsername(username interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetUserByUsername(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserByUsername", reflect.TypeOf((*MockStore)(nil).GetUserByUsername), username) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserByUsername", reflect.TypeOf((*MockStore)(nil).GetUserByUsername), arg0) } // GetUsersByWorkspace mocks base method. -func (m *MockStore) GetUsersByWorkspace(workspaceID string) ([]*model.User, error) { +func (m *MockStore) GetUsersByWorkspace(arg0 string) ([]*model.User, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetUsersByWorkspace", workspaceID) + ret := m.ctrl.Call(m, "GetUsersByWorkspace", arg0) ret0, _ := ret[0].([]*model.User) ret1, _ := ret[1].(error) return ret0, ret1 } // GetUsersByWorkspace indicates an expected call of GetUsersByWorkspace. -func (mr *MockStoreMockRecorder) GetUsersByWorkspace(workspaceID interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetUsersByWorkspace(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUsersByWorkspace", reflect.TypeOf((*MockStore)(nil).GetUsersByWorkspace), workspaceID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUsersByWorkspace", reflect.TypeOf((*MockStore)(nil).GetUsersByWorkspace), arg0) } // GetWorkspace mocks base method. -func (m *MockStore) GetWorkspace(ID string) (*model.Workspace, error) { +func (m *MockStore) GetWorkspace(arg0 string) (*model.Workspace, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetWorkspace", ID) + ret := m.ctrl.Call(m, "GetWorkspace", arg0) ret0, _ := ret[0].(*model.Workspace) ret1, _ := ret[1].(error) return ret0, ret1 } // GetWorkspace indicates an expected call of GetWorkspace. -func (mr *MockStoreMockRecorder) GetWorkspace(ID interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) GetWorkspace(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkspace", reflect.TypeOf((*MockStore)(nil).GetWorkspace), ID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkspace", reflect.TypeOf((*MockStore)(nil).GetWorkspace), arg0) } // GetWorkspaceCount mocks base method. @@ -436,60 +436,74 @@ func (mr *MockStoreMockRecorder) GetWorkspaceCount() *gomock.Call { } // HasWorkspaceAccess mocks base method. -func (m *MockStore) HasWorkspaceAccess(userID, workspaceID string) (bool, error) { +func (m *MockStore) HasWorkspaceAccess(arg0, arg1 string) (bool, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "HasWorkspaceAccess", userID, workspaceID) + ret := m.ctrl.Call(m, "HasWorkspaceAccess", arg0, arg1) ret0, _ := ret[0].(bool) ret1, _ := ret[1].(error) return ret0, ret1 } // HasWorkspaceAccess indicates an expected call of HasWorkspaceAccess. -func (mr *MockStoreMockRecorder) HasWorkspaceAccess(userID, workspaceID interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) HasWorkspaceAccess(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasWorkspaceAccess", reflect.TypeOf((*MockStore)(nil).HasWorkspaceAccess), userID, workspaceID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasWorkspaceAccess", reflect.TypeOf((*MockStore)(nil).HasWorkspaceAccess), arg0, arg1) } // InsertBlock mocks base method. -func (m *MockStore) InsertBlock(c store.Container, block *model.Block, userID string) error { +func (m *MockStore) InsertBlock(arg0 store.Container, arg1 *model.Block, arg2 string) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "InsertBlock", c, block, userID) + ret := m.ctrl.Call(m, "InsertBlock", arg0, arg1, arg2) ret0, _ := ret[0].(error) return ret0 } // InsertBlock indicates an expected call of InsertBlock. -func (mr *MockStoreMockRecorder) InsertBlock(c, block, userID interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) InsertBlock(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertBlock", reflect.TypeOf((*MockStore)(nil).InsertBlock), c, block, userID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertBlock", reflect.TypeOf((*MockStore)(nil).InsertBlock), arg0, arg1, arg2) +} + +// PatchBlock mocks base method. +func (m *MockStore) PatchBlock(arg0 store.Container, arg1 string, arg2 *model.BlockPatch, arg3 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PatchBlock", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchBlock indicates an expected call of PatchBlock. +func (mr *MockStoreMockRecorder) PatchBlock(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchBlock", reflect.TypeOf((*MockStore)(nil).PatchBlock), arg0, arg1, arg2, arg3) } // RefreshSession mocks base method. -func (m *MockStore) RefreshSession(session *model.Session) error { +func (m *MockStore) RefreshSession(arg0 *model.Session) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RefreshSession", session) + ret := m.ctrl.Call(m, "RefreshSession", arg0) ret0, _ := ret[0].(error) return ret0 } // RefreshSession indicates an expected call of RefreshSession. -func (mr *MockStoreMockRecorder) RefreshSession(session interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) RefreshSession(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RefreshSession", reflect.TypeOf((*MockStore)(nil).RefreshSession), session) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RefreshSession", reflect.TypeOf((*MockStore)(nil).RefreshSession), arg0) } // SetSystemSetting mocks base method. -func (m *MockStore) SetSystemSetting(key, value string) error { +func (m *MockStore) SetSystemSetting(arg0, arg1 string) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetSystemSetting", key, value) + ret := m.ctrl.Call(m, "SetSystemSetting", arg0, arg1) ret0, _ := ret[0].(error) return ret0 } // SetSystemSetting indicates an expected call of SetSystemSetting. -func (mr *MockStoreMockRecorder) SetSystemSetting(key, value interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) SetSystemSetting(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSystemSetting", reflect.TypeOf((*MockStore)(nil).SetSystemSetting), key, value) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSystemSetting", reflect.TypeOf((*MockStore)(nil).SetSystemSetting), arg0, arg1) } // Shutdown mocks base method. @@ -507,99 +521,99 @@ func (mr *MockStoreMockRecorder) Shutdown() *gomock.Call { } // UpdateSession mocks base method. -func (m *MockStore) UpdateSession(session *model.Session) error { +func (m *MockStore) UpdateSession(arg0 *model.Session) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpdateSession", session) + ret := m.ctrl.Call(m, "UpdateSession", arg0) ret0, _ := ret[0].(error) return ret0 } // UpdateSession indicates an expected call of UpdateSession. -func (mr *MockStoreMockRecorder) UpdateSession(session interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) UpdateSession(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSession", reflect.TypeOf((*MockStore)(nil).UpdateSession), session) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSession", reflect.TypeOf((*MockStore)(nil).UpdateSession), arg0) } // UpdateUser mocks base method. -func (m *MockStore) UpdateUser(user *model.User) error { +func (m *MockStore) UpdateUser(arg0 *model.User) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpdateUser", user) + ret := m.ctrl.Call(m, "UpdateUser", arg0) ret0, _ := ret[0].(error) return ret0 } // UpdateUser indicates an expected call of UpdateUser. -func (mr *MockStoreMockRecorder) UpdateUser(user interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) UpdateUser(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateUser", reflect.TypeOf((*MockStore)(nil).UpdateUser), user) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateUser", reflect.TypeOf((*MockStore)(nil).UpdateUser), arg0) } // UpdateUserPassword mocks base method. -func (m *MockStore) UpdateUserPassword(username, password string) error { +func (m *MockStore) UpdateUserPassword(arg0, arg1 string) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpdateUserPassword", username, password) + ret := m.ctrl.Call(m, "UpdateUserPassword", arg0, arg1) ret0, _ := ret[0].(error) return ret0 } // UpdateUserPassword indicates an expected call of UpdateUserPassword. -func (mr *MockStoreMockRecorder) UpdateUserPassword(username, password interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) UpdateUserPassword(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateUserPassword", reflect.TypeOf((*MockStore)(nil).UpdateUserPassword), username, password) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateUserPassword", reflect.TypeOf((*MockStore)(nil).UpdateUserPassword), arg0, arg1) } // UpdateUserPasswordByID mocks base method. -func (m *MockStore) UpdateUserPasswordByID(userID, password string) error { +func (m *MockStore) UpdateUserPasswordByID(arg0, arg1 string) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpdateUserPasswordByID", userID, password) + ret := m.ctrl.Call(m, "UpdateUserPasswordByID", arg0, arg1) ret0, _ := ret[0].(error) return ret0 } // UpdateUserPasswordByID indicates an expected call of UpdateUserPasswordByID. -func (mr *MockStoreMockRecorder) UpdateUserPasswordByID(userID, password interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) UpdateUserPasswordByID(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateUserPasswordByID", reflect.TypeOf((*MockStore)(nil).UpdateUserPasswordByID), userID, password) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateUserPasswordByID", reflect.TypeOf((*MockStore)(nil).UpdateUserPasswordByID), arg0, arg1) } // UpsertSharing mocks base method. -func (m *MockStore) UpsertSharing(c store.Container, sharing model.Sharing) error { +func (m *MockStore) UpsertSharing(arg0 store.Container, arg1 model.Sharing) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpsertSharing", c, sharing) + ret := m.ctrl.Call(m, "UpsertSharing", arg0, arg1) ret0, _ := ret[0].(error) return ret0 } // UpsertSharing indicates an expected call of UpsertSharing. -func (mr *MockStoreMockRecorder) UpsertSharing(c, sharing interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) UpsertSharing(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertSharing", reflect.TypeOf((*MockStore)(nil).UpsertSharing), c, sharing) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertSharing", reflect.TypeOf((*MockStore)(nil).UpsertSharing), arg0, arg1) } // UpsertWorkspaceSettings mocks base method. -func (m *MockStore) UpsertWorkspaceSettings(workspace model.Workspace) error { +func (m *MockStore) UpsertWorkspaceSettings(arg0 model.Workspace) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpsertWorkspaceSettings", workspace) + ret := m.ctrl.Call(m, "UpsertWorkspaceSettings", arg0) ret0, _ := ret[0].(error) return ret0 } // UpsertWorkspaceSettings indicates an expected call of UpsertWorkspaceSettings. -func (mr *MockStoreMockRecorder) UpsertWorkspaceSettings(workspace interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) UpsertWorkspaceSettings(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertWorkspaceSettings", reflect.TypeOf((*MockStore)(nil).UpsertWorkspaceSettings), workspace) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertWorkspaceSettings", reflect.TypeOf((*MockStore)(nil).UpsertWorkspaceSettings), arg0) } // UpsertWorkspaceSignupToken mocks base method. -func (m *MockStore) UpsertWorkspaceSignupToken(workspace model.Workspace) error { +func (m *MockStore) UpsertWorkspaceSignupToken(arg0 model.Workspace) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpsertWorkspaceSignupToken", workspace) + ret := m.ctrl.Call(m, "UpsertWorkspaceSignupToken", arg0) ret0, _ := ret[0].(error) return ret0 } // UpsertWorkspaceSignupToken indicates an expected call of UpsertWorkspaceSignupToken. -func (mr *MockStoreMockRecorder) UpsertWorkspaceSignupToken(workspace interface{}) *gomock.Call { +func (mr *MockStoreMockRecorder) UpsertWorkspaceSignupToken(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertWorkspaceSignupToken", reflect.TypeOf((*MockStore)(nil).UpsertWorkspaceSignupToken), workspace) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertWorkspaceSignupToken", reflect.TypeOf((*MockStore)(nil).UpsertWorkspaceSignupToken), arg0) } diff --git a/server/services/store/sqlstore/blocks.go b/server/services/store/sqlstore/blocks.go index 977247535..c4906fa8a 100644 --- a/server/services/store/sqlstore/blocks.go +++ b/server/services/store/sqlstore/blocks.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "encoding/json" + "fmt" "time" "github.com/mattermost/focalboard/server/utils" @@ -22,6 +23,14 @@ func (re RootIDNilError) Error() string { return "rootId is nil" } +type BlockNotFoundErr struct { + blockID string +} + +func (be BlockNotFoundErr) Error() string { + return fmt.Sprintf("block not found (block id: %s", be.blockID) +} + func (s *SQLStore) GetBlocksWithParentAndType(c store.Container, parentID string, blockType string) ([]model.Block, error) { query := s.getQueryBuilder(). Select( @@ -457,6 +466,19 @@ func (s *SQLStore) InsertBlock(c store.Container, block *model.Block, userID str return nil } +func (s *SQLStore) PatchBlock(c store.Container, blockID string, blockPatch *model.BlockPatch, userID string) error { + existingBlock, err := s.GetBlock(c, blockID) + if err != nil { + return err + } + if existingBlock == nil { + return BlockNotFoundErr{blockID} + } + + block := blockPatch.Patch(existingBlock) + return s.InsertBlock(c, block, userID) +} + func (s *SQLStore) DeleteBlock(c store.Container, blockID string, modifiedBy string) error { ctx := context.Background() tx, err := s.db.BeginTx(ctx, nil) diff --git a/server/services/store/sqlstore/initializations/bindata.go b/server/services/store/sqlstore/initializations/bindata.go index 35e8508fa..aec6ea2b4 100644 --- a/server/services/store/sqlstore/initializations/bindata.go +++ b/server/services/store/sqlstore/initializations/bindata.go @@ -1,11 +1,13 @@ // Code generated by go-bindata. DO NOT EDIT. // sources: -// templates/templates.json +// templates/templates.json (22.926kB) + package initializations import ( "bytes" "compress/gzip" + "crypto/sha256" "fmt" "io" "io/ioutil" @@ -18,7 +20,7 @@ import ( func bindataRead(data []byte, name string) ([]byte, error) { gz, err := gzip.NewReader(bytes.NewBuffer(data)) if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) + return nil, fmt.Errorf("read %q: %w", name, err) } var buf bytes.Buffer @@ -26,7 +28,7 @@ func bindataRead(data []byte, name string) ([]byte, error) { clErr := gz.Close() if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) + return nil, fmt.Errorf("read %q: %w", name, err) } if clErr != nil { return nil, err @@ -36,8 +38,9 @@ func bindataRead(data []byte, name string) ([]byte, error) { } type asset struct { - bytes []byte - info os.FileInfo + bytes []byte + info os.FileInfo + digest [sha256.Size]byte } type bindataFileInfo struct { @@ -81,8 +84,8 @@ func templatesJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "templates.json", size: 22926, mode: os.FileMode(420), modTime: time.Unix(1611791102, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "templates.json", size: 22926, mode: os.FileMode(0644), modTime: time.Unix(1610380665, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3, 0x15, 0x49, 0xe, 0xb2, 0xe7, 0x7, 0xd0, 0x6e, 0x35, 0x6f, 0xd0, 0x76, 0xe7, 0x1d, 0x9d, 0xc7, 0xa0, 0x55, 0x1, 0x25, 0x51, 0x9e, 0xd5, 0xf0, 0x81, 0x4c, 0x91, 0xd7, 0x33, 0x37, 0x3b}} return a, nil } @@ -90,8 +93,8 @@ func templatesJson() (*asset, error) { // It returns an error if the asset could not be found or // could not be loaded. func Asset(name string) ([]byte, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) @@ -101,6 +104,12 @@ func Asset(name string) ([]byte, error) { return nil, fmt.Errorf("Asset %s not found", name) } +// AssetString returns the asset contents as a string (instead of a []byte). +func AssetString(name string) (string, error) { + data, err := Asset(name) + return string(data), err +} + // MustAsset is like Asset but panics when Asset would return an error. // It simplifies safe initialization of global variables. func MustAsset(name string) []byte { @@ -112,12 +121,18 @@ func MustAsset(name string) []byte { return a } +// MustAssetString is like AssetString but panics when Asset would return an +// error. It simplifies safe initialization of global variables. +func MustAssetString(name string) string { + return string(MustAsset(name)) +} + // AssetInfo loads and returns the asset info for the given name. // It returns an error if the asset could not be found or // could not be loaded. func AssetInfo(name string) (os.FileInfo, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) @@ -127,6 +142,33 @@ func AssetInfo(name string) (os.FileInfo, error) { return nil, fmt.Errorf("AssetInfo %s not found", name) } +// AssetDigest returns the digest of the file with the given name. It returns an +// error if the asset could not be found or the digest could not be loaded. +func AssetDigest(name string) ([sha256.Size]byte, error) { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { + a, err := f() + if err != nil { + return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err) + } + return a.digest, nil + } + return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name) +} + +// Digests returns a map of all known files and their checksums. +func Digests() (map[string][sha256.Size]byte, error) { + mp := make(map[string][sha256.Size]byte, len(_bindata)) + for name := range _bindata { + a, err := _bindata[name]() + if err != nil { + return nil, err + } + mp[name] = a.digest + } + return mp, nil +} + // AssetNames returns the names of the assets. func AssetNames() []string { names := make([]string, 0, len(_bindata)) @@ -141,6 +183,9 @@ var _bindata = map[string]func() (*asset, error){ "templates.json": templatesJson, } +// AssetDebug is true if the assets were built with the debug flag enabled. +const AssetDebug = false + // AssetDir returns the file names below a certain // directory embedded in the file by go-bindata. // For example if you run go-bindata on data/... and data contains the @@ -150,15 +195,15 @@ var _bindata = map[string]func() (*asset, error){ // img/ // a.png // b.png -// then AssetDir("data") would return []string{"foo.txt", "img"} -// AssetDir("data/img") would return []string{"a.png", "b.png"} -// AssetDir("foo.txt") and AssetDir("notexist") would return an error +// then AssetDir("data") would return []string{"foo.txt", "img"}, +// AssetDir("data/img") would return []string{"a.png", "b.png"}, +// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and // AssetDir("") will return []string{"data"}. func AssetDir(name string) ([]string, error) { node := _bintree if len(name) != 0 { - cannonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(cannonicalName, "/") + canonicalName := strings.Replace(name, "\\", "/", -1) + pathList := strings.Split(canonicalName, "/") for _, p := range pathList { node = node.Children[p] if node == nil { @@ -180,11 +225,12 @@ type bintree struct { Func func() (*asset, error) Children map[string]*bintree } + var _bintree = &bintree{nil, map[string]*bintree{ - "templates.json": &bintree{templatesJson, map[string]*bintree{}}, + "templates.json": {templatesJson, map[string]*bintree{}}, }} -// RestoreAsset restores an asset under the given directory +// RestoreAsset restores an asset under the given directory. func RestoreAsset(dir, name string) error { data, err := Asset(name) if err != nil { @@ -202,14 +248,10 @@ func RestoreAsset(dir, name string) error { if err != nil { return err } - err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) - if err != nil { - return err - } - return nil + return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) } -// RestoreAssets restores an asset under the given directory recursively +// RestoreAssets restores an asset under the given directory recursively. func RestoreAssets(dir, name string) error { children, err := AssetDir(name) // File @@ -227,7 +269,6 @@ func RestoreAssets(dir, name string) error { } func _filePath(dir, name string) string { - cannonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) + canonicalName := strings.Replace(name, "\\", "/", -1) + return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) } - diff --git a/server/services/store/sqlstore/migrations/bindata.go b/server/services/store/sqlstore/migrations/bindata.go index 48895df13..ddfd42b8b 100644 --- a/server/services/store/sqlstore/migrations/bindata.go +++ b/server/services/store/sqlstore/migrations/bindata.go @@ -1,221 +1,573 @@ +// Code generated by go-bindata. DO NOT EDIT. +// sources: +// migrations_files/000001_init.down.sql (30B) +// migrations_files/000001_init.up.sql (606B) +// migrations_files/000002_system_settings_table.down.sql (39B) +// migrations_files/000002_system_settings_table.up.sql (176B) +// migrations_files/000003_blocks_rootid.down.sql (51B) +// migrations_files/000003_blocks_rootid.up.sql (62B) +// migrations_files/000004_auth_table.down.sql (61B) +// migrations_files/000004_auth_table.up.sql (719B) +// migrations_files/000005_blocks_modifiedby.down.sql (55B) +// migrations_files/000005_blocks_modifiedby.up.sql (66B) +// migrations_files/000006_sharing_table.down.sql (31B) +// migrations_files/000006_sharing_table.up.sql (238B) +// migrations_files/000007_workspaces_table.down.sql (34B) +// migrations_files/000007_workspaces_table.up.sql (290B) +// migrations_files/000008_teams.down.sql (173B) +// migrations_files/000008_teams.up.sql (304B) +// migrations_files/000009_blocks_history.down.sql (97B) +// migrations_files/000009_blocks_history.up.sql (1.201kB) +// migrations_files/000010_blocks_created_by.down.sql (2.573kB) +// migrations_files/000010_blocks_created_by.up.sql (381B) + package migrations import ( "bytes" "compress/gzip" + "crypto/sha256" "fmt" "io" + "io/ioutil" + "os" + "path/filepath" "strings" + "time" ) -func bindata_read(data []byte, name string) ([]byte, error) { +func bindataRead(data []byte, name string) ([]byte, error) { gz, err := gzip.NewReader(bytes.NewBuffer(data)) if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) + return nil, fmt.Errorf("read %q: %w", name, err) } var buf bytes.Buffer _, err = io.Copy(&buf, gz) - gz.Close() + clErr := gz.Close() if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) + return nil, fmt.Errorf("read %q: %w", name, err) + } + if clErr != nil { + return nil, err } return buf.Bytes(), nil } -var __000001_init_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x4d\xca\xc9\x4f\xce\x2e\xb6\xe6\x02\x04\x00\x00\xff\xff\x2d\x73\xd0\xe1\x1e\x00\x00\x00") +type asset struct { + bytes []byte + info os.FileInfo + digest [sha256.Size]byte +} -func _000001_init_down_sql() ([]byte, error) { - return bindata_read( - __000001_init_down_sql, +type bindataFileInfo struct { + name string + size int64 + mode os.FileMode + modTime time.Time +} + +func (fi bindataFileInfo) Name() string { + return fi.name +} +func (fi bindataFileInfo) Size() int64 { + return fi.size +} +func (fi bindataFileInfo) Mode() os.FileMode { + return fi.mode +} +func (fi bindataFileInfo) ModTime() time.Time { + return fi.modTime +} +func (fi bindataFileInfo) IsDir() bool { + return false +} +func (fi bindataFileInfo) Sys() interface{} { + return nil +} + +var __000001_initDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x4d\xca\xc9\x4f\xce\x2e\xb6\xe6\x02\x04\x00\x00\xff\xff\x2d\x73\xd0\xe1\x1e\x00\x00\x00") + +func _000001_initDownSqlBytes() ([]byte, error) { + return bindataRead( + __000001_initDownSql, "000001_init.down.sql", ) } -var __000001_init_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\xd2\xcf\x6f\x9b\x30\x14\x07\xf0\x33\xfc\x15\xef\x82\x00\x89\xf6\xb2\x29\x9a\xba\x93\x4b\x9d\x95\x8d\x1f\x15\xb8\x6b\xb3\x0b\xa5\xf8\xb1\x59\x03\x42\xb1\x23\x2d\xb2\xfc\xbf\x4f\x64\x24\xca\x92\xf4\xc6\x7b\x58\x1f\xbf\xf7\x95\xc3\x9c\x12\x46\x81\x91\xdb\x98\x42\xb4\x84\x34\x63\x40\x9f\xa3\x82\x15\xa0\xf5\xf5\x30\x62\x23\xfe\x18\xf3\xda\xae\xeb\xdf\x12\x3c\xdb\x12\x1c\xbe\x93\x3c\xbc\x27\xb9\xf7\x61\xe1\x07\xb6\xa5\xb5\x68\xe0\x7a\x58\x4b\xf5\x73\x44\x69\x8c\xe8\x25\x8e\xaa\xac\x14\xb0\x28\xa1\x05\x23\xc9\x03\xfb\xb1\x63\xd3\xc7\x38\x86\x3b\xba\x24\x8f\x31\x83\x34\x7b\xf2\xfc\x40\x6b\xec\xb9\x31\x7b\x45\xbe\xb5\x42\xe1\xb1\x71\x47\x18\x9d\x9c\x33\xc0\x2b\x58\xbe\x9c\xfe\x78\xae\xb3\xba\x72\xba\x2b\x87\x83\x73\x7f\xe3\x24\x37\x4e\xe3\x06\xe0\xa6\xd9\x93\xeb\x9f\x5d\xd0\x6d\xe5\x5b\x7b\xc9\xf7\x16\xfe\xe5\x19\x17\x47\xc6\x50\x8d\xd8\xab\xf2\x9d\x08\x66\xfb\x45\xd6\xbf\xb0\xab\x5e\xb4\xc6\x56\xa2\x31\xff\xca\xd9\x80\xdb\xe8\x4b\x94\xb2\xc0\xb6\xd4\x76\x40\x60\xf4\x79\xf7\x2d\x54\x7b\x28\x1a\x81\x2d\x97\x70\x1a\xeb\xd7\x22\x4b\xf7\xe4\x74\x72\x06\x03\xdb\xaa\x47\xac\x14\x4e\xcb\x1c\xf0\xcd\xc0\x4f\x5b\x1c\x5b\x3c\x69\x3d\xe4\x51\x42\xf2\x15\x7c\xa3\x2b\xf0\x04\x0f\xe0\x10\x8b\x6f\xfb\xff\xed\x34\xed\x4a\x42\x46\x73\x28\x28\x83\x8d\x6a\x3e\x75\xaf\x1f\x21\xcc\xe2\x78\x7a\x3b\x73\x5d\x6e\x7a\x51\xaf\x39\x96\xb5\x98\x87\xfb\x6c\xff\x0d\x00\x00\xff\xff\x89\x6c\x55\x1c\x5e\x02\x00\x00") +func _000001_initDownSql() (*asset, error) { + bytes, err := _000001_initDownSqlBytes() + if err != nil { + return nil, err + } -func _000001_init_up_sql() ([]byte, error) { - return bindata_read( - __000001_init_up_sql, + info := bindataFileInfo{name: "000001_init.down.sql", size: 30, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc3, 0xa, 0x75, 0x74, 0x21, 0x4f, 0xed, 0x29, 0xf4, 0xfb, 0x14, 0x9a, 0xda, 0x7a, 0x6c, 0x3b, 0x58, 0x34, 0x7c, 0xcd, 0x48, 0xf4, 0x9, 0x5c, 0x96, 0xa1, 0xb9, 0xb2, 0x43, 0xfd, 0x76, 0xa2}} + return a, nil +} + +var __000001_initUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\xd2\xcf\x6f\x9b\x30\x14\x07\xf0\x33\xfc\x15\xef\x82\x00\x89\xf6\xb2\x29\x9a\xba\x93\x4b\x9d\x95\x8d\x1f\x15\xb8\x6b\xb3\x0b\xa5\xf8\xb1\x59\x03\x42\xb1\x23\x2d\xb2\xfc\xbf\x4f\x64\x24\xca\x92\xf4\xc6\x7b\x58\x1f\xbf\xf7\x95\xc3\x9c\x12\x46\x81\x91\xdb\x98\x42\xb4\x84\x34\x63\x40\x9f\xa3\x82\x15\xa0\xf5\xf5\x30\x62\x23\xfe\x18\xf3\xda\xae\xeb\xdf\x12\x3c\xdb\x12\x1c\xbe\x93\x3c\xbc\x27\xb9\xf7\x61\xe1\x07\xb6\xa5\xb5\x68\xe0\x7a\x58\x4b\xf5\x73\x44\x69\x8c\xe8\x25\x8e\xaa\xac\x14\xb0\x28\xa1\x05\x23\xc9\x03\xfb\xb1\x63\xd3\xc7\x38\x86\x3b\xba\x24\x8f\x31\x83\x34\x7b\xf2\xfc\x40\x6b\xec\xb9\x31\x7b\x45\xbe\xb5\x42\xe1\xb1\x71\x47\x18\x9d\x9c\x33\xc0\x2b\x58\xbe\x9c\xfe\x78\xae\xb3\xba\x72\xba\x2b\x87\x83\x73\x7f\xe3\x24\x37\x4e\xe3\x06\xe0\xa6\xd9\x93\xeb\x9f\x5d\xd0\x6d\xe5\x5b\x7b\xc9\xf7\x16\xfe\xe5\x19\x17\x47\xc6\x50\x8d\xd8\xab\xf2\x9d\x08\x66\xfb\x45\xd6\xbf\xb0\xab\x5e\xb4\xc6\x56\xa2\x31\xff\xca\xd9\x80\xdb\xe8\x4b\x94\xb2\xc0\xb6\xd4\x76\x40\x60\xf4\x79\xf7\x2d\x54\x7b\x28\x1a\x81\x2d\x97\x70\x1a\xeb\xd7\x22\x4b\xf7\xe4\x74\x72\x06\x03\xdb\xaa\x47\xac\x14\x4e\xcb\x1c\xf0\xcd\xc0\x4f\x5b\x1c\x5b\x3c\x69\x3d\xe4\x51\x42\xf2\x15\x7c\xa3\x2b\xf0\x04\x0f\xe0\x10\x8b\x6f\xfb\xff\xed\x34\xed\x4a\x42\x46\x73\x28\x28\x83\x8d\x6a\x3e\x75\xaf\x1f\x21\xcc\xe2\x78\x7a\x3b\x73\x5d\x6e\x7a\x51\xaf\x39\x96\xb5\x98\x87\xfb\x6c\xff\x0d\x00\x00\xff\xff\x89\x6c\x55\x1c\x5e\x02\x00\x00") + +func _000001_initUpSqlBytes() ([]byte, error) { + return bindataRead( + __000001_initUpSql, "000001_init.up.sql", ) } -var __000002_system_settings_table_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x2d\xae\x2c\x2e\x49\xcd\x8d\x2f\x4e\x2d\x29\xc9\xcc\x4b\x2f\xb6\xe6\x02\x04\x00\x00\xff\xff\xd2\x63\x5d\x39\x27\x00\x00\x00") +func _000001_initUpSql() (*asset, error) { + bytes, err := _000001_initUpSqlBytes() + if err != nil { + return nil, err + } -func _000002_system_settings_table_down_sql() ([]byte, error) { - return bindata_read( - __000002_system_settings_table_down_sql, + info := bindataFileInfo{name: "000001_init.up.sql", size: 606, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x43, 0xd1, 0x62, 0x7b, 0x92, 0x98, 0x5d, 0x31, 0x51, 0x2c, 0xcc, 0xbe, 0x31, 0x80, 0x5a, 0xa1, 0xec, 0x9e, 0x99, 0x3f, 0x18, 0xe6, 0x1f, 0xfe, 0x15, 0x1d, 0x27, 0x2b, 0x3f, 0xc6, 0x45, 0x5f}} + return a, nil +} + +var __000002_system_settings_tableDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x2d\xae\x2c\x2e\x49\xcd\x8d\x2f\x4e\x2d\x29\xc9\xcc\x4b\x2f\xb6\xe6\x02\x04\x00\x00\xff\xff\xd2\x63\x5d\x39\x27\x00\x00\x00") + +func _000002_system_settings_tableDownSqlBytes() ([]byte, error) { + return bindataRead( + __000002_system_settings_tableDownSql, "000002_system_settings_table.down.sql", ) } -var __000002_system_settings_table_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x2c\xce\x4f\x6b\x83\x30\x18\x80\xf1\xb3\xf9\x14\xef\x51\x41\xc4\xc1\x0e\x83\x9d\xb2\xf0\x8e\xc9\xdc\x2c\xf1\xa5\xe8\x49\x5a\x13\x4b\x40\xed\x9f\xc4\x52\x09\xf9\xee\x45\xe8\xf1\x39\x3c\xf0\x13\x12\x39\x21\x10\xff\x2a\x11\x8a\x6f\xf8\xaf\x08\xb0\x29\x6a\xaa\xc1\xfb\xec\x72\xd3\x83\x79\x84\x60\x57\xeb\xf4\xd4\x59\xed\x9c\x99\x4f\x16\x62\x16\x19\x05\x7b\x2e\xc5\x0f\x97\xf1\x5b\x9e\x27\x29\x8b\xee\x87\x71\xd1\x40\xd8\x50\xca\xa2\x9d\x2c\xfe\xb8\x6c\xe1\x17\x5b\x88\x8d\x4a\x58\xe2\xbd\x19\x20\x9b\x56\x7b\x1d\x43\xd8\x3e\x2e\x08\x25\xd4\x48\xb0\xb8\xe1\x63\x3a\xbe\x83\xa8\xca\x72\xd3\xbc\xba\x5b\x66\xd3\x9f\x95\xee\x7a\xe3\xbd\x9e\x55\x08\x9f\xec\x19\x00\x00\xff\xff\x8e\xa2\x4f\x97\xb0\x00\x00\x00") +func _000002_system_settings_tableDownSql() (*asset, error) { + bytes, err := _000002_system_settings_tableDownSqlBytes() + if err != nil { + return nil, err + } -func _000002_system_settings_table_up_sql() ([]byte, error) { - return bindata_read( - __000002_system_settings_table_up_sql, + info := bindataFileInfo{name: "000002_system_settings_table.down.sql", size: 39, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x28, 0x3, 0x29, 0x5d, 0x28, 0xad, 0x1c, 0x15, 0xd, 0x2e, 0x84, 0xc8, 0xda, 0x3a, 0xd, 0x2f, 0xd8, 0x1e, 0xd1, 0x7f, 0xa1, 0xa1, 0x8d, 0x8b, 0xf3, 0x71, 0xa5, 0xc, 0x2d, 0x3a, 0x61, 0x62}} + return a, nil +} + +var __000002_system_settings_tableUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x2c\xce\x4f\x6b\x83\x30\x18\x80\xf1\xb3\xf9\x14\xef\x51\x41\xc4\xc1\x0e\x83\x9d\xb2\xf0\x8e\xc9\xdc\x2c\xf1\xa5\xe8\x49\x5a\x13\x4b\x40\xed\x9f\xc4\x52\x09\xf9\xee\x45\xe8\xf1\x39\x3c\xf0\x13\x12\x39\x21\x10\xff\x2a\x11\x8a\x6f\xf8\xaf\x08\xb0\x29\x6a\xaa\xc1\xfb\xec\x72\xd3\x83\x79\x84\x60\x57\xeb\xf4\xd4\x59\xed\x9c\x99\x4f\x16\x62\x16\x19\x05\x7b\x2e\xc5\x0f\x97\xf1\x5b\x9e\x27\x29\x8b\xee\x87\x71\xd1\x40\xd8\x50\xca\xa2\x9d\x2c\xfe\xb8\x6c\xe1\x17\x5b\x88\x8d\x4a\x58\xe2\xbd\x19\x20\x9b\x56\x7b\x1d\x43\xd8\x3e\x2e\x08\x25\xd4\x48\xb0\xb8\xe1\x63\x3a\xbe\x83\xa8\xca\x72\xd3\xbc\xba\x5b\x66\xd3\x9f\x95\xee\x7a\xe3\xbd\x9e\x55\x08\x9f\xec\x19\x00\x00\xff\xff\x8e\xa2\x4f\x97\xb0\x00\x00\x00") + +func _000002_system_settings_tableUpSqlBytes() ([]byte, error) { + return bindataRead( + __000002_system_settings_tableUpSql, "000002_system_settings_table.up.sql", ) } -var __000003_blocks_rootid_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x4d\xca\xc9\x4f\xce\x2e\xe6\x72\x09\xf2\x0f\x50\x70\xf6\xf7\x09\xf5\xf5\x53\x28\xca\xcf\x2f\x89\xcf\x4c\xb1\xe6\x02\x04\x00\x00\xff\xff\x51\xe5\xe2\x3a\x33\x00\x00\x00") +func _000002_system_settings_tableUpSql() (*asset, error) { + bytes, err := _000002_system_settings_tableUpSqlBytes() + if err != nil { + return nil, err + } -func _000003_blocks_rootid_down_sql() ([]byte, error) { - return bindata_read( - __000003_blocks_rootid_down_sql, + info := bindataFileInfo{name: "000002_system_settings_table.up.sql", size: 176, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x40, 0x72, 0x7d, 0x99, 0x40, 0xa5, 0xcd, 0xcf, 0xb, 0x99, 0x78, 0xdc, 0x9f, 0x42, 0x2d, 0x60, 0x6, 0x7c, 0x77, 0x5b, 0x8, 0x1c, 0x2, 0x4f, 0x70, 0x57, 0x29, 0xfb, 0x24, 0x7f, 0x13, 0xce}} + return a, nil +} + +var __000003_blocks_rootidDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x4d\xca\xc9\x4f\xce\x2e\xe6\x72\x09\xf2\x0f\x50\x70\xf6\xf7\x09\xf5\xf5\x53\x28\xca\xcf\x2f\x89\xcf\x4c\xb1\xe6\x02\x04\x00\x00\xff\xff\x51\xe5\xe2\x3a\x33\x00\x00\x00") + +func _000003_blocks_rootidDownSqlBytes() ([]byte, error) { + return bindataRead( + __000003_blocks_rootidDownSql, "000003_blocks_rootid.down.sql", ) } -var __000003_blocks_rootid_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x4d\xca\xc9\x4f\xce\x2e\xe6\x72\x74\x71\x51\x70\xf6\xf7\x09\xf5\xf5\x53\x28\xca\xcf\x2f\x89\xcf\x4c\x51\x08\x73\x0c\x72\xf6\x70\x0c\xd2\x30\x36\xd3\xb4\xe6\x02\x04\x00\x00\xff\xff\xc2\x68\x66\x83\x3e\x00\x00\x00") +func _000003_blocks_rootidDownSql() (*asset, error) { + bytes, err := _000003_blocks_rootidDownSqlBytes() + if err != nil { + return nil, err + } -func _000003_blocks_rootid_up_sql() ([]byte, error) { - return bindata_read( - __000003_blocks_rootid_up_sql, + info := bindataFileInfo{name: "000003_blocks_rootid.down.sql", size: 51, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xdb, 0xfc, 0x77, 0x1b, 0xf7, 0x2e, 0x8c, 0xe9, 0x96, 0x14, 0x46, 0xde, 0xdc, 0x63, 0x52, 0x28, 0x40, 0xa6, 0x92, 0xda, 0x8c, 0x1, 0x31, 0x7, 0xa6, 0x61, 0x8a, 0x57, 0x6c, 0x58, 0x88, 0xe3}} + return a, nil +} + +var __000003_blocks_rootidUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x4d\xca\xc9\x4f\xce\x2e\xe6\x72\x74\x71\x51\x70\xf6\xf7\x09\xf5\xf5\x53\x28\xca\xcf\x2f\x89\xcf\x4c\x51\x08\x73\x0c\x72\xf6\x70\x0c\xd2\x30\x36\xd3\xb4\xe6\x02\x04\x00\x00\xff\xff\xc2\x68\x66\x83\x3e\x00\x00\x00") + +func _000003_blocks_rootidUpSqlBytes() ([]byte, error) { + return bindataRead( + __000003_blocks_rootidUpSql, "000003_blocks_rootid.up.sql", ) } -var __000004_auth_table_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x2d\x2d\x4e\x2d\x2a\xb6\xe6\xc2\x2e\x59\x9c\x5a\x5c\x9c\x99\x9f\x57\x6c\xcd\x05\x08\x00\x00\xff\xff\xb6\xc1\x44\xa1\x3d\x00\x00\x00") +func _000003_blocks_rootidUpSql() (*asset, error) { + bytes, err := _000003_blocks_rootidUpSqlBytes() + if err != nil { + return nil, err + } -func _000004_auth_table_down_sql() ([]byte, error) { - return bindata_read( - __000004_auth_table_down_sql, + info := bindataFileInfo{name: "000003_blocks_rootid.up.sql", size: 62, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe1, 0x4c, 0xe5, 0xb, 0xa4, 0x83, 0xfc, 0x49, 0x39, 0x1d, 0x5b, 0xd0, 0xcf, 0xa3, 0x5e, 0x1f, 0x5c, 0x90, 0x97, 0x13, 0x1c, 0xcc, 0xd3, 0x6f, 0x3f, 0xa5, 0x6, 0x67, 0xfd, 0x4d, 0xc0, 0x55}} + return a, nil +} + +var __000004_auth_tableDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x2d\x2d\x4e\x2d\x2a\xb6\xe6\xc2\x2e\x59\x9c\x5a\x5c\x9c\x99\x9f\x57\x6c\xcd\x05\x08\x00\x00\xff\xff\xb6\xc1\x44\xa1\x3d\x00\x00\x00") + +func _000004_auth_tableDownSqlBytes() ([]byte, error) { + return bindataRead( + __000004_auth_tableDownSql, "000004_auth_table.down.sql", ) } -var __000004_auth_table_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x91\x4d\x4b\x33\x31\x14\x85\xd7\x9d\x5f\x71\x97\x2d\x94\xd2\xb7\xbc\x05\xc1\xd5\x74\x88\x3a\x5a\x5b\x99\x09\xd2\xae\x86\x38\xb9\xa3\xc1\xf9\x32\x37\xe3\x07\x21\xff\x5d\x42\x8b\x85\x4e\x05\x37\xcd\x2e\xcf\x49\x72\x6e\xce\x89\x12\x16\x72\x06\x3c\x5c\x2c\x19\xc4\x57\xb0\x5a\x73\x60\x9b\x38\xe5\x29\x58\x3b\x69\x35\x16\xea\xd3\xb9\x8e\x50\x13\x0c\x83\x81\x92\xf0\x18\x26\xd1\x4d\x98\x0c\xff\x4d\xa7\xa3\x71\x30\xf0\x52\x2d\x2a\x3c\xe6\x58\x09\x55\xfe\xc0\xd9\x7c\xee\x61\x2b\x88\x3e\x1a\xdd\x7b\xa4\x2a\x44\x46\x98\x6b\x34\xc7\x8a\xe8\xcc\x4b\x46\xa8\xdf\x55\x7e\xb0\x98\x1d\x24\x29\x8c\xe8\xb9\xe8\xa6\x25\xd8\x2d\x6b\x55\x01\x93\xb6\x21\xf3\xac\x91\x9c\xbb\x4d\xd7\x2b\x6b\xb1\x24\x74\x8e\xb3\x0d\xb7\x16\x6b\xe9\xdc\x38\x18\xe4\x1a\x85\xc1\x4c\x18\x7f\x6d\x11\x5f\xc7\x2b\xee\xbf\xd7\xca\x13\x54\x62\x89\x7d\xfa\x90\xc4\xf7\x61\xb2\x85\x3b\xb6\x85\xa1\x92\xa3\x60\xb4\x73\xaf\xbe\xe8\xad\x74\xce\x8f\x18\x46\x9c\x25\x90\x32\x0e\x9d\x29\x2e\xaa\xa7\xff\x10\xad\x97\x4b\xdf\xc0\x7e\x9f\x75\xb5\xca\x1b\x89\x59\xae\xf6\xa3\x5d\x06\xc1\xdf\x4a\x22\x24\x52\x4d\xfd\x4b\x4f\xa6\x79\xc5\xfa\x54\x79\x59\xff\xec\xf9\x03\x3c\x57\x54\xdf\x01\x00\x00\xff\xff\xdb\x28\x46\xba\xcf\x02\x00\x00") +func _000004_auth_tableDownSql() (*asset, error) { + bytes, err := _000004_auth_tableDownSqlBytes() + if err != nil { + return nil, err + } -func _000004_auth_table_up_sql() ([]byte, error) { - return bindata_read( - __000004_auth_table_up_sql, + info := bindataFileInfo{name: "000004_auth_table.down.sql", size: 61, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7a, 0xd8, 0xba, 0x1, 0x9f, 0x51, 0xfb, 0x45, 0xd8, 0x3, 0xd8, 0xf7, 0x73, 0xee, 0x74, 0x38, 0x32, 0x52, 0x74, 0x99, 0xb7, 0xda, 0xc6, 0x7c, 0xcb, 0xe1, 0x68, 0x6a, 0x88, 0xea, 0x82, 0x70}} + return a, nil +} + +var __000004_auth_tableUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x91\x4d\x4b\x33\x31\x14\x85\xd7\x9d\x5f\x71\x97\x2d\x94\xd2\xb7\xbc\x05\xc1\xd5\x74\x88\x3a\x5a\x5b\x99\x09\xd2\xae\x86\x38\xb9\xa3\xc1\xf9\x32\x37\xe3\x07\x21\xff\x5d\x42\x8b\x85\x4e\x05\x37\xcd\x2e\xcf\x49\x72\x6e\xce\x89\x12\x16\x72\x06\x3c\x5c\x2c\x19\xc4\x57\xb0\x5a\x73\x60\x9b\x38\xe5\x29\x58\x3b\x69\x35\x16\xea\xd3\xb9\x8e\x50\x13\x0c\x83\x81\x92\xf0\x18\x26\xd1\x4d\x98\x0c\xff\x4d\xa7\xa3\x71\x30\xf0\x52\x2d\x2a\x3c\xe6\x58\x09\x55\xfe\xc0\xd9\x7c\xee\x61\x2b\x88\x3e\x1a\xdd\x7b\xa4\x2a\x44\x46\x98\x6b\x34\xc7\x8a\xe8\xcc\x4b\x46\xa8\xdf\x55\x7e\xb0\x98\x1d\x24\x29\x8c\xe8\xb9\xe8\xa6\x25\xd8\x2d\x6b\x55\x01\x93\xb6\x21\xf3\xac\x91\x9c\xbb\x4d\xd7\x2b\x6b\xb1\x24\x74\x8e\xb3\x0d\xb7\x16\x6b\xe9\xdc\x38\x18\xe4\x1a\x85\xc1\x4c\x18\x7f\x6d\x11\x5f\xc7\x2b\xee\xbf\xd7\xca\x13\x54\x62\x89\x7d\xfa\x90\xc4\xf7\x61\xb2\x85\x3b\xb6\x85\xa1\x92\xa3\x60\xb4\x73\xaf\xbe\xe8\xad\x74\xce\x8f\x18\x46\x9c\x25\x90\x32\x0e\x9d\x29\x2e\xaa\xa7\xff\x10\xad\x97\x4b\xdf\xc0\x7e\x9f\x75\xb5\xca\x1b\x89\x59\xae\xf6\xa3\x5d\x06\xc1\xdf\x4a\x22\x24\x52\x4d\xfd\x4b\x4f\xa6\x79\xc5\xfa\x54\x79\x59\xff\xec\xf9\x03\x3c\x57\x54\xdf\x01\x00\x00\xff\xff\xdb\x28\x46\xba\xcf\x02\x00\x00") + +func _000004_auth_tableUpSqlBytes() ([]byte, error) { + return bindataRead( + __000004_auth_tableUpSql, "000004_auth_table.up.sql", ) } -var __000005_blocks_modifiedby_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x4d\xca\xc9\x4f\xce\x2e\xe6\x72\x09\xf2\x0f\x50\x70\xf6\xf7\x09\xf5\xf5\x53\xc8\xcd\x4f\xc9\x4c\xcb\x4c\x4d\x89\x4f\xaa\xb4\xe6\x02\x04\x00\x00\xff\xff\x6a\xfe\x38\x0a\x37\x00\x00\x00") +func _000004_auth_tableUpSql() (*asset, error) { + bytes, err := _000004_auth_tableUpSqlBytes() + if err != nil { + return nil, err + } -func _000005_blocks_modifiedby_down_sql() ([]byte, error) { - return bindata_read( - __000005_blocks_modifiedby_down_sql, + info := bindataFileInfo{name: "000004_auth_table.up.sql", size: 719, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xae, 0x2a, 0x2f, 0x56, 0xeb, 0xae, 0x3, 0xbc, 0x18, 0xe5, 0xd4, 0x55, 0x31, 0x7c, 0x3c, 0x5a, 0x11, 0x56, 0x3, 0xe3, 0x9d, 0xa6, 0xe2, 0xcc, 0x90, 0x99, 0x5c, 0x29, 0xc0, 0x7b, 0x3d, 0x4e}} + return a, nil +} + +var __000005_blocks_modifiedbyDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x4d\xca\xc9\x4f\xce\x2e\xe6\x72\x09\xf2\x0f\x50\x70\xf6\xf7\x09\xf5\xf5\x53\xc8\xcd\x4f\xc9\x4c\xcb\x4c\x4d\x89\x4f\xaa\xb4\xe6\x02\x04\x00\x00\xff\xff\x6a\xfe\x38\x0a\x37\x00\x00\x00") + +func _000005_blocks_modifiedbyDownSqlBytes() ([]byte, error) { + return bindataRead( + __000005_blocks_modifiedbyDownSql, "000005_blocks_modifiedby.down.sql", ) } -var __000005_blocks_modifiedby_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x4d\xca\xc9\x4f\xce\x2e\xe6\x72\x74\x71\x51\x70\xf6\xf7\x09\xf5\xf5\x53\xc8\xcd\x4f\xc9\x4c\xcb\x4c\x4d\x89\x4f\xaa\x54\x08\x73\x0c\x72\xf6\x70\x0c\xd2\x30\x36\xd3\xb4\xe6\x02\x04\x00\x00\xff\xff\x30\x55\xd2\xd8\x42\x00\x00\x00") +func _000005_blocks_modifiedbyDownSql() (*asset, error) { + bytes, err := _000005_blocks_modifiedbyDownSqlBytes() + if err != nil { + return nil, err + } -func _000005_blocks_modifiedby_up_sql() ([]byte, error) { - return bindata_read( - __000005_blocks_modifiedby_up_sql, + info := bindataFileInfo{name: "000005_blocks_modifiedby.down.sql", size: 55, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x76, 0x4b, 0x62, 0xaa, 0x59, 0xd0, 0x49, 0xb4, 0x9f, 0x2e, 0xfd, 0xe7, 0xad, 0x59, 0x4b, 0xb7, 0x8d, 0x94, 0xa2, 0x87, 0x42, 0xd3, 0x68, 0xc9, 0x61, 0x59, 0x8d, 0x68, 0xff, 0x3b, 0xd5, 0xdb}} + return a, nil +} + +var __000005_blocks_modifiedbyUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x4d\xca\xc9\x4f\xce\x2e\xe6\x72\x74\x71\x51\x70\xf6\xf7\x09\xf5\xf5\x53\xc8\xcd\x4f\xc9\x4c\xcb\x4c\x4d\x89\x4f\xaa\x54\x08\x73\x0c\x72\xf6\x70\x0c\xd2\x30\x36\xd3\xb4\xe6\x02\x04\x00\x00\xff\xff\x30\x55\xd2\xd8\x42\x00\x00\x00") + +func _000005_blocks_modifiedbyUpSqlBytes() ([]byte, error) { + return bindataRead( + __000005_blocks_modifiedbyUpSql, "000005_blocks_modifiedby.up.sql", ) } -var __000006_sharing_table_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x2d\xce\x48\x2c\xca\xcc\x4b\xb7\xe6\x02\x04\x00\x00\xff\xff\x7a\x74\xe5\xab\x1f\x00\x00\x00") +func _000005_blocks_modifiedbyUpSql() (*asset, error) { + bytes, err := _000005_blocks_modifiedbyUpSqlBytes() + if err != nil { + return nil, err + } -func _000006_sharing_table_down_sql() ([]byte, error) { - return bindata_read( - __000006_sharing_table_down_sql, + info := bindataFileInfo{name: "000005_blocks_modifiedby.up.sql", size: 66, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8e, 0x1, 0xd8, 0x3, 0x3a, 0xc0, 0x92, 0x34, 0xa8, 0xd, 0x85, 0x3, 0x86, 0x9c, 0x16, 0x13, 0x2f, 0x83, 0xc7, 0x70, 0xed, 0xcb, 0x63, 0xca, 0xba, 0xd5, 0x94, 0x99, 0x39, 0xfd, 0xf8, 0x35}} + return a, nil +} + +var __000006_sharing_tableDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x2d\xce\x48\x2c\xca\xcc\x4b\xb7\xe6\x02\x04\x00\x00\xff\xff\x7a\x74\xe5\xab\x1f\x00\x00\x00") + +func _000006_sharing_tableDownSqlBytes() ([]byte, error) { + return bindataRead( + __000006_sharing_tableDownSql, "000006_sharing_table.down.sql", ) } -var __000006_sharing_table_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x5c\xcf\x51\x4b\x84\x40\x14\x05\xe0\x67\xe7\x57\xdc\x47\x05\x59\x36\x8a\x08\x7a\x1a\x65\xaa\x21\xd3\x18\x87\x68\x9f\x44\xf7\x5e\xeb\xd2\x3a\x6e\xbb\x0a\xc9\x30\xff\x3d\x84\xe8\x61\x1f\x0f\x7c\xe7\xc0\xc9\x8d\x92\x56\x81\x95\x59\xa1\x40\x3f\x40\x59\x59\x50\xef\xba\xb6\x35\x78\xbf\x39\x9e\xa8\xe7\x9f\x10\xce\x9f\xed\x89\xdd\x07\xc4\x22\x62\x84\x37\x69\xf2\x27\x69\xe2\xeb\xdb\x24\x15\x11\xb9\xb6\x3b\x10\x42\x56\x55\x85\x92\x65\x2a\xa2\x69\xfc\x22\xf7\xaf\xae\xb6\xdb\x95\x0d\x23\x72\xcf\x84\x4d\xb7\x5c\x0c\xcc\x47\x6c\x27\x6a\xda\x09\x32\xfd\xa8\x4b\x9b\x8a\xe8\xd5\xe8\x17\x69\x76\xf0\xac\x76\x10\x33\x26\x22\xf1\x9e\x7b\xd8\x0c\xcb\xf9\xfb\x10\xc2\x5a\x96\xb9\x55\x06\x6a\x65\x61\x9e\xfa\xbb\xa1\xbb\x81\xbc\x2a\x8a\xf5\xcb\x5f\x6e\x66\xc7\xfb\x11\xa9\xd9\xb3\xf7\xe4\x30\x84\x7b\xf1\x1b\x00\x00\xff\xff\xc9\xca\x17\x02\xee\x00\x00\x00") +func _000006_sharing_tableDownSql() (*asset, error) { + bytes, err := _000006_sharing_tableDownSqlBytes() + if err != nil { + return nil, err + } -func _000006_sharing_table_up_sql() ([]byte, error) { - return bindata_read( - __000006_sharing_table_up_sql, + info := bindataFileInfo{name: "000006_sharing_table.down.sql", size: 31, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x31, 0x98, 0x81, 0xe, 0xc8, 0x13, 0xd0, 0x6a, 0x21, 0xec, 0x11, 0x2b, 0x65, 0x78, 0x8b, 0x69, 0x2e, 0x94, 0xa2, 0xe7, 0xf9, 0xc4, 0xbd, 0x18, 0xfc, 0x2, 0x2, 0x5b, 0xc5, 0xdc, 0x78, 0x38}} + return a, nil +} + +var __000006_sharing_tableUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x5c\xcf\x51\x4b\x84\x40\x14\x05\xe0\x67\xe7\x57\xdc\x47\x05\x59\x36\x8a\x08\x7a\x1a\x65\xaa\x21\xd3\x18\x87\x68\x9f\x44\xf7\x5e\xeb\xd2\x3a\x6e\xbb\x0a\xc9\x30\xff\x3d\x84\xe8\x61\x1f\x0f\x7c\xe7\xc0\xc9\x8d\x92\x56\x81\x95\x59\xa1\x40\x3f\x40\x59\x59\x50\xef\xba\xb6\x35\x78\xbf\x39\x9e\xa8\xe7\x9f\x10\xce\x9f\xed\x89\xdd\x07\xc4\x22\x62\x84\x37\x69\xf2\x27\x69\xe2\xeb\xdb\x24\x15\x11\xb9\xb6\x3b\x10\x42\x56\x55\x85\x92\x65\x2a\xa2\x69\xfc\x22\xf7\xaf\xae\xb6\xdb\x95\x0d\x23\x72\xcf\x84\x4d\xb7\x5c\x0c\xcc\x47\x6c\x27\x6a\xda\x09\x32\xfd\xa8\x4b\x9b\x8a\xe8\xd5\xe8\x17\x69\x76\xf0\xac\x76\x10\x33\x26\x22\xf1\x9e\x7b\xd8\x0c\xcb\xf9\xfb\x10\xc2\x5a\x96\xb9\x55\x06\x6a\x65\x61\x9e\xfa\xbb\xa1\xbb\x81\xbc\x2a\x8a\xf5\xcb\x5f\x6e\x66\xc7\xfb\x11\xa9\xd9\xb3\xf7\xe4\x30\x84\x7b\xf1\x1b\x00\x00\xff\xff\xc9\xca\x17\x02\xee\x00\x00\x00") + +func _000006_sharing_tableUpSqlBytes() ([]byte, error) { + return bindataRead( + __000006_sharing_tableUpSql, "000006_sharing_table.up.sql", ) } -var __000007_workspaces_table_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x2d\xcf\x2f\xca\x2e\x2e\x48\x4c\x4e\x2d\xb6\xe6\x02\x04\x00\x00\xff\xff\x1a\xe4\xe6\x36\x22\x00\x00\x00") +func _000006_sharing_tableUpSql() (*asset, error) { + bytes, err := _000006_sharing_tableUpSqlBytes() + if err != nil { + return nil, err + } -func _000007_workspaces_table_down_sql() ([]byte, error) { - return bindata_read( - __000007_workspaces_table_down_sql, + info := bindataFileInfo{name: "000006_sharing_table.up.sql", size: 238, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc2, 0x4f, 0x32, 0xd, 0xa9, 0xaf, 0x1d, 0x24, 0xb4, 0x4c, 0x57, 0x8e, 0x73, 0xa9, 0xb7, 0xd1, 0xd1, 0xb7, 0x38, 0x71, 0xd7, 0x56, 0x15, 0xdb, 0xdf, 0xf4, 0x9b, 0xa2, 0xc9, 0x8e, 0x73, 0x2b}} + return a, nil +} + +var __000007_workspaces_tableDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x2d\xcf\x2f\xca\x2e\x2e\x48\x4c\x4e\x2d\xb6\xe6\x02\x04\x00\x00\xff\xff\x1a\xe4\xe6\x36\x22\x00\x00\x00") + +func _000007_workspaces_tableDownSqlBytes() ([]byte, error) { + return bindataRead( + __000007_workspaces_tableDownSql, "000007_workspaces_table.down.sql", ) } -var __000007_workspaces_table_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x5c\x8f\x51\x4f\x83\x30\x14\x85\x9f\xe9\xaf\xb8\x8f\x90\x90\x65\x46\x63\x4c\x7c\xea\x48\x55\x14\xc1\x94\x6a\xb6\x27\xc2\xe8\x85\x34\x1b\x50\x69\x89\x2e\x4d\xff\xbb\x41\x17\x1f\xf6\x78\x73\xcf\x39\xdf\x39\x09\x67\x54\x30\x10\x74\x93\x31\x48\x1f\x20\x2f\x04\xb0\x6d\x5a\x8a\x12\x9c\x5b\xe9\x09\x5b\xf5\xed\xfd\xd7\x38\x1d\x8c\xae\x1b\x34\x10\x92\x40\x49\xf8\xa0\x3c\x79\xa2\x3c\xbc\xbe\x8d\x62\x12\x18\xd5\x0d\xb3\xae\xec\x78\xc0\xe1\xff\x75\xb5\x5e\x47\xbf\x71\xf9\x7b\x96\x2d\x22\xb4\x56\x0d\x9d\x01\xe7\x54\x0b\x2b\x3d\x1a\xdb\x4d\x68\xbc\x7f\x2e\x8b\xdc\x39\x3c\x1a\xf4\x5e\xb0\xad\x70\x0e\x07\xe9\x7d\x4c\x82\x7e\x94\xaa\x55\x28\xab\xfd\xe9\x82\x38\x6b\x59\x5b\xac\x6a\x0b\x9b\xf4\x31\xcd\x45\x4c\x82\x37\x9e\xbe\x52\xbe\x83\x17\xb6\x83\x50\xc9\x88\x44\x7f\xa0\xfe\x64\x3e\x8f\xde\x2f\x66\x9a\x08\xc6\xa1\x64\x02\x66\xdb\xde\xf5\xfb\x1b\x48\x8a\x2c\x5b\xf6\x9f\xef\x6a\x1e\x54\x33\x4a\xac\x1a\x75\x6e\x71\x4f\x7e\x02\x00\x00\xff\xff\x26\xb1\xb4\x1a\x22\x01\x00\x00") +func _000007_workspaces_tableDownSql() (*asset, error) { + bytes, err := _000007_workspaces_tableDownSqlBytes() + if err != nil { + return nil, err + } -func _000007_workspaces_table_up_sql() ([]byte, error) { - return bindata_read( - __000007_workspaces_table_up_sql, + info := bindataFileInfo{name: "000007_workspaces_table.down.sql", size: 34, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfc, 0xb1, 0x2b, 0x90, 0x8a, 0xcb, 0xe0, 0xd8, 0x87, 0x62, 0xcf, 0x86, 0x6b, 0xc9, 0x9c, 0x86, 0x21, 0xa4, 0x87, 0xad, 0x47, 0x49, 0xc5, 0x49, 0x34, 0xe2, 0x24, 0x49, 0x4e, 0x9a, 0x3d, 0x5a}} + return a, nil +} + +var __000007_workspaces_tableUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x5c\x8f\x51\x4f\x83\x30\x14\x85\x9f\xe9\xaf\xb8\x8f\x90\x90\x65\x46\x63\x4c\x7c\xea\x48\x55\x14\xc1\x94\x6a\xb6\x27\xc2\xe8\x85\x34\x1b\x50\x69\x89\x2e\x4d\xff\xbb\x41\x17\x1f\xf6\x78\x73\xcf\x39\xdf\x39\x09\x67\x54\x30\x10\x74\x93\x31\x48\x1f\x20\x2f\x04\xb0\x6d\x5a\x8a\x12\x9c\x5b\xe9\x09\x5b\xf5\xed\xfd\xd7\x38\x1d\x8c\xae\x1b\x34\x10\x92\x40\x49\xf8\xa0\x3c\x79\xa2\x3c\xbc\xbe\x8d\x62\x12\x18\xd5\x0d\xb3\xae\xec\x78\xc0\xe1\xff\x75\xb5\x5e\x47\xbf\x71\xf9\x7b\x96\x2d\x22\xb4\x56\x0d\x9d\x01\xe7\x54\x0b\x2b\x3d\x1a\xdb\x4d\x68\xbc\x7f\x2e\x8b\xdc\x39\x3c\x1a\xf4\x5e\xb0\xad\x70\x0e\x07\xe9\x7d\x4c\x82\x7e\x94\xaa\x55\x28\xab\xfd\xe9\x82\x38\x6b\x59\x5b\xac\x6a\x0b\x9b\xf4\x31\xcd\x45\x4c\x82\x37\x9e\xbe\x52\xbe\x83\x17\xb6\x83\x50\xc9\x88\x44\x7f\xa0\xfe\x64\x3e\x8f\xde\x2f\x66\x9a\x08\xc6\xa1\x64\x02\x66\xdb\xde\xf5\xfb\x1b\x48\x8a\x2c\x5b\xf6\x9f\xef\x6a\x1e\x54\x33\x4a\xac\x1a\x75\x6e\x71\x4f\x7e\x02\x00\x00\xff\xff\x26\xb1\xb4\x1a\x22\x01\x00\x00") + +func _000007_workspaces_tableUpSqlBytes() ([]byte, error) { + return bindataRead( + __000007_workspaces_tableUpSql, "000007_workspaces_table.up.sql", ) } -var __000008_teams_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x4d\xca\xc9\x4f\xce\x2e\xe6\x72\x09\xf2\x0f\x50\x70\xf6\xf7\x09\xf5\xf5\x53\x28\xcf\x2f\xca\x2e\x2e\x48\x4c\x4e\x8d\xcf\x4c\xb1\xe6\xe2\xc2\xa1\xb1\x38\x23\xb1\x28\x33\x2f\x9d\x1c\x9d\xa9\xc5\xc5\x99\xf9\x79\xa8\x96\x26\x96\x96\x64\xc4\x17\xa7\x16\x95\x65\x26\xa7\x5a\x73\x01\x02\x00\x00\xff\xff\x24\x48\xc4\xb6\xad\x00\x00\x00") +func _000007_workspaces_tableUpSql() (*asset, error) { + bytes, err := _000007_workspaces_tableUpSqlBytes() + if err != nil { + return nil, err + } -func _000008_teams_down_sql() ([]byte, error) { - return bindata_read( - __000008_teams_down_sql, + info := bindataFileInfo{name: "000007_workspaces_table.up.sql", size: 290, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6a, 0x56, 0x7c, 0x1c, 0x3f, 0x9c, 0xde, 0x4d, 0x7e, 0x8f, 0xf7, 0xdd, 0x8c, 0x67, 0x79, 0xd6, 0x84, 0x9c, 0x35, 0xd9, 0x38, 0x59, 0xde, 0xed, 0x80, 0xe6, 0xec, 0xb7, 0x20, 0xe6, 0x1d, 0x25}} + return a, nil +} + +var __000008_teamsDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x4d\xca\xc9\x4f\xce\x2e\xe6\x72\x09\xf2\x0f\x50\x70\xf6\xf7\x09\xf5\xf5\x53\x28\xcf\x2f\xca\x2e\x2e\x48\x4c\x4e\x8d\xcf\x4c\xb1\xe6\xe2\xc2\xa1\xb1\x38\x23\xb1\x28\x33\x2f\x9d\x1c\x9d\xa9\xc5\xc5\x99\xf9\x79\xa8\x96\x26\x96\x96\x64\xc4\x17\xa7\x16\x95\x65\x26\xa7\x5a\x73\x01\x02\x00\x00\xff\xff\x24\x48\xc4\xb6\xad\x00\x00\x00") + +func _000008_teamsDownSqlBytes() ([]byte, error) { + return bindataRead( + __000008_teamsDownSql, "000008_teams.down.sql", ) } -var __000008_teams_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x4d\xca\xc9\x4f\xce\x2e\xe6\x72\x74\x71\x51\x70\xf6\xf7\x09\xf5\xf5\x53\x28\xcf\x2f\xca\x2e\x2e\x48\x4c\x4e\x8d\xcf\x4c\x51\x08\x73\x0c\x72\xf6\x70\x0c\xd2\x30\x36\xd3\xb4\xe6\xe2\xc2\x61\x46\x71\x46\x62\x51\x66\x5e\x3a\x85\x86\xa4\x16\x17\x67\xe6\xe7\xa1\x38\x25\xb1\xb4\x24\x23\xbe\x38\xb5\xa8\x2c\x33\x39\x15\x6e\x8a\x91\x01\xc8\x94\xd0\x00\x17\xc7\x10\x2c\x3e\x51\x08\x76\x0d\x41\xb5\xdd\x56\x41\xdd\x40\x5d\x21\xdc\xc3\x35\xc8\x15\x43\x42\x5d\xc1\x3f\x08\x55\xd0\x33\x58\xc1\x2f\xd4\xc7\xc7\x9a\x0b\x10\x00\x00\xff\xff\xab\x8d\x48\xa9\x30\x01\x00\x00") +func _000008_teamsDownSql() (*asset, error) { + bytes, err := _000008_teamsDownSqlBytes() + if err != nil { + return nil, err + } -func _000008_teams_up_sql() ([]byte, error) { - return bindata_read( - __000008_teams_up_sql, + info := bindataFileInfo{name: "000008_teams.down.sql", size: 173, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x71, 0xde, 0xad, 0x3b, 0xef, 0xf1, 0xd1, 0x17, 0x44, 0xee, 0x1d, 0x30, 0x33, 0x15, 0xa9, 0x84, 0x99, 0xe7, 0x6e, 0xbf, 0x8c, 0xa4, 0x4, 0xd6, 0x68, 0xab, 0x77, 0x68, 0x13, 0x74, 0x1, 0x5d}} + return a, nil +} + +var __000008_teamsUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x4d\xca\xc9\x4f\xce\x2e\xe6\x72\x74\x71\x51\x70\xf6\xf7\x09\xf5\xf5\x53\x28\xcf\x2f\xca\x2e\x2e\x48\x4c\x4e\x8d\xcf\x4c\x51\x08\x73\x0c\x72\xf6\x70\x0c\xd2\x30\x36\xd3\xb4\xe6\xe2\xc2\x61\x46\x71\x46\x62\x51\x66\x5e\x3a\x85\x86\xa4\x16\x17\x67\xe6\xe7\xa1\x38\x25\xb1\xb4\x24\x23\xbe\x38\xb5\xa8\x2c\x33\x39\x15\x6e\x8a\x91\x01\xc8\x94\xd0\x00\x17\xc7\x10\x2c\x3e\x51\x08\x76\x0d\x41\xb5\xdd\x56\x41\xdd\x40\x5d\x21\xdc\xc3\x35\xc8\x15\x43\x42\x5d\xc1\x3f\x08\x55\xd0\x33\x58\xc1\x2f\xd4\xc7\xc7\x9a\x0b\x10\x00\x00\xff\xff\xab\x8d\x48\xa9\x30\x01\x00\x00") + +func _000008_teamsUpSqlBytes() ([]byte, error) { + return bindataRead( + __000008_teamsUpSql, "000008_teams.up.sql", ) } -var __000009_blocks_history_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x4d\xca\xc9\x4f\xce\x2e\xb6\xe6\x72\xf4\x09\x71\x0d\xc2\x25\x1d\x9f\x91\x59\x5c\x92\x5f\x54\xa9\x10\xe4\xea\xe7\xe8\xeb\xaa\x10\xe2\x8f\xcd\x08\x40\x00\x00\x00\xff\xff\x38\xe5\xec\x7a\x61\x00\x00\x00") +func _000008_teamsUpSql() (*asset, error) { + bytes, err := _000008_teamsUpSqlBytes() + if err != nil { + return nil, err + } -func _000009_blocks_history_down_sql() ([]byte, error) { - return bindata_read( - __000009_blocks_history_down_sql, + info := bindataFileInfo{name: "000008_teams.up.sql", size: 304, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xad, 0x91, 0xe6, 0xdf, 0x66, 0x76, 0x63, 0x68, 0x70, 0x8c, 0x30, 0x66, 0xf0, 0xc3, 0xa8, 0x76, 0xff, 0xe3, 0x59, 0x99, 0x49, 0xd, 0x90, 0xf5, 0xf4, 0x10, 0xeb, 0x6e, 0x0, 0x2c, 0x67, 0xeb}} + return a, nil +} + +var __000009_blocks_historyDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\xa8\xae\xd6\x2b\x28\x4a\x4d\xcb\xac\xa8\xad\x4d\xca\xc9\x4f\xce\x2e\xb6\xe6\x72\xf4\x09\x71\x0d\xc2\x25\x1d\x9f\x91\x59\x5c\x92\x5f\x54\xa9\x10\xe4\xea\xe7\xe8\xeb\xaa\x10\xe2\x8f\xcd\x08\x40\x00\x00\x00\xff\xff\x38\xe5\xec\x7a\x61\x00\x00\x00") + +func _000009_blocks_historyDownSqlBytes() ([]byte, error) { + return bindataRead( + __000009_blocks_historyDownSql, "000009_blocks_history.down.sql", ) } -var __000009_blocks_history_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x93\xd1\x6f\x9b\x3e\x10\xc7\x9f\xc3\x5f\x71\x2f\x28\xf0\x13\xad\x7e\xd2\xa6\x68\x6a\xa4\x49\x84\x5c\x12\x36\xb0\x2b\xe3\xae\xcd\x5e\x68\x02\x66\xb1\x4a\x02\xc5\x44\x5d\x84\xf8\xdf\x27\x3a\x92\xa6\x24\xd1\x1e\xa6\xbd\xf9\x7c\xf6\xe7\xbe\x77\xfe\xda\xf6\x38\x32\xe0\xf6\xc8\x43\xa8\xaa\xeb\xbc\x10\x89\xfc\x59\xd7\xcb\x34\x8b\x9e\x14\x30\x24\xb6\x8f\xc0\xe9\x69\x2e\x5c\x49\x55\x66\xc5\x6e\xa8\x39\x0c\x6d\x8e\x2d\xc3\x9d\x00\xa1\x1c\xf0\xc1\x0d\x78\x70\x86\x68\x68\x3d\x19\xc3\x37\x9b\x39\x33\x9b\x19\x1f\x06\xa6\xa5\xf5\xaa\x4a\x26\x70\x9d\x67\xaa\xfc\x51\x08\x55\xd7\x72\xa3\x44\x51\x86\x8b\x12\xb8\xeb\x63\xc0\x6d\xff\x96\x7f\x7f\xc5\x92\x3b\xcf\x83\x31\x4e\xec\x3b\x8f\x03\xa1\xf7\x86\x69\x55\x95\xd8\xc4\x75\xbd\xa7\xa8\xe7\x54\x96\xe2\x98\x31\xb6\x39\x36\x9c\x13\x80\x11\x70\x36\x69\x32\x46\x5f\x9f\x5f\xe9\xeb\x2b\x3d\x06\x7d\x76\xa3\xfb\x37\x7a\xd2\xb7\xa0\x4f\xe8\x7d\xdf\x3c\x29\xb0\xde\xa9\xe7\xf4\x1c\xdf\x18\x98\xe7\x35\x0e\x8e\x18\xf9\xa2\x10\x9b\x32\xbc\x30\x82\x96\xfd\xa8\xa2\x95\x58\x2f\x1e\xab\x4a\xa4\x4a\xd4\xf5\xef\xb0\x65\xc0\xc8\x9d\xba\x84\x5b\x5a\xaf\xdc\xe5\x02\x38\x3e\xbc\xae\x65\x99\x1e\x82\x44\x8a\x34\x56\xd0\x1d\xeb\x97\x80\x92\x3d\xb2\x39\xd9\x02\x2d\xad\x17\x15\x62\x51\x8a\xa6\x99\x03\x7c\x9b\xc7\xdd\xad\x58\xa4\xa2\xb3\x55\x64\xd9\x99\x66\xd6\x59\x2c\x13\x29\xe2\x70\xb9\xeb\x64\x5e\xb2\xe2\x49\xe5\x8b\x48\x9c\x5e\xba\x65\xae\x6f\xb3\x39\x7c\xc5\x39\x18\xc7\xe7\x2c\x19\x9b\x9a\xf9\x6e\x40\xcd\x35\xdb\x69\x8c\x1b\x20\x87\x6d\x99\x7c\x5a\x2f\x3f\x82\x43\x3d\xaf\x31\x62\x1b\x87\xdb\x8d\x8c\xb2\x58\x84\x91\x6c\x3b\x1d\x6a\xda\x3b\x8c\xe6\x92\x00\x19\x07\x77\x4a\x28\x43\x70\xc9\x39\x9f\x83\x11\xa0\x87\x0e\x87\xff\x60\xc2\xa8\x7f\xf9\x23\x00\x65\x63\x64\x30\x9a\xc3\x91\x37\x30\x70\xcc\xa1\xb6\x7f\xfe\xee\x8b\x1c\x04\xfc\xa3\xca\x40\x09\x38\x94\x4c\x3c\xd7\xe1\x30\xa6\x8d\x3d\x67\x2e\x99\x76\x05\xed\xff\xcc\x5e\x0e\x65\x7f\x18\xc9\x5f\xea\x7a\xab\x3f\x46\x0f\x39\x5e\xc0\xc0\xcb\x4a\x14\x02\xde\x6c\xf7\x19\xfe\x1f\x6a\xbf\x02\x00\x00\xff\xff\xfe\x36\xd4\x6a\xb1\x04\x00\x00") +func _000009_blocks_historyDownSql() (*asset, error) { + bytes, err := _000009_blocks_historyDownSqlBytes() + if err != nil { + return nil, err + } -func _000009_blocks_history_up_sql() ([]byte, error) { - return bindata_read( - __000009_blocks_history_up_sql, + info := bindataFileInfo{name: "000009_blocks_history.down.sql", size: 97, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x78, 0x56, 0x8b, 0xdc, 0x49, 0x6, 0xe2, 0x3a, 0x1f, 0x77, 0xd4, 0xb3, 0xd0, 0x8e, 0xac, 0xb9, 0xfe, 0xa0, 0x69, 0x42, 0x7c, 0xb2, 0x25, 0xa7, 0x1e, 0x29, 0xce, 0xe0, 0x27, 0x38, 0x2, 0x45}} + return a, nil +} + +var __000009_blocks_historyUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x93\xd1\x6f\x9b\x3e\x10\xc7\x9f\xc3\x5f\x71\x2f\x28\xf0\x13\xad\x7e\xd2\xa6\x68\x6a\xa4\x49\x84\x5c\x12\x36\xb0\x2b\xe3\xae\xcd\x5e\x68\x02\x66\xb1\x4a\x02\xc5\x44\x5d\x84\xf8\xdf\x27\x3a\x92\xa6\x24\xd1\x1e\xa6\xbd\xf9\x7c\xf6\xe7\xbe\x77\xfe\xda\xf6\x38\x32\xe0\xf6\xc8\x43\xa8\xaa\xeb\xbc\x10\x89\xfc\x59\xd7\xcb\x34\x8b\x9e\x14\x30\x24\xb6\x8f\xc0\xe9\x69\x2e\x5c\x49\x55\x66\xc5\x6e\xa8\x39\x0c\x6d\x8e\x2d\xc3\x9d\x00\xa1\x1c\xf0\xc1\x0d\x78\x70\x86\x68\x68\x3d\x19\xc3\x37\x9b\x39\x33\x9b\x19\x1f\x06\xa6\xa5\xf5\xaa\x4a\x26\x70\x9d\x67\xaa\xfc\x51\x08\x55\xd7\x72\xa3\x44\x51\x86\x8b\x12\xb8\xeb\x63\xc0\x6d\xff\x96\x7f\x7f\xc5\x92\x3b\xcf\x83\x31\x4e\xec\x3b\x8f\x03\xa1\xf7\x86\x69\x55\x95\xd8\xc4\x75\xbd\xa7\xa8\xe7\x54\x96\xe2\x98\x31\xb6\x39\x36\x9c\x13\x80\x11\x70\x36\x69\x32\x46\x5f\x9f\x5f\xe9\xeb\x2b\x3d\x06\x7d\x76\xa3\xfb\x37\x7a\xd2\xb7\xa0\x4f\xe8\x7d\xdf\x3c\x29\xb0\xde\xa9\xe7\xf4\x1c\xdf\x18\x98\xe7\x35\x0e\x8e\x18\xf9\xa2\x10\x9b\x32\xbc\x30\x82\x96\xfd\xa8\xa2\x95\x58\x2f\x1e\xab\x4a\xa4\x4a\xd4\xf5\xef\xb0\x65\xc0\xc8\x9d\xba\x84\x5b\x5a\xaf\xdc\xe5\x02\x38\x3e\xbc\xae\x65\x99\x1e\x82\x44\x8a\x34\x56\xd0\x1d\xeb\x97\x80\x92\x3d\xb2\x39\xd9\x02\x2d\xad\x17\x15\x62\x51\x8a\xa6\x99\x03\x7c\x9b\xc7\xdd\xad\x58\xa4\xa2\xb3\x55\x64\xd9\x99\x66\xd6\x59\x2c\x13\x29\xe2\x70\xb9\xeb\x64\x5e\xb2\xe2\x49\xe5\x8b\x48\x9c\x5e\xba\x65\xae\x6f\xb3\x39\x7c\xc5\x39\x18\xc7\xe7\x2c\x19\x9b\x9a\xf9\x6e\x40\xcd\x35\xdb\x69\x8c\x1b\x20\x87\x6d\x99\x7c\x5a\x2f\x3f\x82\x43\x3d\xaf\x31\x62\x1b\x87\xdb\x8d\x8c\xb2\x58\x84\x91\x6c\x3b\x1d\x6a\xda\x3b\x8c\xe6\x92\x00\x19\x07\x77\x4a\x28\x43\x70\xc9\x39\x9f\x83\x11\xa0\x87\x0e\x87\xff\x60\xc2\xa8\x7f\xf9\x23\x00\x65\x63\x64\x30\x9a\xc3\x91\x37\x30\x70\xcc\xa1\xb6\x7f\xfe\xee\x8b\x1c\x04\xfc\xa3\xca\x40\x09\x38\x94\x4c\x3c\xd7\xe1\x30\xa6\x8d\x3d\x67\x2e\x99\x76\x05\xed\xff\xcc\x5e\x0e\x65\x7f\x18\xc9\x5f\xea\x7a\xab\x3f\x46\x0f\x39\x5e\xc0\xc0\xcb\x4a\x14\x02\xde\x6c\xf7\x19\xfe\x1f\x6a\xbf\x02\x00\x00\xff\xff\xfe\x36\xd4\x6a\xb1\x04\x00\x00") + +func _000009_blocks_historyUpSqlBytes() ([]byte, error) { + return bindataRead( + __000009_blocks_historyUpSql, "000009_blocks_history.up.sql", ) } -var __000010_blocks_created_by_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x94\x51\x6f\x9b\x30\x10\xc7\xdf\xf9\x14\xf7\x82\x02\x53\x5a\x4d\xda\x54\x4d\x8d\x34\x89\x82\xd3\xb0\x81\x1d\x19\x77\x6d\xf6\x42\x13\x30\x8b\x55\x12\x28\x26\xea\x22\xc4\x77\x9f\x48\x48\x4a\x1a\x92\x6a\x5a\xfa\x32\xf5\xd1\xf6\xdd\xff\x8e\xe3\x7f\x3f\xc3\x61\x88\x02\x33\xae\x1c\x04\x45\x71\x9e\x66\x3c\x12\xbf\xcb\x72\x12\x27\xc1\x83\x04\x8a\xb0\xe1\x22\x60\x64\xff\xcd\x4f\xe2\xb0\xa7\x98\x14\x19\x0c\xd5\xf9\x76\x1f\x30\x61\x80\xee\x6c\x8f\x79\x2d\x6a\x9a\x02\x00\x20\x42\xf8\x61\x50\x73\x60\x50\xed\xd3\x85\xde\x5d\xdd\x15\x85\x88\xe0\x3c\x4d\x64\xfe\x2b\xe3\xb2\x2c\xc5\x5c\xf2\x2c\xf7\xc7\x39\x30\xdb\x45\x1e\x33\xdc\x21\xfb\xb9\x12\xc7\x37\x8e\x03\x16\xea\x1b\x37\x0e\x03\x4c\x6e\x35\xbd\x5b\x14\x7c\x1e\x96\x65\x43\x48\x3e\xc6\x22\xe7\x4d\x19\xcb\x60\xa8\x92\xda\xd3\xd0\x3c\x46\xfb\xd5\x8b\xd6\x51\x47\x67\xea\xec\x4c\x0d\x41\x1d\x5c\xaa\xee\xa5\x1a\x75\xba\xd0\xc1\xe4\xb6\xa3\xb7\xd5\x98\x2d\xe5\x63\xdc\x56\x42\xbb\xd0\xdb\x3b\xbd\xd8\x95\x49\xc7\x19\x9f\xe7\xfe\xe1\x71\xd4\x15\xee\x65\x30\xe5\xb3\xf1\x7d\x51\xf0\x58\xf2\xb2\x5c\x1f\x6b\x25\xb8\xb2\xaf\x6d\xcc\xd6\x69\xf9\x32\xe5\xc0\xd0\xdd\xe6\x28\xf2\xb8\x79\x8e\x04\x8f\x43\xb9\x37\xeb\x6f\x1e\xc1\x1b\xed\x2a\xb8\x56\x5e\xe7\x04\x19\x1f\xe7\xbc\xfa\xbc\x66\xa1\x45\x1a\xb6\xdc\x86\x3c\xe6\xfb\xb7\x59\x92\xb4\x7f\xe4\x2c\x09\x45\x24\x78\xe8\x4f\x96\xfb\x8f\x4f\x49\xf6\x20\xd3\x71\xc0\x5b\x53\x87\xd4\x76\x0d\x3a\x82\xef\x68\x04\x5a\x33\xb4\x2b\x42\x7d\x15\xa1\xef\x8c\xb0\xca\x36\xcc\xca\xe8\x1e\x62\xb0\xc8\xa3\x2f\xb3\xc9\x67\x30\x89\xe3\x54\xe6\xad\xcf\xfe\x62\x2e\x82\x24\xe4\x7e\x20\xea\x11\xf4\x14\x65\x47\x46\xb1\xb1\x87\x28\x03\xfb\x1a\x13\x8a\xc0\xc6\x6d\x7b\x01\x9a\x87\x1c\x64\x32\xf8\x00\x7d\x4a\xdc\xf6\xc5\x01\x42\x2d\x44\xe1\x6a\x04\x0d\xff\x20\xcf\xd4\x7b\xca\xc6\x22\x2f\x7f\xd3\xb6\xf8\x1b\x54\x05\x82\xc1\x24\xb8\xef\xd8\x26\x03\x8b\x54\xf6\x1d\xd8\xf8\xfa\x65\x33\x9b\xb5\xda\xb4\x42\xe8\x2b\xa3\xf8\x87\x9e\x9e\x6b\x5b\xc8\x41\x0c\x1d\x90\x80\xa7\x29\xcf\x78\xc3\x7a\x5f\xe1\x63\x4f\xb1\x28\x19\x1e\x62\xda\x9a\x5b\x8a\x72\x14\x7c\xfe\x54\xc8\x3c\xc9\x96\x47\x01\x58\xc7\xfc\x3d\x08\xb7\xea\xef\x40\x7c\x07\xe2\x7f\x0f\xc4\x67\xb7\xbf\x86\x83\xc6\x42\x9d\x1c\x90\xa7\xed\xe2\x8d\x80\xb9\x6d\xf2\x04\x3d\x36\x00\x7a\x8c\x86\x3b\x10\xfb\x13\x00\x00\xff\xff\xbd\xdd\x75\x63\x0d\x0a\x00\x00") +func _000009_blocks_historyUpSql() (*asset, error) { + bytes, err := _000009_blocks_historyUpSqlBytes() + if err != nil { + return nil, err + } -func _000010_blocks_created_by_down_sql() ([]byte, error) { - return bindata_read( - __000010_blocks_created_by_down_sql, + info := bindataFileInfo{name: "000009_blocks_history.up.sql", size: 1201, mode: os.FileMode(0644), modTime: time.Unix(1622827638, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x40, 0x1b, 0x51, 0xa4, 0xc8, 0x67, 0x44, 0x82, 0x53, 0xa3, 0x61, 0x56, 0x46, 0x39, 0x2, 0x6c, 0x1f, 0x63, 0x9d, 0x23, 0x85, 0xf3, 0x76, 0x50, 0x3e, 0x5, 0x70, 0x2b, 0xc1, 0x6e, 0x15, 0x52}} + return a, nil +} + +var __000010_blocks_created_byDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x94\x51\x6f\x9b\x30\x10\xc7\xdf\xf9\x14\xf7\x82\x02\x53\x5a\x4d\xda\x54\x4d\x8d\x34\x89\x82\xd3\xb0\x81\x1d\x19\x77\x6d\xf6\x42\x13\x30\x8b\x55\x12\x28\x26\xea\x22\xc4\x77\x9f\x48\x48\x4a\x1a\x92\x6a\x5a\xfa\x32\xf5\xd1\xf6\xdd\xff\x8e\xe3\x7f\x3f\xc3\x61\x88\x02\x33\xae\x1c\x04\x45\x71\x9e\x66\x3c\x12\xbf\xcb\x72\x12\x27\xc1\x83\x04\x8a\xb0\xe1\x22\x60\x64\xff\xcd\x4f\xe2\xb0\xa7\x98\x14\x19\x0c\xd5\xf9\x76\x1f\x30\x61\x80\xee\x6c\x8f\x79\x2d\x6a\x9a\x02\x00\x20\x42\xf8\x61\x50\x73\x60\x50\xed\xd3\x85\xde\x5d\xdd\x15\x85\x88\xe0\x3c\x4d\x64\xfe\x2b\xe3\xb2\x2c\xc5\x5c\xf2\x2c\xf7\xc7\x39\x30\xdb\x45\x1e\x33\xdc\x21\xfb\xb9\x12\xc7\x37\x8e\x03\x16\xea\x1b\x37\x0e\x03\x4c\x6e\x35\xbd\x5b\x14\x7c\x1e\x96\x65\x43\x48\x3e\xc6\x22\xe7\x4d\x19\xcb\x60\xa8\x92\xda\xd3\xd0\x3c\x46\xfb\xd5\x8b\xd6\x51\x47\x67\xea\xec\x4c\x0d\x41\x1d\x5c\xaa\xee\xa5\x1a\x75\xba\xd0\xc1\xe4\xb6\xa3\xb7\xd5\x98\x2d\xe5\x63\xdc\x56\x42\xbb\xd0\xdb\x3b\xbd\xd8\x95\x49\xc7\x19\x9f\xe7\xfe\xe1\x71\xd4\x15\xee\x65\x30\xe5\xb3\xf1\x7d\x51\xf0\x58\xf2\xb2\x5c\x1f\x6b\x25\xb8\xb2\xaf\x6d\xcc\xd6\x69\xf9\x32\xe5\xc0\xd0\xdd\xe6\x28\xf2\xb8\x79\x8e\x04\x8f\x43\xb9\x37\xeb\x6f\x1e\xc1\x1b\xed\x2a\xb8\x56\x5e\xe7\x04\x19\x1f\xe7\xbc\xfa\xbc\x66\xa1\x45\x1a\xb6\xdc\x86\x3c\xe6\xfb\xb7\x59\x92\xb4\x7f\xe4\x2c\x09\x45\x24\x78\xe8\x4f\x96\xfb\x8f\x4f\x49\xf6\x20\xd3\x71\xc0\x5b\x53\x87\xd4\x76\x0d\x3a\x82\xef\x68\x04\x5a\x33\xb4\x2b\x42\x7d\x15\xa1\xef\x8c\xb0\xca\x36\xcc\xca\xe8\x1e\x62\xb0\xc8\xa3\x2f\xb3\xc9\x67\x30\x89\xe3\x54\xe6\xad\xcf\xfe\x62\x2e\x82\x24\xe4\x7e\x20\xea\x11\xf4\x14\x65\x47\x46\xb1\xb1\x87\x28\x03\xfb\x1a\x13\x8a\xc0\xc6\x6d\x7b\x01\x9a\x87\x1c\x64\x32\xf8\x00\x7d\x4a\xdc\xf6\xc5\x01\x42\x2d\x44\xe1\x6a\x04\x0d\xff\x20\xcf\xd4\x7b\xca\xc6\x22\x2f\x7f\xd3\xb6\xf8\x1b\x54\x05\x82\xc1\x24\xb8\xef\xd8\x26\x03\x8b\x54\xf6\x1d\xd8\xf8\xfa\x65\x33\x9b\xb5\xda\xb4\x42\xe8\x2b\xa3\xf8\x87\x9e\x9e\x6b\x5b\xc8\x41\x0c\x1d\x90\x80\xa7\x29\xcf\x78\xc3\x7a\x5f\xe1\x63\x4f\xb1\x28\x19\x1e\x62\xda\x9a\x5b\x8a\x72\x14\x7c\xfe\x54\xc8\x3c\xc9\x96\x47\x01\x58\xc7\xfc\x3d\x08\xb7\xea\xef\x40\x7c\x07\xe2\x7f\x0f\xc4\x67\xb7\xbf\x86\x83\xc6\x42\x9d\x1c\x90\xa7\xed\xe2\x8d\x80\xb9\x6d\xf2\x04\x3d\x36\x00\x7a\x8c\x86\x3b\x10\xfb\x13\x00\x00\xff\xff\xbd\xdd\x75\x63\x0d\x0a\x00\x00") + +func _000010_blocks_created_byDownSqlBytes() ([]byte, error) { + return bindataRead( + __000010_blocks_created_byDownSql, "000010_blocks_created_by.down.sql", ) } -var __000010_blocks_created_by_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x8e\x41\x4b\xc4\x30\x10\x85\xef\xfd\x15\x73\x6b\x0a\xb2\x20\x82\x97\x65\x0f\xb3\x49\x44\x21\x6e\x25\x4d\x05\x4f\x65\xb7\x9d\xb2\xc1\xc6\x48\x12\xd0\x52\xfa\xdf\xa5\x78\x11\xd4\xb2\x97\x39\xcc\x7b\xef\xe3\x43\x65\xa4\x06\x83\x7b\x25\x61\x9a\x36\xef\x81\x7a\xfb\x39\xcf\xa7\xc1\xb7\xaf\x11\x50\x08\xe0\xa5\xaa\x1f\x0f\xd0\x06\x3a\x26\xea\x9a\xd3\x08\xcf\xa8\xf9\x3d\x6a\x76\x73\x5b\x6c\xb3\x55\x40\x73\xb6\x31\xf9\x30\x5e\x02\xca\xea\x27\x81\xe6\x2f\x8b\x4a\x9a\x9f\xab\x1d\xf0\x12\x95\xac\xb8\x64\x87\x5a\xa9\x87\x3b\xc6\x22\x0d\xd4\x26\x70\xbe\xb3\xbd\xfd\x6e\xf5\xc1\xbb\x15\xa1\x8f\x33\x05\xfa\x3f\xdf\xd8\x0e\x76\xbf\xe3\xe5\x5d\x6a\x21\x35\xec\x5f\xd6\xc6\x6f\x91\x42\x6a\x8e\x09\xb0\xe2\x30\x58\x67\x13\x5c\x17\x57\x90\xe7\xcb\x89\x63\x4c\xe4\xf2\x62\x9b\x7d\x05\x00\x00\xff\xff\xcb\x4a\xd7\xe3\x7d\x01\x00\x00") +func _000010_blocks_created_byDownSql() (*asset, error) { + bytes, err := _000010_blocks_created_byDownSqlBytes() + if err != nil { + return nil, err + } -func _000010_blocks_created_by_up_sql() ([]byte, error) { - return bindata_read( - __000010_blocks_created_by_up_sql, + info := bindataFileInfo{name: "000010_blocks_created_by.down.sql", size: 2573, mode: os.FileMode(0644), modTime: time.Unix(1626339811, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x18, 0x65, 0x76, 0x27, 0xb0, 0x76, 0x4e, 0x39, 0x9, 0xfc, 0x1b, 0x3e, 0x33, 0xa6, 0xce, 0x12, 0xc4, 0x49, 0x63, 0x72, 0xaa, 0xdb, 0x53, 0x2b, 0x88, 0x6c, 0x46, 0xb8, 0xba, 0x3c, 0x23, 0xf2}} + return a, nil +} + +var __000010_blocks_created_byUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x8e\x41\x4b\xc4\x30\x10\x85\xef\xfd\x15\x73\x6b\x0a\xb2\x20\x82\x97\x65\x0f\xb3\x49\x44\x21\x6e\x25\x4d\x05\x4f\x65\xb7\x9d\xb2\xc1\xc6\x48\x12\xd0\x52\xfa\xdf\xa5\x78\x11\xd4\xb2\x97\x39\xcc\x7b\xef\xe3\x43\x65\xa4\x06\x83\x7b\x25\x61\x9a\x36\xef\x81\x7a\xfb\x39\xcf\xa7\xc1\xb7\xaf\x11\x50\x08\xe0\xa5\xaa\x1f\x0f\xd0\x06\x3a\x26\xea\x9a\xd3\x08\xcf\xa8\xf9\x3d\x6a\x76\x73\x5b\x6c\xb3\x55\x40\x73\xb6\x31\xf9\x30\x5e\x02\xca\xea\x27\x81\xe6\x2f\x8b\x4a\x9a\x9f\xab\x1d\xf0\x12\x95\xac\xb8\x64\x87\x5a\xa9\x87\x3b\xc6\x22\x0d\xd4\x26\x70\xbe\xb3\xbd\xfd\x6e\xf5\xc1\xbb\x15\xa1\x8f\x33\x05\xfa\x3f\xdf\xd8\x0e\x76\xbf\xe3\xe5\x5d\x6a\x21\x35\xec\x5f\xd6\xc6\x6f\x91\x42\x6a\x8e\x09\xb0\xe2\x30\x58\x67\x13\x5c\x17\x57\x90\xe7\xcb\x89\x63\x4c\xe4\xf2\x62\x9b\x7d\x05\x00\x00\xff\xff\xcb\x4a\xd7\xe3\x7d\x01\x00\x00") + +func _000010_blocks_created_byUpSqlBytes() ([]byte, error) { + return bindataRead( + __000010_blocks_created_byUpSql, "000010_blocks_created_by.up.sql", ) } +func _000010_blocks_created_byUpSql() (*asset, error) { + bytes, err := _000010_blocks_created_byUpSqlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "000010_blocks_created_by.up.sql", size: 381, mode: os.FileMode(0644), modTime: time.Unix(1626339811, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb4, 0x78, 0xd4, 0x4a, 0xdb, 0xe1, 0xa0, 0xaf, 0x4d, 0x9, 0x76, 0x85, 0x53, 0x33, 0xb1, 0x9f, 0xec, 0xdb, 0xc0, 0x92, 0x76, 0x8, 0xcf, 0x7a, 0x81, 0x7b, 0x26, 0xe3, 0xdd, 0x3a, 0x71, 0x5a}} + return a, nil +} + // Asset loads and returns the asset for the given name. // It returns an error if the asset could not be found or // could not be loaded. func Asset(name string) ([]byte, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { - return f() + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { + a, err := f() + if err != nil { + return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) + } + return a.bytes, nil } return nil, fmt.Errorf("Asset %s not found", name) } +// AssetString returns the asset contents as a string (instead of a []byte). +func AssetString(name string) (string, error) { + data, err := Asset(name) + return string(data), err +} + +// MustAsset is like Asset but panics when Asset would return an error. +// It simplifies safe initialization of global variables. +func MustAsset(name string) []byte { + a, err := Asset(name) + if err != nil { + panic("asset: Asset(" + name + "): " + err.Error()) + } + + return a +} + +// MustAssetString is like AssetString but panics when Asset would return an +// error. It simplifies safe initialization of global variables. +func MustAssetString(name string) string { + return string(MustAsset(name)) +} + +// AssetInfo loads and returns the asset info for the given name. +// It returns an error if the asset could not be found or +// could not be loaded. +func AssetInfo(name string) (os.FileInfo, error) { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { + a, err := f() + if err != nil { + return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) + } + return a.info, nil + } + return nil, fmt.Errorf("AssetInfo %s not found", name) +} + +// AssetDigest returns the digest of the file with the given name. It returns an +// error if the asset could not be found or the digest could not be loaded. +func AssetDigest(name string) ([sha256.Size]byte, error) { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { + a, err := f() + if err != nil { + return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err) + } + return a.digest, nil + } + return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name) +} + +// Digests returns a map of all known files and their checksums. +func Digests() (map[string][sha256.Size]byte, error) { + mp := make(map[string][sha256.Size]byte, len(_bindata)) + for name := range _bindata { + a, err := _bindata[name]() + if err != nil { + return nil, err + } + mp[name] = a.digest + } + return mp, nil +} + // AssetNames returns the names of the assets. func AssetNames() []string { names := make([]string, 0, len(_bindata)) @@ -226,28 +578,32 @@ func AssetNames() []string { } // _bindata is a table, holding each asset generator, mapped to its name. -var _bindata = map[string]func() ([]byte, error){ - "000001_init.down.sql": _000001_init_down_sql, - "000001_init.up.sql": _000001_init_up_sql, - "000002_system_settings_table.down.sql": _000002_system_settings_table_down_sql, - "000002_system_settings_table.up.sql": _000002_system_settings_table_up_sql, - "000003_blocks_rootid.down.sql": _000003_blocks_rootid_down_sql, - "000003_blocks_rootid.up.sql": _000003_blocks_rootid_up_sql, - "000004_auth_table.down.sql": _000004_auth_table_down_sql, - "000004_auth_table.up.sql": _000004_auth_table_up_sql, - "000005_blocks_modifiedby.down.sql": _000005_blocks_modifiedby_down_sql, - "000005_blocks_modifiedby.up.sql": _000005_blocks_modifiedby_up_sql, - "000006_sharing_table.down.sql": _000006_sharing_table_down_sql, - "000006_sharing_table.up.sql": _000006_sharing_table_up_sql, - "000007_workspaces_table.down.sql": _000007_workspaces_table_down_sql, - "000007_workspaces_table.up.sql": _000007_workspaces_table_up_sql, - "000008_teams.down.sql": _000008_teams_down_sql, - "000008_teams.up.sql": _000008_teams_up_sql, - "000009_blocks_history.down.sql": _000009_blocks_history_down_sql, - "000009_blocks_history.up.sql": _000009_blocks_history_up_sql, - "000010_blocks_created_by.down.sql": _000010_blocks_created_by_down_sql, - "000010_blocks_created_by.up.sql": _000010_blocks_created_by_up_sql, +var _bindata = map[string]func() (*asset, error){ + "000001_init.down.sql": _000001_initDownSql, + "000001_init.up.sql": _000001_initUpSql, + "000002_system_settings_table.down.sql": _000002_system_settings_tableDownSql, + "000002_system_settings_table.up.sql": _000002_system_settings_tableUpSql, + "000003_blocks_rootid.down.sql": _000003_blocks_rootidDownSql, + "000003_blocks_rootid.up.sql": _000003_blocks_rootidUpSql, + "000004_auth_table.down.sql": _000004_auth_tableDownSql, + "000004_auth_table.up.sql": _000004_auth_tableUpSql, + "000005_blocks_modifiedby.down.sql": _000005_blocks_modifiedbyDownSql, + "000005_blocks_modifiedby.up.sql": _000005_blocks_modifiedbyUpSql, + "000006_sharing_table.down.sql": _000006_sharing_tableDownSql, + "000006_sharing_table.up.sql": _000006_sharing_tableUpSql, + "000007_workspaces_table.down.sql": _000007_workspaces_tableDownSql, + "000007_workspaces_table.up.sql": _000007_workspaces_tableUpSql, + "000008_teams.down.sql": _000008_teamsDownSql, + "000008_teams.up.sql": _000008_teamsUpSql, + "000009_blocks_history.down.sql": _000009_blocks_historyDownSql, + "000009_blocks_history.up.sql": _000009_blocks_historyUpSql, + "000010_blocks_created_by.down.sql": _000010_blocks_created_byDownSql, + "000010_blocks_created_by.up.sql": _000010_blocks_created_byUpSql, } + +// AssetDebug is true if the assets were built with the debug flag enabled. +const AssetDebug = false + // AssetDir returns the file names below a certain // directory embedded in the file by go-bindata. // For example if you run go-bindata on data/... and data contains the @@ -257,15 +613,15 @@ var _bindata = map[string]func() ([]byte, error){ // img/ // a.png // b.png -// then AssetDir("data") would return []string{"foo.txt", "img"} -// AssetDir("data/img") would return []string{"a.png", "b.png"} -// AssetDir("foo.txt") and AssetDir("notexist") would return an error +// then AssetDir("data") would return []string{"foo.txt", "img"}, +// AssetDir("data/img") would return []string{"a.png", "b.png"}, +// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and // AssetDir("") will return []string{"data"}. func AssetDir(name string) ([]string, error) { node := _bintree if len(name) != 0 { - cannonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(cannonicalName, "/") + canonicalName := strings.Replace(name, "\\", "/", -1) + pathList := strings.Split(canonicalName, "/") for _, p := range pathList { node = node.Children[p] if node == nil { @@ -277,55 +633,79 @@ func AssetDir(name string) ([]string, error) { return nil, fmt.Errorf("Asset %s not found", name) } rv := make([]string, 0, len(node.Children)) - for name := range node.Children { - rv = append(rv, name) + for childName := range node.Children { + rv = append(rv, childName) } return rv, nil } -type _bintree_t struct { - Func func() ([]byte, error) - Children map[string]*_bintree_t +type bintree struct { + Func func() (*asset, error) + Children map[string]*bintree } -var _bintree = &_bintree_t{nil, map[string]*_bintree_t{ - "000001_init.down.sql": &_bintree_t{_000001_init_down_sql, map[string]*_bintree_t{ - }}, - "000001_init.up.sql": &_bintree_t{_000001_init_up_sql, map[string]*_bintree_t{ - }}, - "000002_system_settings_table.down.sql": &_bintree_t{_000002_system_settings_table_down_sql, map[string]*_bintree_t{ - }}, - "000002_system_settings_table.up.sql": &_bintree_t{_000002_system_settings_table_up_sql, map[string]*_bintree_t{ - }}, - "000003_blocks_rootid.down.sql": &_bintree_t{_000003_blocks_rootid_down_sql, map[string]*_bintree_t{ - }}, - "000003_blocks_rootid.up.sql": &_bintree_t{_000003_blocks_rootid_up_sql, map[string]*_bintree_t{ - }}, - "000004_auth_table.down.sql": &_bintree_t{_000004_auth_table_down_sql, map[string]*_bintree_t{ - }}, - "000004_auth_table.up.sql": &_bintree_t{_000004_auth_table_up_sql, map[string]*_bintree_t{ - }}, - "000005_blocks_modifiedby.down.sql": &_bintree_t{_000005_blocks_modifiedby_down_sql, map[string]*_bintree_t{ - }}, - "000005_blocks_modifiedby.up.sql": &_bintree_t{_000005_blocks_modifiedby_up_sql, map[string]*_bintree_t{ - }}, - "000006_sharing_table.down.sql": &_bintree_t{_000006_sharing_table_down_sql, map[string]*_bintree_t{ - }}, - "000006_sharing_table.up.sql": &_bintree_t{_000006_sharing_table_up_sql, map[string]*_bintree_t{ - }}, - "000007_workspaces_table.down.sql": &_bintree_t{_000007_workspaces_table_down_sql, map[string]*_bintree_t{ - }}, - "000007_workspaces_table.up.sql": &_bintree_t{_000007_workspaces_table_up_sql, map[string]*_bintree_t{ - }}, - "000008_teams.down.sql": &_bintree_t{_000008_teams_down_sql, map[string]*_bintree_t{ - }}, - "000008_teams.up.sql": &_bintree_t{_000008_teams_up_sql, map[string]*_bintree_t{ - }}, - "000009_blocks_history.down.sql": &_bintree_t{_000009_blocks_history_down_sql, map[string]*_bintree_t{ - }}, - "000009_blocks_history.up.sql": &_bintree_t{_000009_blocks_history_up_sql, map[string]*_bintree_t{ - }}, - "000010_blocks_created_by.down.sql": &_bintree_t{_000010_blocks_created_by_down_sql, map[string]*_bintree_t{ - }}, - "000010_blocks_created_by.up.sql": &_bintree_t{_000010_blocks_created_by_up_sql, map[string]*_bintree_t{ - }}, + +var _bintree = &bintree{nil, map[string]*bintree{ + "000001_init.down.sql": {_000001_initDownSql, map[string]*bintree{}}, + "000001_init.up.sql": {_000001_initUpSql, map[string]*bintree{}}, + "000002_system_settings_table.down.sql": {_000002_system_settings_tableDownSql, map[string]*bintree{}}, + "000002_system_settings_table.up.sql": {_000002_system_settings_tableUpSql, map[string]*bintree{}}, + "000003_blocks_rootid.down.sql": {_000003_blocks_rootidDownSql, map[string]*bintree{}}, + "000003_blocks_rootid.up.sql": {_000003_blocks_rootidUpSql, map[string]*bintree{}}, + "000004_auth_table.down.sql": {_000004_auth_tableDownSql, map[string]*bintree{}}, + "000004_auth_table.up.sql": {_000004_auth_tableUpSql, map[string]*bintree{}}, + "000005_blocks_modifiedby.down.sql": {_000005_blocks_modifiedbyDownSql, map[string]*bintree{}}, + "000005_blocks_modifiedby.up.sql": {_000005_blocks_modifiedbyUpSql, map[string]*bintree{}}, + "000006_sharing_table.down.sql": {_000006_sharing_tableDownSql, map[string]*bintree{}}, + "000006_sharing_table.up.sql": {_000006_sharing_tableUpSql, map[string]*bintree{}}, + "000007_workspaces_table.down.sql": {_000007_workspaces_tableDownSql, map[string]*bintree{}}, + "000007_workspaces_table.up.sql": {_000007_workspaces_tableUpSql, map[string]*bintree{}}, + "000008_teams.down.sql": {_000008_teamsDownSql, map[string]*bintree{}}, + "000008_teams.up.sql": {_000008_teamsUpSql, map[string]*bintree{}}, + "000009_blocks_history.down.sql": {_000009_blocks_historyDownSql, map[string]*bintree{}}, + "000009_blocks_history.up.sql": {_000009_blocks_historyUpSql, map[string]*bintree{}}, + "000010_blocks_created_by.down.sql": {_000010_blocks_created_byDownSql, map[string]*bintree{}}, + "000010_blocks_created_by.up.sql": {_000010_blocks_created_byUpSql, map[string]*bintree{}}, }} + +// RestoreAsset restores an asset under the given directory. +func RestoreAsset(dir, name string) error { + data, err := Asset(name) + if err != nil { + return err + } + info, err := AssetInfo(name) + if err != nil { + return err + } + err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) + if err != nil { + return err + } + err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) + if err != nil { + return err + } + return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) +} + +// RestoreAssets restores an asset under the given directory recursively. +func RestoreAssets(dir, name string) error { + children, err := AssetDir(name) + // File + if err != nil { + return RestoreAsset(dir, name) + } + // Dir + for _, child := range children { + err = RestoreAssets(dir, filepath.Join(name, child)) + if err != nil { + return err + } + } + return nil +} + +func _filePath(dir, name string) string { + canonicalName := strings.Replace(name, "\\", "/", -1) + return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) +} diff --git a/server/services/store/store.go b/server/services/store/store.go index c5c884aa4..7476db34f 100644 --- a/server/services/store/store.go +++ b/server/services/store/store.go @@ -1,4 +1,4 @@ -//go:generate mockgen -destination=mockstore/mockstore.go -package mockstore . Store +//go:generate mockgen --build_flags=--mod=mod -destination=mockstore/mockstore.go -package mockstore . Store package store import "github.com/mattermost/focalboard/server/model" @@ -24,6 +24,7 @@ type Store interface { DeleteBlock(c Container, blockID string, modifiedBy string) error GetBlockCountsByType() (map[string]int64, error) GetBlock(c Container, blockID string) (*model.Block, error) + PatchBlock(c Container, blockID string, blockPatch *model.BlockPatch, userID string) error Shutdown() error diff --git a/server/services/store/storetests/blocks.go b/server/services/store/storetests/blocks.go index 809655140..027f8cc77 100644 --- a/server/services/store/storetests/blocks.go +++ b/server/services/store/storetests/blocks.go @@ -25,6 +25,11 @@ func StoreTestBlocksStore(t *testing.T, setup func(t *testing.T) (store.Store, f defer tearDown() testInsertBlock(t, store, container) }) + t.Run("PatchBlock", func(t *testing.T) { + store, tearDown := setup(t) + defer tearDown() + testPatchBlock(t, store, container) + }) t.Run("DeleteBlock", func(t *testing.T) { store, tearDown := setup(t) defer tearDown() @@ -183,6 +188,126 @@ func testInsertBlock(t *testing.T, store store.Store, container store.Container) }) } +func testPatchBlock(t *testing.T, store store.Store, container store.Container) { + userID := testUserID + + block := model.Block{ + ID: "id-test", + RootID: "id-test", + Title: "oldTitle", + ModifiedBy: userID, + Fields: map[string]interface{}{"test": "test value", "test2": "test value 2"}, + } + + err := store.InsertBlock(container, &block, "user-id-1") + require.NoError(t, err) + + blocks, errBlocks := store.GetAllBlocks(container) + require.NoError(t, errBlocks) + initialCount := len(blocks) + + t.Run("not existing block", func(t *testing.T) { + err := store.PatchBlock(container, "invalid-block-id", &model.BlockPatch{}, "user-id-1") + require.Error(t, err) + + blocks, err := store.GetAllBlocks(container) + require.NoError(t, err) + require.Len(t, blocks, initialCount) + }) + + t.Run("invalid rootid", func(t *testing.T) { + wrongRootID := "" + blockPatch := model.BlockPatch{ + RootID: &wrongRootID, + } + + err := store.PatchBlock(container, "id-test", &blockPatch, "user-id-1") + require.Error(t, err) + + blocks, err := store.GetAllBlocks(container) + require.NoError(t, err) + require.Len(t, blocks, initialCount) + }) + + t.Run("invalid fields data", func(t *testing.T) { + blockPatch := model.BlockPatch{ + UpdatedFields: map[string]interface{}{"no-serialiable-value": t.Run}, + } + + err := store.PatchBlock(container, "id-test", &blockPatch, "user-id-1") + require.Error(t, err) + + blocks, err := store.GetAllBlocks(container) + require.NoError(t, err) + require.Len(t, blocks, initialCount) + }) + + t.Run("update block fields", func(t *testing.T) { + newTitle := "New title" + blockPatch := model.BlockPatch{ + Title: &newTitle, + } + + // Wait for not colliding the ID+insert_at key + time.Sleep(1 * time.Millisecond) + + // inserting + err := store.PatchBlock(container, "id-test", &blockPatch, "user-id-2") + require.NoError(t, err) + + retrievedBlock, err := store.GetBlock(container, "id-test") + require.NoError(t, err) + + // created by populated from user id for new blocks + require.Equal(t, "user-id-2", retrievedBlock.ModifiedBy) + require.Equal(t, "New title", retrievedBlock.Title) + }) + + t.Run("update block custom fields", func(t *testing.T) { + blockPatch := model.BlockPatch{ + UpdatedFields: map[string]interface{}{"test": "new test value", "test3": "new value"}, + } + + // Wait for not colliding the ID+insert_at key + time.Sleep(1 * time.Millisecond) + + // inserting + err := store.PatchBlock(container, "id-test", &blockPatch, "user-id-2") + require.NoError(t, err) + + retrievedBlock, err := store.GetBlock(container, "id-test") + require.NoError(t, err) + + // created by populated from user id for new blocks + require.Equal(t, "user-id-2", retrievedBlock.ModifiedBy) + require.Equal(t, "new test value", retrievedBlock.Fields["test"]) + require.Equal(t, "test value 2", retrievedBlock.Fields["test2"]) + require.Equal(t, "new value", retrievedBlock.Fields["test3"]) + }) + + t.Run("remove block custom fields", func(t *testing.T) { + blockPatch := model.BlockPatch{ + DeletedFields: []string{"test", "test3", "test100"}, + } + + // Wait for not colliding the ID+insert_at key + time.Sleep(1 * time.Millisecond) + + // inserting + err := store.PatchBlock(container, "id-test", &blockPatch, "user-id-2") + require.NoError(t, err) + + retrievedBlock, err := store.GetBlock(container, "id-test") + require.NoError(t, err) + + // created by populated from user id for new blocks + require.Equal(t, "user-id-2", retrievedBlock.ModifiedBy) + require.Equal(t, nil, retrievedBlock.Fields["test"]) + require.Equal(t, "test value 2", retrievedBlock.Fields["test2"]) + require.Equal(t, nil, retrievedBlock.Fields["test3"]) + }) +} + var ( subtreeSampleBlocks = []model.Block{ { diff --git a/server/swagger/docs/html/.openapi-generator/VERSION b/server/swagger/docs/html/.openapi-generator/VERSION index 3bff05917..7cbea073b 100644 --- a/server/swagger/docs/html/.openapi-generator/VERSION +++ b/server/swagger/docs/html/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.2.0 \ No newline at end of file diff --git a/server/swagger/docs/html/index.html b/server/swagger/docs/html/index.html index df6ee824b..898f390a5 100644 --- a/server/swagger/docs/html/index.html +++ b/server/swagger/docs/html/index.html @@ -2,7 +2,8 @@ - Focalboard Server + line /home/jespino/Projects/mattermost/focalboard/server/main/main.go:1:1 +Package classification Focalboard Server @@ -189,7 +190,7 @@ h={};g()}};typeof define==="function"&&define.amd&&define("google-code-prettify"