diff --git a/migrations/20211212200953-fulltext-search.cjs b/migrations/20211212200953-fulltext-search.cjs new file mode 100644 index 00000000..79c03fec --- /dev/null +++ b/migrations/20211212200953-fulltext-search.cjs @@ -0,0 +1,17 @@ +'use strict'; + +module.exports = { + up: async (queryInterface, Sequelize) => { + await queryInterface.sequelize.query("create virtual table Projects using fts5 (warehouseProjectId, currentRegistry, registryOfOrigin, originProjectId, program, projectName, projectLink, projectDeveloper, sector, projectType, coveredByNDC, NDCLinkage, projectStatus, projectStatusDate, unitMetric, methodology, methodologyVersion, validationApproach, validationDate, projectTag, estimatedAnnualAverageEmissionReduction, owner);"); + await queryInterface.sequelize.query("create virtual table Units using fts5 (ProjectId, owner, buyer, registry, blockIdentifier, identifier, qualificationId, unitType, unitCount, unitStatus, unitStatusDate, transactionType, unitIssuanceLocation, unitLink, correspondingAdjustment, unitTag, vintageId"); + }, + + down: async (queryInterface, Sequelize) => { + /** + * Add reverting commands here. + * + * Example: + * await queryInterface.dropTable('users'); + */ + } +};