mirror of
https://framagit.org/fiat-tux/hat-softwares/lutim.git
synced 2026-03-28 17:42:54 +01:00
[postgresql] Add partial index to speed up some queries
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
Revision history for Lutim
|
||||
|
||||
????? ??????????
|
||||
- PostgreSQL performance improvments
|
||||
|
||||
0.9.6 2018-03-12
|
||||
- Update translations
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ sub register {
|
||||
# Database migration
|
||||
my $migrations = Mojo::Pg::Migrations->new(pg => $app->pg);
|
||||
if ($app->mode eq 'development' && $ENV{LUTIM_DEBUG}) {
|
||||
$migrations->from_file('utilities/migrations/postgresql.sql')->migrate(0)->migrate(2);
|
||||
$migrations->from_file('utilities/migrations/postgresql.sql')->migrate(0)->migrate(3);
|
||||
} else {
|
||||
$migrations->from_file('utilities/migrations/postgresql.sql')->migrate(2);
|
||||
$migrations->from_file('utilities/migrations/postgresql.sql')->migrate(3);
|
||||
}
|
||||
} elsif ($app->config('dbtype') eq 'sqlite') {
|
||||
# SQLite database migration if needed
|
||||
|
||||
@@ -22,3 +22,7 @@ DROP TABLE lutim;
|
||||
ALTER TABLE lutim ADD COLUMN iv text;
|
||||
-- 2 down
|
||||
ALTER TABLE lutim DROP COLUMN iv;
|
||||
-- 3 up
|
||||
CREATE INDEX IF NOT EXISTS empty_short_idx ON lutim (short) WHERE path IS NULL;
|
||||
-- 3 down
|
||||
DROP INDEX empty_short_idx;
|
||||
|
||||
Reference in New Issue
Block a user