mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
fix migrations
This commit is contained in:
parent
168aed6233
commit
a326b2777f
@ -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"])
|
||||
`)
|
||||
|
||||
@ -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")`)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user