Skip to content
Snippets Groups Projects
Commit cc826d33 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

Merge branch 'f-cleanup-rules' into 'dev'

F cleanup rules

See merge request !3
parents 0caf17d9 bfa5f764
Branches
Tags
2 merge requests!7Release v5.0.0,!3F cleanup rules
Pipeline #10065 passed
......@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased] ##
## [Unreleased (5.x.x)] ##
### Added ###
......@@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed ###
* `getRules` procedure and the `rules` table. The jobs rules are being
configured in the server repository now.
### Fixed ###
### Security ###
......
......@@ -150,7 +150,6 @@ Older (i.e. not current) data, from previous versions of an entity which were st
- permissions
- query_template_def :: User-defined query templates?
- roles :: possible user roles
- rules :: SQL action/verification hooks?
- stats :: benchmarking?
- transaction_log :: benchmarking?
- units_lin_con :: fraction and unit conversion?
......
-- Table is no longer needed, jobs rules are now handled by the server alone.
DROP TABLE IF EXISTS rules;
#!/bin/bash
#
# This file is a part of the CaosDB Project.
#
# Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
# Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# Update mysql schema to version v5.0.0
# Drop the 'rules' table.
NEW_VERSION="v5.0.0"
OLD_VERSION="v4.0.0"
if [ -z "$UTILSPATH" ]; then
UTILSPATH="../utils"
fi
. $UTILSPATH/patch_header.sh $*
check_version $OLD_VERSION
mysql_execute_file $PATCH_DIR/drop_rules_table.sql
update_version $NEW_VERSION
success
/*
* ** header v3.0
* This file is a part of the CaosDB Project.
*
* Copyright (C) 2018 Research Group Biomedical Physics,
* Max-Planck-Institute for Dynamics and Self-Organization Göttingen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* ** end header
*/
/*
Domain, Entity, Transaction, Criterion, Modus
*/
DROP PROCEDURE IF EXISTS db_2_0.getRules;
delimiter //
CREATE PROCEDURE db_2_0.getRules(in DomainID INT UNSIGNED, in EntityID INT UNSIGNED, in TransType VARCHAR(255))
BEGIN
SELECT rules.transaction, rules.criterion, rules.modus from rules where if(DomainID is null, rules.domain_id=0,rules.domain_id=DomainID) AND if(EntityID is null, rules.entity_id=0,rules.entity_id=EntityID) AND if(TransType is null,true=true,rules.transaction=TransType);
END;
//
delimiter ;
/*
* ** header v3.0
* This file is a part of the CaosDB Project.
*
* Copyright (C) 2018 Research Group Biomedical Physics,
* Max-Planck-Institute for Dynamics and Self-Organization Göttingen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* ** end header
*/
#-- ************
#-- define rules
#-- ************
DELETE FROM rules;
#-- general rules
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,0,'INSERT','CheckPropValid','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,0,'INSERT','CheckParValid','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,0,'INSERT','CheckParOblPropPresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,0,'INSERT','CheckValueParsable','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,0,'UPDATE','CheckPropValid','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,0,'UPDATE','CheckParValid','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,0,'UPDATE','CheckParOblPropPresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,0,'UPDATE','CheckValueParsable','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,0,'DELETE','CheckReferenceDependencyExistent','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,0,'DELETE','CheckChildDependencyExistent','MUST');
#-- role specific rules
#-- recordtype rules
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,1,'INSERT','CheckDescPresent','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,1,'INSERT','CheckNamePresent','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,1,'INSERT','CheckPropPresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,1,'INSERT','SetImpToRecByDefault','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,1,'UPDATE','CheckNamePresent','MUST');
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,1,'UPDATE','CheckDescPresent','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,1,'UPDATE','CheckPropPresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,1,'UPDATE','SetImpToRecByDefault','MUST');
#-- record rules
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,2,'INSERT','CheckDescPresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,2,'INSERT','CheckNamePresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,2,'INSERT','CheckPropPresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,2,'INSERT','CheckParPresent','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,2,'INSERT','SetImpToFix','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,2,'UPDATE','CheckNamePresent','SHOULD');
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,2,'UPDATE','CheckDescPresent','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,2,'UPDATE','CheckPropPresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,2,'UPDATE','CheckParPresent','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,2,'UPDATE','SetImpToFix','MUST');
#-- file rules
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,3,'INSERT','CheckDescPresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,3,'INSERT','CheckNamePresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,3,'INSERT','MatchFileProp','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,3,'INSERT','CheckTargetPathValid','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,3,'INSERT','SetImpToFix','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,3,'UPDATE','CheckNamePresent','SHOULD');
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,3,'UPDATE','CheckDescPresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,3,'UPDATE','MatchFileProp','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,3,'UPDATE','CheckTargetPathValid','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,3,'UPDATE','SetImpToFix','MUST');
#-- property rules
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,4,'INSERT','CheckDatatypePresent','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,4,'UPDATE','CheckDatatypePresent','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,4,'INSERT','CheckNamePresent','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,4,'UPDATE','CheckNamePresent','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,4,'INSERT','SetImpToFix','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,4,'UPDATE','SetImpToFix','MUST');
#-- query template rules
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,8,'UPDATE','CheckQueryTemplate','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,8,'INSERT','CheckQueryTemplate','MUST');
#-- data type specific rules
#-- reference rules
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,11,'INSERT','CheckRefidPresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,11,'INSERT','CheckRefidValid','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,11,'INSERT','CheckRefidIsaParRefid','SHOULD');
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,11,'INSERT','CheckDescPresent','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,11,'UPDATE','CheckRefidPresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,11,'UPDATE','CheckRefidValid','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,11,'UPDATE','CheckRefidIsaParRefid','SHOULD');
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,11,'UPDATE','CheckDescPresent','MUST');
#-- integer rules
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,12,'INSERT','CheckUnitPresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,12,'INSERT','ParseUnit','SHOULD');
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,12,'INSERT','CheckDescPresent','MUST');
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,12,'UPDATE','CheckDescPresent','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,12,'UPDATE','CheckUnitPresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,12,'UPDATE','ParseUnit','SHOULD');
#-- double rules
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,13,'INSERT','CheckUnitPresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,13,'INSERT','ParseUnit','SHOULD');
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,13,'INSERT','CheckDescPresent','MUST');
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,13,'UPDATE','CheckDescPresent','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,13,'UPDATE','CheckUnitPresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,13,'UPDATE','ParseUnit','SHOULD');
#-- text rules
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,14,'INSERT','CheckDescPresent','MUST');
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,14,'UPDATE','CheckDescPresent','MUST');
#-- datetime rules
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,15,'INSERT','CheckDescPresent','MUST');
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,15,'UPDATE','CheckDescPresent','MUST');
#-- timespan rules
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,16,'INSERT','CheckUnitPresent','SHOULD');
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,16,'INSERT','CheckDescPresent','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,16,'UPDATE','CheckUnitPresent','SHOULD');
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,16,'UPDATE','CheckDescPresent','MUST');
#-- filereference rules
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,17,'INSERT','CheckRefidValid','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,17,'INSERT','CheckRefidIsaParRefid','MUST');
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,17,'INSERT','CheckDescPresent','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,17,'UPDATE','CheckRefidValid','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,17,'UPDATE','CheckRefidIsaParRefid','MUST');
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,17,'UPDATE','CheckDescPresent','MUST');
#-- SQLite files
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,50,'UPDATE','CheckRefidValid','MUST');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,50,'UPDATE','CheckRefidIsaParRefid','SHOULD');
#-- INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,50,'UPDATE','CheckDescPresent','SHOULD');
INSERT INTO rules (domain_id, entity_id, transaction, criterion, modus) VALUES (0,50,'UPDATE','SQLiteTransaction','MUST');
......@@ -1811,79 +1811,6 @@ SELECT tap.has_constraint('_caosdb_schema_unit_tests','roles','PRIMARY','');
SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','roles','PRIMARY','PRIMARY KEY','');
SELECT tap.col_is_pk('_caosdb_schema_unit_tests','roles','`name`','');
-- ***************************************************************
-- TABLE _caosdb_schema_unit_tests.rules
-- ***************************************************************
SELECT tap.has_table('_caosdb_schema_unit_tests','rules','');
SELECT tap.table_collation_is('_caosdb_schema_unit_tests','rules','utf8_unicode_ci','');
SELECT tap.table_engine_is('_caosdb_schema_unit_tests','rules','InnoDB','');
-- COLUMNS
SELECT tap.columns_are('_caosdb_schema_unit_tests','rules','`domain_id`,`entity_id`,`transaction`,`criterion`,`modus`','');
-- COLUMN rules.domain_id
SELECT tap.has_column('_caosdb_schema_unit_tests','rules','domain_id','');
SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','rules','domain_id','int(10) unsigned','');
SELECT tap.col_extra_is('_caosdb_schema_unit_tests','rules','domain_id','','');
SELECT tap.col_default_is('_caosdb_schema_unit_tests','rules','domain_id',NULL,'');
SELECT tap.col_charset_is('_caosdb_schema_unit_tests','rules','domain_id',NULL,'');
SELECT tap.col_collation_is('_caosdb_schema_unit_tests','rules','domain_id',NULL,'');
-- COLUMN rules.entity_id
SELECT tap.has_column('_caosdb_schema_unit_tests','rules','entity_id','');
SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','rules','entity_id','int(10) unsigned','');
SELECT tap.col_extra_is('_caosdb_schema_unit_tests','rules','entity_id','','');
SELECT tap.col_default_is('_caosdb_schema_unit_tests','rules','entity_id',NULL,'');
SELECT tap.col_charset_is('_caosdb_schema_unit_tests','rules','entity_id',NULL,'');
SELECT tap.col_collation_is('_caosdb_schema_unit_tests','rules','entity_id',NULL,'');
-- COLUMN rules.transaction
SELECT tap.has_column('_caosdb_schema_unit_tests','rules','transaction','');
SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','rules','transaction','enum(\'INSERT\',\'RETRIEVE\',\'UPDATE\',\'DELETE\')','');
SELECT tap.col_extra_is('_caosdb_schema_unit_tests','rules','transaction','','');
SELECT tap.col_default_is('_caosdb_schema_unit_tests','rules','transaction',NULL,'');
SELECT tap.col_charset_is('_caosdb_schema_unit_tests','rules','transaction','utf8','');
SELECT tap.col_collation_is('_caosdb_schema_unit_tests','rules','transaction','utf8_unicode_ci','');
-- COLUMN rules.criterion
SELECT tap.has_column('_caosdb_schema_unit_tests','rules','criterion','');
SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','rules','criterion','varchar(255)','');
SELECT tap.col_extra_is('_caosdb_schema_unit_tests','rules','criterion','','');
SELECT tap.col_default_is('_caosdb_schema_unit_tests','rules','criterion',NULL,'');
SELECT tap.col_charset_is('_caosdb_schema_unit_tests','rules','criterion','utf8','');
SELECT tap.col_collation_is('_caosdb_schema_unit_tests','rules','criterion','utf8_unicode_ci','');
-- COLUMN rules.modus
SELECT tap.has_column('_caosdb_schema_unit_tests','rules','modus','');
SELECT tap.col_column_type_is('_caosdb_schema_unit_tests','rules','modus','enum(\'MUST\',\'SHOULD\',\'SHOULDNT\',\'MUSTNOT\')','');
SELECT tap.col_extra_is('_caosdb_schema_unit_tests','rules','modus','','');
SELECT tap.col_default_is('_caosdb_schema_unit_tests','rules','modus',NULL,'');
SELECT tap.col_charset_is('_caosdb_schema_unit_tests','rules','modus','utf8','');
SELECT tap.col_collation_is('_caosdb_schema_unit_tests','rules','modus','utf8_unicode_ci','');
-- CONSTRAINTS
SELECT tap.constraints_are('_caosdb_schema_unit_tests','rules','`rule_domain_id_entity`,`rule_entity_id_entity`','');
-- CONSTRAINT rules.rule_domain_id_entity
SELECT tap.has_constraint('_caosdb_schema_unit_tests','rules','rule_domain_id_entity','');
SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','rules','rule_domain_id_entity','FOREIGN KEY','');
SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','rules','rule_domain_id_entity','RESTRICT','');
SELECT tap.fk_on_update('_caosdb_schema_unit_tests','rules','rule_domain_id_entity','RESTRICT','');
-- CONSTRAINT rules.rule_entity_id_entity
SELECT tap.has_constraint('_caosdb_schema_unit_tests','rules','rule_entity_id_entity','');
SELECT tap.constraint_type_is('_caosdb_schema_unit_tests','rules','rule_entity_id_entity','FOREIGN KEY','');
SELECT tap.fk_on_delete('_caosdb_schema_unit_tests','rules','rule_entity_id_entity','RESTRICT','');
SELECT tap.fk_on_update('_caosdb_schema_unit_tests','rules','rule_entity_id_entity','RESTRICT','');
-- ***************************************************************
-- TABLE _caosdb_schema_unit_tests.stats
-- ***************************************************************
......@@ -2645,13 +2572,6 @@ SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','getRole','NO'
SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','getRole','DEFINER','');
SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','getRole','CONTAINS SQL','');
-- PROCEDURES _caosdb_schema_unit_tests.getRules
SELECT tap.has_procedure('_caosdb_schema_unit_tests','getRules','');
SELECT tap.procedure_is_deterministic('_caosdb_schema_unit_tests','getRules','NO','');
SELECT tap.procedure_security_type_is('_caosdb_schema_unit_tests','getRules','DEFINER','');
SELECT tap.procedure_sql_data_access_is('_caosdb_schema_unit_tests','getRules','CONTAINS SQL','');
-- PROCEDURES _caosdb_schema_unit_tests.initAutoIncrement
SELECT tap.has_procedure('_caosdb_schema_unit_tests','initAutoIncrement','');
......
......@@ -37,18 +37,8 @@ fi
source $UTILSPATH/load_settings.sh
source $UTILSPATH/helpers.sh
echo -n "Updating rules ... "
temp_rules_sql=$(tempfile --suffix=.sql)
sed s/db_2_0/$DATABASE_NAME/g rules.sql > "$temp_rules_sql"
mysql_execute_file "$temp_rules_sql"
# We keep this for debugging purposes...
# rm "$temp_rules_sql"
echo "[OK]"
echo -n "updating procedures ... "
temp_proc_sql=$(tempfile --suffix=.sql)
temp_proc_sql=$(mktemp --suffix=.sql)
sed -e "s/db_2_0/$DATABASE_NAME/g" procedures/*.sql procedures/query/*.sql \
> "$temp_proc_sql"
mysql_execute_file "$temp_proc_sql"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment