Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixed problem: schema update 5 accitentially pasted into 4.

git-svn-id: https://svn.cocoanetics.com/myappsales/trunk@180 3a964c32-7461-4f60-ae82-ad05498e24dc
  • Loading branch information...
commit 2f1b64e871be9466c1daffc5b89577dfcb814446 1 parent 2142fc0
oliver authored

Showing 2 changed files with 45 additions and 5 deletions. Show diff stats Hide diff stats

  1. +31 5 update_3_to_4.sql
  2. +14 0 update_4_to_5.sql
36 update_3_to_4.sql
... ... @@ -1,14 +1,40 @@
1   -/* Script to update apps.db from schema version 4 to 5 */
  1 +/* Script to update apps.db from schema version 3 to 4 */
2 2
3 3 begin exclusive transaction;
4 4
5   -/* Remove index causing problems */
  5 +/* fix incorrect language for Turkey */
6 6
7   -drop index app_name;
  7 +UPDATE Country SET language="tr", app_store_id=143480 WHERE ISO2="TR";
  8 +
  9 +/* fix writing so that country is found for Jan 2009 report */
  10 +update country set Name = 'Great Britain' where iso2 = 'GB';
  11 +update country set name = 'Taiwan' where iso2 = 'TW';
  12 +update country set name = 'Russian Fed.' where iso2 = 'RU';
  13 +update country set name = 'South Korea' where iso2 = 'KR';
  14 +update country set name = 'Unit.Arab Emir.' where iso2 = 'AE';
  15 +update country set name = 'Czech. Republic' where iso2 = 'CZ';
  16 +
  17 +
  18 +/* add account table */
  19 +
  20 +CREATE TABLE AppGrouping (id INTEGER PRIMARY KEY, description VARCHAR);
  21 +
  22 +/* add accountapps table */
  23 +
  24 +CREATE TABLE AppAppGrouping( app_id INTEGER PRIMARY KEY, appgrouping_id INTEGER);
  25 +
  26 +/* add accountapps table */
  27 +
  28 +CREATE TABLE ReportAppGrouping (report_id INTEGER PRIMARY KEY, appgrouping_id INTEGER);
  29 +
  30 +/* set defaults, assume that all reports came from same app grouping aka account */
  31 +
  32 +insert into AppGrouping (id, description) values (1, 'Default');
  33 +insert into AppAppGrouping (app_id, appgrouping_id) select distinct app_id, 1 from sale;
  34 +insert into ReportAppGrouping (report_id, appgrouping_id) select distinct id, 1 from report;
8 35
9 36 /* update schema_version */
10 37
11   -/*
12 38 update meta set schema_version = 4;
13   -*/
  39 +
14 40 commit;
14 update_4_to_5.sql
... ... @@ -0,0 +1,14 @@
  1 +/* Script to update apps.db from schema version 4 to 5 */
  2 +
  3 +begin exclusive transaction;
  4 +
  5 +/* Remove index causing problems */
  6 +
  7 +drop index if exists app_name;
  8 +
  9 +/* update schema_version */
  10 +
  11 +/*
  12 +update meta set schema_version = 4;
  13 +*/
  14 +commit;

0 comments on commit 2f1b64e

Please sign in to comment.
Something went wrong with that request. Please try again.