Subversion Repositories oidplus

Rev

Rev 848 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
73 daniel-mar 1
#!/bin/bash
2
 
511 daniel-mar 3
# OIDplus 2.0
4
# Copyright 2019 - 2021 Daniel Marschall, ViaThinkSoft
5
#
6
# Licensed under the Apache License, Version 2.0 (the "License");
7
# you may not use this file except in compliance with the License.
8
# You may obtain a copy of the License at
9
#
10
#     http://www.apache.org/licenses/LICENSE-2.0
11
#
12
# Unless required by applicable law or agreed to in writing, software
13
# distributed under the License is distributed on an "AS IS" BASIS,
14
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
# See the License for the specific language governing permissions and
16
# limitations under the License.
17
 
848 daniel-mar 18
DIR=$( dirname "$0" )
19
cd "$DIR"
20
 
1244 daniel-mar 21
# Export tables "demo_*" into file plugins/viathinksoft/sqlSlang/mysql/sql/example.sql
111 daniel-mar 22
# We don't print to console because of encoding issues
1244 daniel-mar 23
mysqldump --default-character-set=utf8 --no-create-info --extended-insert=FALSE oidplus demo_iri demo_asn1id demo_ra demo_objects -r ../plugins/viathinksoft/sqlSlang/mysql/sql/example.sql
73 daniel-mar 24
 
111 daniel-mar 25
# Remove database prefix
1244 daniel-mar 26
sed -i 's/`demo_/`/g' ../plugins/viathinksoft/sqlSlang/mysql/sql/example.sql
73 daniel-mar 27
 
111 daniel-mar 28
# Avoid that there is a conflict with well known IDs (e.g. 2.999)
1244 daniel-mar 29
sed -i 's/INSERT INTO `iri`/INSERT IGNORE INTO `iri`/g' ../plugins/viathinksoft/sqlSlang/mysql/sql/example.sql
30
sed -i 's/INSERT INTO `asn1id`/INSERT IGNORE INTO `asn1id`/g' ../plugins/viathinksoft/sqlSlang/mysql/sql/example.sql