We are moving to Git Issues for bug tracking in future releases. During transition, content will be in both tools. If you'd like to file a new bug, please create an issue.

View | Details | Raw Unified | Return to bug 6817 | Differences between
and this patch

Collapse All | Expand All

(-)a/xml/controlledVocabMetadata.xml (+150 lines)
Line 0    Link Here 
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">
3
4
<!--
5
  * controlledVocabMetadata.xml
6
  *
7
  * Copyright (c) 2000-2011 John Willinsky
8
  * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
9
  *
10
  * Implement controlled vocab meta-data properties (and the respective validation).
11
  -->
12
<data>
13
	<sql>
14
		<!-- Deleting existing entries for idempotence. This will change the IDs of vocab entries which
15
		     could be a problem if referring data exists. We assume that this is an upgrade from a version
16
		     that doesn't know these vocabs at all so there should be no depending data. If this becomes
17
		     a problem we can use ALTER TABLE AUTO_INCREMENT = ... -->
18
		<query driver="mysql">
19
			DELETE FROM cv, cve, cves
20
			USING controlled_vocabs cv
21
			LEFT JOIN controlled_vocab_entries cve ON cv.controlled_vocab_id = cve.controlled_vocab_id
22
			LEFT JOIN controlled_vocab_entry_settings cves ON cve.controlled_vocab_entry_id = cves.controlled_vocab_entry_id
23
			WHERE cv.symbolic IN ('nlm30-publication-types', 'openurl10-journal-genres', 'openurl10-book-genres')
24
		</query>
25
		<query driver="postgres7">
26
			CREATE TEMPORARY TABLE t_cve_delete AS
27
			SELECT controlled_vocab_entry_id
28
			FROM controlled_vocabs cv
29
			INNER JOIN controlled_vocab_entries cve ON cv.controlled_vocab_id = cve.controlled_vocab_id
30
			WHERE cv.symbolic IN ('nlm30-publication-types', 'openurl10-journal-genres', 'openurl10-book-genres');
31
		</query>
32
		<query driver="postgres7">
33
			DELETE FROM controlled_vocab_entry_settings
34
			WHERE controlled_vocab_entry_id IN (SELECT * FROM t_cve_delete);
35
		</query>
36
		<query driver="postgres7">
37
			DELETE FROM controlled_vocab_entries
38
			WHERE controlled_vocab_entry_id IN (SELECT * FROM t_cve_delete);
39
		</query>
40
		<query driver="postgres7">
41
			DELETE FROM controlled_vocabs
42
			WHERE symbolic IN ('nlm30-publication-types', 'openurl10-journal-genres', 'openurl10-book-genres');
43
		</query>
44
		<query driver="postgres7">
45
			DROP TABLE t_cve_delete;
46
		</query>
47
48
		<!-- publication-types -->
49
		<query>INSERT INTO controlled_vocabs (symbolic, assoc_type, assoc_id) VALUES ('nlm30-publication-types', 0, 0)</query>
50
		<query driver="mysql">SET @vocab_id = LAST_INSERT_ID()</query>
51
52
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 0)</query>
53
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 0)</query>
54
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'journal', 'string')</query>
55
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'journal', 'string')</query>
56
57
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 1)</query>
58
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 1)</query>
59
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'book', 'string')</query>
60
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'book', 'string')</query>
61
62
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 2)</query>
63
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 2)</query>
64
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'conf-proc', 'string')</query>
65
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'conf-proc', 'string')</query>
66
67
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 3)</query>
68
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 3)</query>
69
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'thesis', 'string')</query>
70
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'thesis', 'string')</query>
71
72
		<!-- openurl 1.0 genres (journal) -->
73
		<query>INSERT INTO controlled_vocabs (symbolic, assoc_type, assoc_id) VALUES ('openurl10-journal-genres', 0, 0)</query>
74
		<query driver="mysql">SET @vocab_id = LAST_INSERT_ID()</query>
75
76
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 0)</query>
77
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 0)</query>
78
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'journal', 'string')</query>
79
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'journal', 'string')</query>
80
81
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 0)</query>
82
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 0)</query>
83
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'issue', 'string')</query>
84
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'issue', 'string')</query>
85
86
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 0)</query>
87
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 0)</query>
88
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'article', 'string')</query>
89
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'article', 'string')</query>
90
91
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 0)</query>
92
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 0)</query>
93
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'proceeding', 'string')</query>
94
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'proceeding', 'string')</query>
95
96
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 0)</query>
97
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 0)</query>
98
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'conference', 'string')</query>
99
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'conference', 'string')</query>
100
101
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 0)</query>
102
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 0)</query>
103
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'preprint', 'string')</query>
104
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'preprint', 'string')</query>
105
106
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 0)</query>
107
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 0)</query>
108
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'unknown', 'string')</query>
109
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'unknown', 'string')</query>
110
111
		<!-- openurl 1.0 genres (book) -->
112
		<query>INSERT INTO controlled_vocabs (symbolic, assoc_type, assoc_id) VALUES ('openurl10-book-genres', 0, 0)</query>
113
		<query driver="mysql">SET @vocab_id = LAST_INSERT_ID()</query>
114
115
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 0)</query>
116
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 0)</query>
117
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'book', 'string')</query>
118
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'book', 'string')</query>
119
120
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 0)</query>
121
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 0)</query>
122
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'bookitem', 'string')</query>
123
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'bookitem', 'string')</query>
124
125
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 0)</query>
126
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 0)</query>
127
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'conference', 'string')</query>
128
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'conference', 'string')</query>
129
130
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 0)</query>
131
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 0)</query>
132
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'proceeding', 'string')</query>
133
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'proceeding', 'string')</query>
134
135
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 0)</query>
136
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 0)</query>
137
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'report', 'string')</query>
138
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'report', 'string')</query>
139
140
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 0)</query>
141
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 0)</query>
142
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'document', 'string')</query>
143
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'document', 'string')</query>
144
145
		<query driver="mysql">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (@vocab_id, 0)</query>
146
		<query driver="postgres7">INSERT INTO controlled_vocab_entries (controlled_vocab_id, seq) VALUES (CURRVAL('controlled_vocabs_controlled_vocab_id_seq'), 0)</query>
147
		<query driver="mysql">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (LAST_INSERT_ID(), '', 'name', 'unknown', 'string')</query>
148
		<query driver="postgres7">INSERT INTO controlled_vocab_entry_settings (controlled_vocab_entry_id, locale, setting_name, setting_value, setting_type) VALUES (CURRVAL('controlled_vocab_entries_controlled_vocab_entry_id_seq'), '', 'name', 'unknown', 'string')</query>
149
	</sql>
150
</data>

Return to bug 6817