Subversion Repositories oidplus

Rev

Rev 1039 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1039 Rev 1244
Line 16... Line 16...
16
# limitations under the License.
16
# limitations under the License.
17
 
17
 
18
DIR=$( dirname "$0" )
18
DIR=$( dirname "$0" )
19
cd "$DIR"
19
cd "$DIR"
20
 
20
 
21
# Export tables "demo_*" into file setup/sql/example_access.sql
21
# Export tables "demo_*" into file plugins/viathinksoft/sqlSlang/access/sql/example.sql
22
# We don't print to console because of encoding issues
22
# We don't print to console because of encoding issues
23
#mysqldump --default-character-set=utf8 --no-create-info --extended-insert=FALSE oidplus demo_iri demo_asn1id demo_ra demo_objects -r ../setup/sql/example_access.sql
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/access/sql/example.sql
24
 
24
 
25
# Remove database prefix
25
# Remove database prefix
26
#sed -i 's/`demo_/`/g' ../setup/sql/example_access.sql
26
#sed -i 's/`demo_/`/g' ../plugins/viathinksoft/sqlSlang/access/sql/example.sql
27
 
27
 
28
# Since we have to do some manual work to the MySQL data, we do not create a new dump
28
# Since we have to do some manual work to the MySQL data, we do not create a new dump
29
# but instead use the MySQL example script (that has been carefully checked)
29
# but instead use the MySQL example script (that has been carefully checked)
30
cat ../setup/sql/example_mysql.sql > ../setup/sql/example_access.sql
30
cat ../plugins/viathinksoft/sqlSlang/access/sql/example_mysql.sql > ../plugins/viathinksoft/sqlSlang/access/sql/example.sql
31
 
31
 
32
# Avoid that there is a conflict with well known IDs (e.g. 2.999)
32
# Avoid that there is a conflict with well known IDs (e.g. 2.999)
33
#sed -i 's/INSERT INTO `iri`/INSERT IGNORE INTO `iri`/g' ../setup/sql/example_access.sql
33
#sed -i 's/INSERT INTO `iri`/INSERT IGNORE INTO `iri`/g' ../plugins/viathinksoft/sqlSlang/access/sql/example.sql
34
#sed -i 's/INSERT INTO `asn1id`/INSERT IGNORE INTO `asn1id`/g' ../setup/sql/example_access.sql
34
#sed -i 's/INSERT INTO `asn1id`/INSERT IGNORE INTO `asn1id`/g' ../plugins/viathinksoft/sqlSlang/access/sql/example.sql
35
 
35
 
36
# Change `backticks` to [brackets]
36
# Change `backticks` to [brackets]
37
sed -i 's/`\([^`]\+\)`/\[\1\]/g' ../setup/sql/example_access.sql
37
sed -i 's/`\([^`]\+\)`/\[\1\]/g' ../plugins/viathinksoft/sqlSlang/access/sql/example.sql
38
 
38
 
39
# Change "\n" to "' + CHR(13) + '"
39
# Change "\n" to "' + CHR(13) + '"
40
sed -i "s/\\\n/' \+ CHR(13) \+ '/g" ../setup/sql/example_access.sql
40
sed -i "s/\\\n/' \+ CHR(13) \+ '/g" ../plugins/viathinksoft/sqlSlang/access/sql/example.sql
41
 
41
 
42
# Change \" to "
42
# Change \" to "
43
sed -i 's/\\"/"/g' ../setup/sql/example_access.sql
43
sed -i 's/\\"/"/g' ../plugins/viathinksoft/sqlSlang/access/sql/example.sql
44
 
44
 
45
# Prepend "SET DATEFORMAT ymd;"
45
# Prepend "SET DATEFORMAT ymd;"
46
cat ../setup/sql/example_access.sql >> tmp
46
cat ../plugins/viathinksoft/sqlSlang/access/sql/example.sql >> tmp
47
cat tmp > ../setup/sql/example_access.sql
47
cat tmp > ../plugins/viathinksoft/sqlSlang/access/sql/example.sql
48
rm tmp
48
rm tmp