fix migrations

This commit is contained in:
Ulf Gebhardt 2023-05-16 00:38:02 +02:00
parent 168aed6233
commit a326b2777f
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
2 changed files with 7 additions and 7 deletions

View File

@ -12,12 +12,12 @@ export async function up(next) {
try {
// Implement your migration here.
await transaction.run(`
CREATE CONSTRAINT ON ( group:Group ) ASSERT group.id IS UNIQUE
`)
await transaction.run(`
CREATE CONSTRAINT ON ( group:Group ) ASSERT group.slug IS UNIQUE
`)
//await transaction.run(`
// CREATE CONSTRAINT ON ( group:Group ) ASSERT group.id IS UNIQUE
//`)
//await transaction.run(`
// CREATE CONSTRAINT ON ( group:Group ) ASSERT group.slug IS UNIQUE
//`)
await transaction.run(`
CALL db.index.fulltext.createNodeIndex("group_fulltext_search",["Group"],["name", "slug", "about", "description"])
`)

View File

@ -10,7 +10,7 @@ export async function up(next) {
try {
// Drop indexes if they exist because due to legacy code they might be set already
const indexesResponse = await transaction.run(`CALL db.indexes()`)
const indexes = indexesResponse.records.map((record) => record.get('indexName'))
const indexes = indexesResponse.records.map((record) => record.get('name'))
if (indexes.indexOf('user_fulltext_search') > -1) {
await transaction.run(`CALL db.index.fulltext.drop("user_fulltext_search")`)
}