nfp_sites/migrations/20210107081810_indexes.js

17 lines
600 B
JavaScript
Raw Normal View History

2021-02-05 11:50:01 +00:00
/* eslint-disable */
exports.up = function(knex) {
return Promise.all([
knex.schema.raw('create index pages_gettree_index on pages (name asc) where not is_deleted'),
knex.schema.raw('create index pages_featuredpublish_index on articles (published_at desc) where is_featured = true and not is_deleted'),
knex.schema.raw('create index pages_publish_index on articles (published_at desc) where is_deleted = false'),
])
};
exports.down = function(knex) {
return Promise.all([
knex.schema.table('pages', function(table) {
table.dropIndex('pages_gettree_index')
})
])
};