From 5cc44b2ed374d5d2c9f3c74d1b2d7f1973746cfb Mon Sep 17 00:00:00 2001 From: Tle Ekkul Date: Tue, 21 May 2019 20:26:20 +0700 Subject: [PATCH] Add index for app_installation --- Schema/app/007-installation-indexing.blue.sql | 3 +++ tests/CMakeLists.txt | 7 +++++++ tests/app-handover.fg | 1 + tests/app-installation.fg | 1 + tests/app-login-facebook.fg | 1 + tests/app-login-google.fg | 1 + tests/app-login.fg | 1 + tests/app-secure.fg | 1 + tests/app-verify.fg | 1 + tests/app.mint.fg | 1 + tests/merge-account.fg | 1 + 11 files changed, 19 insertions(+) create mode 100644 Schema/app/007-installation-indexing.blue.sql diff --git a/Schema/app/007-installation-indexing.blue.sql b/Schema/app/007-installation-indexing.blue.sql new file mode 100644 index 0000000..2196914 --- /dev/null +++ b/Schema/app/007-installation-indexing.blue.sql @@ -0,0 +1,3 @@ +INSERT INTO odin.migration VALUES('app', '007-installation-indexing.blue.sql'); + +CREATE INDEX IF NOT EXISTS idx_app_installation_id ON odin.app_user_installation_id_ledger (app_id, installation_id); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 63ad602..4e786a8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -133,6 +133,7 @@ if(TARGET stress OR TARGET pgtest) ../Schema/app/004-app-installation.blue.sql ../Schema/app/005-alter-ledgers.blue.sql ../Schema/app/006-merge-account-function.blue.sql + ../Schema/app/007-installation-indexing.blue.sql ../Schema/opts/email/001-initial.blue.sql ../Schema/opts/email/003-alter-ledgers.blue.sql ../Schema/opts/email/004-merge-account-function.blue.sql @@ -504,6 +505,7 @@ if(TARGET stress OR TARGET pgtest) ../Schema/app/004-app-installation.blue.sql ../Schema/app/005-alter-ledgers.blue.sql ../Schema/app/006-merge-account-function.blue.sql + ../Schema/app/007-installation-indexing.blue.sql ../Configuration/odin-views.json app-installation.fg ) @@ -535,6 +537,7 @@ if(TARGET stress OR TARGET pgtest) ../Schema/app/004-app-installation.blue.sql ../Schema/app/005-alter-ledgers.blue.sql ../Schema/app/006-merge-account-function.blue.sql + ../Schema/app/007-installation-indexing.blue.sql ../Configuration/odin-views.json app.mint-test.json app.mint.fg @@ -566,6 +569,7 @@ if(TARGET stress OR TARGET pgtest) ../Schema/app/004-app-installation.blue.sql ../Schema/app/005-alter-ledgers.blue.sql ../Schema/app/006-merge-account-function.blue.sql + ../Schema/app/007-installation-indexing.blue.sql ../Configuration/odin-views.json app-login.fg ) @@ -681,6 +685,7 @@ if(TARGET stress OR TARGET pgtest) ../Schema/app/004-app-installation.blue.sql ../Schema/app/005-alter-ledgers.blue.sql ../Schema/app/006-merge-account-function.blue.sql + ../Schema/app/007-installation-indexing.blue.sql app-secure-test-view.json app-secure.fg ) @@ -710,6 +715,7 @@ if(TARGET stress OR TARGET pgtest) ../Schema/app/004-app-installation.blue.sql ../Schema/app/005-alter-ledgers.blue.sql ../Schema/app/006-merge-account-function.blue.sql + ../Schema/app/007-installation-indexing.blue.sql app-verify.fg ) @@ -744,6 +750,7 @@ if(TARGET stress OR TARGET pgtest) ../Schema/app/004-app-installation.blue.sql ../Schema/app/005-alter-ledgers.blue.sql ../Schema/app/006-merge-account-function.blue.sql + ../Schema/app/007-installation-indexing.blue.sql ../Schema/opts/full-name/001-initial.blue.sql ../Schema/opts/full-name/003-alter-ledgers.blue.sql ../Schema/opts/full-name/004-merge-account-function.blue.sql diff --git a/tests/app-handover.fg b/tests/app-handover.fg index 569073c..20ac2fd 100644 --- a/tests/app-handover.fg +++ b/tests/app-handover.fg @@ -9,6 +9,7 @@ odin.sql.file (module.path.join ../Schema/app/003-app-role.blue.sql) odin.sql.file (module.path.join ../Schema/app/004-app-installation.blue.sql) odin.sql.file (module.path.join ../Schema/app/005-alter-ledgers.blue.sql) odin.sql.file (module.path.join ../Schema/app/006-merge-account-function.blue.sql) +odin.sql.file (module.path.join ../Schema/app/007-installation-indexing.blue.sql) # Set up new users and apps odin.user owner owner password1234 diff --git a/tests/app-installation.fg b/tests/app-installation.fg index 42cb65a..23284e8 100644 --- a/tests/app-installation.fg +++ b/tests/app-installation.fg @@ -9,6 +9,7 @@ odin.sql.file (module.path.join ../Schema/app/003-app-role.blue.sql) odin.sql.file (module.path.join ../Schema/app/004-app-installation.blue.sql) odin.sql.file (module.path.join ../Schema/app/005-alter-ledgers.blue.sql) odin.sql.file (module.path.join ../Schema/app/006-merge-account-function.blue.sql) +odin.sql.file (module.path.join ../Schema/app/007-installation-indexing.blue.sql) # Set up apps sql.insert odin.identity {"id": "invited-only-app"} diff --git a/tests/app-login-facebook.fg b/tests/app-login-facebook.fg index 5a4bc7a..142b9a7 100644 --- a/tests/app-login-facebook.fg +++ b/tests/app-login-facebook.fg @@ -19,6 +19,7 @@ odin.sql.file (module.path.join ../Schema/app/003-app-role.blue.sql) odin.sql.file (module.path.join ../Schema/app/004-app-installation.blue.sql) odin.sql.file (module.path.join ../Schema/app/005-alter-ledgers.blue.sql) odin.sql.file (module.path.join ../Schema/app/006-merge-account-function.blue.sql) +odin.sql.file (module.path.join ../Schema/app/007-installation-indexing.blue.sql) setting odin "JWT secret" setting odin "Facebook API Endpoint" "https://graph.facebook.com/v3.2" diff --git a/tests/app-login-google.fg b/tests/app-login-google.fg index 47b8394..92c3153 100644 --- a/tests/app-login-google.fg +++ b/tests/app-login-google.fg @@ -19,6 +19,7 @@ odin.sql.file (module.path.join ../Schema/app/003-app-role.blue.sql) odin.sql.file (module.path.join ../Schema/app/004-app-installation.blue.sql) odin.sql.file (module.path.join ../Schema/app/005-alter-ledgers.blue.sql) odin.sql.file (module.path.join ../Schema/app/006-merge-account-function.blue.sql) +odin.sql.file (module.path.join ../Schema/app/007-installation-indexing.blue.sql) setting odin "JWT secret" diff --git a/tests/app-login.fg b/tests/app-login.fg index c864610..e74852a 100644 --- a/tests/app-login.fg +++ b/tests/app-login.fg @@ -53,6 +53,7 @@ POST odin/app /login/invite-only-app/ {"username": "player2", "password": "passw odin.sql.file (module.path.join ../Schema/app/004-app-installation.blue.sql) odin.sql.file (module.path.join ../Schema/app/005-alter-ledgers.blue.sql) odin.sql.file (module.path.join ../Schema/app/006-merge-account-function.blue.sql) +odin.sql.file (module.path.join ../Schema/app/007-installation-indexing.blue.sql) sql.insert odin.identity {"id": "open-app"} sql.insert odin.app_ledger { diff --git a/tests/app-secure.fg b/tests/app-secure.fg index 5d55223..ceaca60 100644 --- a/tests/app-secure.fg +++ b/tests/app-secure.fg @@ -9,6 +9,7 @@ odin.sql.file (module.path.join ../Schema/app/003-app-role.blue.sql) odin.sql.file (module.path.join ../Schema/app/004-app-installation.blue.sql) odin.sql.file (module.path.join ../Schema/app/005-alter-ledgers.blue.sql) odin.sql.file (module.path.join ../Schema/app/006-merge-account-function.blue.sql) +odin.sql.file (module.path.join ../Schema/app/007-installation-indexing.blue.sql) # Set up new users and apps odin.user owner owner password1234 diff --git a/tests/app-verify.fg b/tests/app-verify.fg index 7e319e2..4a0387b 100644 --- a/tests/app-verify.fg +++ b/tests/app-verify.fg @@ -9,6 +9,7 @@ odin.sql.file (module.path.join ../Schema/app/003-app-role.blue.sql) odin.sql.file (module.path.join ../Schema/app/004-app-installation.blue.sql) odin.sql.file (module.path.join ../Schema/app/005-alter-ledgers.blue.sql) odin.sql.file (module.path.join ../Schema/app/006-merge-account-function.blue.sql) +odin.sql.file (module.path.join ../Schema/app/007-installation-indexing.blue.sql) # Set up new users and apps odin.user owner owner password1234 diff --git a/tests/app.mint.fg b/tests/app.mint.fg index 9093355..afb075e 100644 --- a/tests/app.mint.fg +++ b/tests/app.mint.fg @@ -9,6 +9,7 @@ odin.sql.file (module.path.join ../Schema/app/003-app-role.blue.sql) odin.sql.file (module.path.join ../Schema/app/004-app-installation.blue.sql) odin.sql.file (module.path.join ../Schema/app/005-alter-ledgers.blue.sql) odin.sql.file (module.path.join ../Schema/app/006-merge-account-function.blue.sql) +odin.sql.file (module.path.join ../Schema/app/007-installation-indexing.blue.sql) sql.insert odin.identity {"id": "bowling"} sql.insert odin.app_ledger { diff --git a/tests/merge-account.fg b/tests/merge-account.fg index 571aeaa..0885a9d 100644 --- a/tests/merge-account.fg +++ b/tests/merge-account.fg @@ -17,6 +17,7 @@ odin.sql.file (module.path.join ../Schema/app/003-app-role.blue.sql) odin.sql.file (module.path.join ../Schema/app/004-app-installation.blue.sql) odin.sql.file (module.path.join ../Schema/app/005-alter-ledgers.blue.sql) odin.sql.file (module.path.join ../Schema/app/006-merge-account-function.blue.sql) +odin.sql.file (module.path.join ../Schema/app/007-installation-indexing.blue.sql) # module opts/email odin.sql.file (module.path.join ../Schema/opts/email/001-initial.blue.sql) odin.sql.file (module.path.join ../Schema/opts/email/003-alter-ledgers.blue.sql)