Skip to content

Commit

Permalink
fixed problem: schema update 5 accitentially pasted into 4.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.cocoanetics.com/myappsales/trunk@180 3a964c32-7461-4f60-ae82-ad05498e24dc
  • Loading branch information
oliver committed Nov 11, 2009
1 parent 2142fc0 commit 2f1b64e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 5 deletions.
36 changes: 31 additions & 5 deletions update_3_to_4.sql
@@ -1,14 +1,40 @@
/* Script to update apps.db from schema version 4 to 5 */
/* Script to update apps.db from schema version 3 to 4 */

begin exclusive transaction;

/* Remove index causing problems */
/* fix incorrect language for Turkey */

drop index app_name;
UPDATE Country SET language="tr", app_store_id=143480 WHERE ISO2="TR";

/* fix writing so that country is found for Jan 2009 report */
update country set Name = 'Great Britain' where iso2 = 'GB';
update country set name = 'Taiwan' where iso2 = 'TW';
update country set name = 'Russian Fed.' where iso2 = 'RU';
update country set name = 'South Korea' where iso2 = 'KR';
update country set name = 'Unit.Arab Emir.' where iso2 = 'AE';
update country set name = 'Czech. Republic' where iso2 = 'CZ';


/* add account table */

CREATE TABLE AppGrouping (id INTEGER PRIMARY KEY, description VARCHAR);

/* add accountapps table */

CREATE TABLE AppAppGrouping( app_id INTEGER PRIMARY KEY, appgrouping_id INTEGER);

/* add accountapps table */

CREATE TABLE ReportAppGrouping (report_id INTEGER PRIMARY KEY, appgrouping_id INTEGER);

/* set defaults, assume that all reports came from same app grouping aka account */

insert into AppGrouping (id, description) values (1, 'Default');
insert into AppAppGrouping (app_id, appgrouping_id) select distinct app_id, 1 from sale;
insert into ReportAppGrouping (report_id, appgrouping_id) select distinct id, 1 from report;

/* update schema_version */

/*
update meta set schema_version = 4;
*/

commit;
14 changes: 14 additions & 0 deletions update_4_to_5.sql
@@ -0,0 +1,14 @@
/* Script to update apps.db from schema version 4 to 5 */

begin exclusive transaction;

/* Remove index causing problems */

drop index if exists app_name;

/* update schema_version */

/*
update meta set schema_version = 4;
*/
commit;

0 comments on commit 2f1b64e

Please sign in to comment.