Fossil SCM

Cleaned up previous reportfmt commit to separate the schema from the data.

stephan 2013-04-30 18:37 trunk
Commit f2b6459ef1da09618262b7757d19aeb5d832206f
3 files changed +2 -2 +1 -1 +15 -14
+2 -2
--- src/configure.c
+++ src/configure.c
@@ -930,12 +930,12 @@
930930
}else if( fossil_strcmp(zName,"@concealed")==0 ){
931931
db_multi_exec("DELETE FROM concealed");
932932
}else if( fossil_strcmp(zName,"@shun")==0 ){
933933
db_multi_exec("DELETE FROM shun");
934934
}else if( fossil_strcmp(zName,"@reportfmt")==0 ){
935
- db_multi_exec("DROP TABLE reportfmt");
936
- db_multi_exec(zRepositorySchemaReports);
935
+ db_multi_exec("DELETE FROM reportfmt");
936
+ db_multi_exec(zRepositorySchemaDefaultReports);
937937
}
938938
}
939939
db_end_transaction(0);
940940
fossil_print("Configuration reset to factory defaults.\n");
941941
fossil_print("To recover, use: %s %s import %s\n",
942942
--- src/configure.c
+++ src/configure.c
@@ -930,12 +930,12 @@
930 }else if( fossil_strcmp(zName,"@concealed")==0 ){
931 db_multi_exec("DELETE FROM concealed");
932 }else if( fossil_strcmp(zName,"@shun")==0 ){
933 db_multi_exec("DELETE FROM shun");
934 }else if( fossil_strcmp(zName,"@reportfmt")==0 ){
935 db_multi_exec("DROP TABLE reportfmt");
936 db_multi_exec(zRepositorySchemaReports);
937 }
938 }
939 db_end_transaction(0);
940 fossil_print("Configuration reset to factory defaults.\n");
941 fossil_print("To recover, use: %s %s import %s\n",
942
--- src/configure.c
+++ src/configure.c
@@ -930,12 +930,12 @@
930 }else if( fossil_strcmp(zName,"@concealed")==0 ){
931 db_multi_exec("DELETE FROM concealed");
932 }else if( fossil_strcmp(zName,"@shun")==0 ){
933 db_multi_exec("DELETE FROM shun");
934 }else if( fossil_strcmp(zName,"@reportfmt")==0 ){
935 db_multi_exec("DELETE FROM reportfmt");
936 db_multi_exec(zRepositorySchemaDefaultReports);
937 }
938 }
939 db_end_transaction(0);
940 fossil_print("Configuration reset to factory defaults.\n");
941 fossil_print("To recover, use: %s %s import %s\n",
942
+1 -1
--- src/db.c
+++ src/db.c
@@ -1227,11 +1227,11 @@
12271227
*/
12281228
void db_create_repository(const char *zFilename){
12291229
db_init_database(
12301230
zFilename,
12311231
zRepositorySchema1,
1232
- zRepositorySchemaReports,
1232
+ zRepositorySchemaDefaultReports,
12331233
zRepositorySchema2,
12341234
(char*)0
12351235
);
12361236
db_delete_on_failure(zFilename);
12371237
}
12381238
--- src/db.c
+++ src/db.c
@@ -1227,11 +1227,11 @@
1227 */
1228 void db_create_repository(const char *zFilename){
1229 db_init_database(
1230 zFilename,
1231 zRepositorySchema1,
1232 zRepositorySchemaReports,
1233 zRepositorySchema2,
1234 (char*)0
1235 );
1236 db_delete_on_failure(zFilename);
1237 }
1238
--- src/db.c
+++ src/db.c
@@ -1227,11 +1227,11 @@
1227 */
1228 void db_create_repository(const char *zFilename){
1229 db_init_database(
1230 zFilename,
1231 zRepositorySchema1,
1232 zRepositorySchemaDefaultReports,
1233 zRepositorySchema2,
1234 (char*)0
1235 );
1236 db_delete_on_failure(zFilename);
1237 }
1238
+15 -14
--- src/schema.c
+++ src/schema.c
@@ -152,10 +152,22 @@
152152
@ -- Artifacts that should not be pushed are stored in the "private"
153153
@ -- table. Private artifacts are omitted from the "unclustered" and
154154
@ -- "unsent" tables.
155155
@ --
156156
@ CREATE TABLE private(rid INTEGER PRIMARY KEY);
157
+@
158
+@ -- An entry in this table describes a database query that generates a
159
+@ -- table of tickets.
160
+@ --
161
+@ CREATE TABLE reportfmt(
162
+@ rn INTEGER PRIMARY KEY, -- Report number
163
+@ owner TEXT, -- Owner of this report format (not used)
164
+@ title TEXT UNIQUE, -- Title of this report
165
+@ mtime DATE, -- Last modified. seconds since 1970
166
+@ cols TEXT, -- A color-key specification
167
+@ sqlcode TEXT -- An SQL SELECT statement for this report
168
+@ );
157169
@
158170
@ -- Some ticket content (such as the originators email address or contact
159171
@ -- information) needs to be obscured to protect privacy. This is achieved
160172
@ -- by storing an SHA1 hash of the content. For display, the hash is
161173
@ -- mapped back into the original text using this table.
@@ -169,25 +181,14 @@
169181
@ content TEXT -- Content intended to be concealed
170182
@ );
171183
;
172184
173185
/*
174
-** The reportfmt parts of the schema. This is in an extra script so
175
-** that (configure reset) can install the default report.
186
+** The default reportfmt entry for the schema. This is in an extra
187
+** script so that (configure reset) can install the default report.
176188
*/
177
-const char zRepositorySchemaReports[] =
178
-@ -- An entry in this table describes a database query that generates a
179
-@ -- table of tickets.
180
-@ --
181
-@ CREATE TABLE reportfmt(
182
-@ rn INTEGER PRIMARY KEY, -- Report number
183
-@ owner TEXT, -- Owner of this report format (not used)
184
-@ title TEXT UNIQUE, -- Title of this report
185
-@ mtime DATE, -- Last modified. seconds since 1970
186
-@ cols TEXT, -- A color-key specification
187
-@ sqlcode TEXT -- An SQL SELECT statement for this report
188
-@ );
189
+const char zRepositorySchemaDefaultReports[] =
189190
@ INSERT INTO reportfmt(title,mtime,cols,sqlcode)
190191
@ VALUES('All Tickets',julianday('1970-01-01'),'#ffffff Key:
191192
@ #f2dcdc Active
192193
@ #e8e8e8 Review
193194
@ #cfe8bd Fixed
194195
--- src/schema.c
+++ src/schema.c
@@ -152,10 +152,22 @@
152 @ -- Artifacts that should not be pushed are stored in the "private"
153 @ -- table. Private artifacts are omitted from the "unclustered" and
154 @ -- "unsent" tables.
155 @ --
156 @ CREATE TABLE private(rid INTEGER PRIMARY KEY);
 
 
 
 
 
 
 
 
 
 
 
 
157 @
158 @ -- Some ticket content (such as the originators email address or contact
159 @ -- information) needs to be obscured to protect privacy. This is achieved
160 @ -- by storing an SHA1 hash of the content. For display, the hash is
161 @ -- mapped back into the original text using this table.
@@ -169,25 +181,14 @@
169 @ content TEXT -- Content intended to be concealed
170 @ );
171 ;
172
173 /*
174 ** The reportfmt parts of the schema. This is in an extra script so
175 ** that (configure reset) can install the default report.
176 */
177 const char zRepositorySchemaReports[] =
178 @ -- An entry in this table describes a database query that generates a
179 @ -- table of tickets.
180 @ --
181 @ CREATE TABLE reportfmt(
182 @ rn INTEGER PRIMARY KEY, -- Report number
183 @ owner TEXT, -- Owner of this report format (not used)
184 @ title TEXT UNIQUE, -- Title of this report
185 @ mtime DATE, -- Last modified. seconds since 1970
186 @ cols TEXT, -- A color-key specification
187 @ sqlcode TEXT -- An SQL SELECT statement for this report
188 @ );
189 @ INSERT INTO reportfmt(title,mtime,cols,sqlcode)
190 @ VALUES('All Tickets',julianday('1970-01-01'),'#ffffff Key:
191 @ #f2dcdc Active
192 @ #e8e8e8 Review
193 @ #cfe8bd Fixed
194
--- src/schema.c
+++ src/schema.c
@@ -152,10 +152,22 @@
152 @ -- Artifacts that should not be pushed are stored in the "private"
153 @ -- table. Private artifacts are omitted from the "unclustered" and
154 @ -- "unsent" tables.
155 @ --
156 @ CREATE TABLE private(rid INTEGER PRIMARY KEY);
157 @
158 @ -- An entry in this table describes a database query that generates a
159 @ -- table of tickets.
160 @ --
161 @ CREATE TABLE reportfmt(
162 @ rn INTEGER PRIMARY KEY, -- Report number
163 @ owner TEXT, -- Owner of this report format (not used)
164 @ title TEXT UNIQUE, -- Title of this report
165 @ mtime DATE, -- Last modified. seconds since 1970
166 @ cols TEXT, -- A color-key specification
167 @ sqlcode TEXT -- An SQL SELECT statement for this report
168 @ );
169 @
170 @ -- Some ticket content (such as the originators email address or contact
171 @ -- information) needs to be obscured to protect privacy. This is achieved
172 @ -- by storing an SHA1 hash of the content. For display, the hash is
173 @ -- mapped back into the original text using this table.
@@ -169,25 +181,14 @@
181 @ content TEXT -- Content intended to be concealed
182 @ );
183 ;
184
185 /*
186 ** The default reportfmt entry for the schema. This is in an extra
187 ** script so that (configure reset) can install the default report.
188 */
189 const char zRepositorySchemaDefaultReports[] =
 
 
 
 
 
 
 
 
 
 
 
190 @ INSERT INTO reportfmt(title,mtime,cols,sqlcode)
191 @ VALUES('All Tickets',julianday('1970-01-01'),'#ffffff Key:
192 @ #f2dcdc Active
193 @ #e8e8e8 Review
194 @ #cfe8bd Fixed
195

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button