"Fossies" - the Fresh Open Source Software Archive

Member "cells-3.0.0/common/sql/index/migrations/mysql/0.2.sql" (25 Oct 2021, 1834 Bytes) of package /linux/misc/pydio-cells-3.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PL/SQL source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "0.2.sql": 2.3.6_vs_3.0.0.

    1 /*
    2  * Copyright (c) 2019-2021. Abstrium SAS <team (at) pydio.com>
    3  * This file is part of Pydio Cells.
    4  *
    5  * Pydio Cells is free software: you can redistribute it and/or modify
    6  * it under the terms of the GNU Affero General Public License as published by
    7  * the Free Software Foundation, either version 3 of the License, or
    8  * (at your option) any later version.
    9  *
   10  * Pydio Cells is distributed in the hope that it will be useful,
   11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13  * GNU Affero General Public License for more details.
   14  *
   15  * You should have received a copy of the GNU Affero General Public License
   16  * along with Pydio Cells.  If not, see <http://www.gnu.org/licenses/>.
   17  *
   18  * The latest code can be found at <https://pydio.com>.
   19  */
   20 
   21 -- +migrate Up
   22 ALTER TABLE %%PREFIX%%_tree ADD COLUMN `name` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL AFTER `hash`;
   23 ALTER TABLE %%PREFIX%%_tree ADD COLUMN `leaf` TINYINT(1) AFTER `name`;
   24 ALTER TABLE %%PREFIX%%_tree ADD COLUMN `mtime` INT NOT NULL AFTER `leaf`;
   25 ALTER TABLE %%PREFIX%%_tree ADD COLUMN `etag` VARCHAR(255) AFTER `mtime`;
   26 ALTER TABLE %%PREFIX%%_tree ADD COLUMN `size` BIGINT AFTER `etag`;
   27 ALTER TABLE %%PREFIX%%_tree ADD COLUMN `mode` VARCHAR(10) AFTER `size`;
   28 
   29 CREATE INDEX %%PREFIX%%_tree_name_idx ON %%PREFIX%%_tree(name(128));
   30 
   31 UPDATE %%PREFIX%%_tree, %%PREFIX%%_nodes SET
   32     %%PREFIX%%_tree.name=%%PREFIX%%_nodes.name,
   33     %%PREFIX%%_tree.leaf=%%PREFIX%%_nodes.leaf,
   34     %%PREFIX%%_tree.mtime=%%PREFIX%%_nodes.mtime,
   35     %%PREFIX%%_tree.etag=%%PREFIX%%_nodes.etag,
   36     %%PREFIX%%_tree.size=%%PREFIX%%_nodes.size,
   37     %%PREFIX%%_tree.mode=%%PREFIX%%_nodes.mode
   38   WHERE %%PREFIX%%_tree.uuid=%%PREFIX%%_nodes.uuid;
   39 
   40 DROP TABLE %%PREFIX%%_nodes;
   41 -- +migrate Down