Make slug of single page be not unique (#6545)

#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.19.0

#### What this PR does / why we need it:

For backward compatibility, the slug of single page should not be unique.

BTW, the problem was introduced by <https://github.com/halo-dev/halo/pull/6540>.

#### Does this PR introduce a user-facing change?

```release-note
None
```
pull/6548/head
John Niang 2024-08-29 12:17:25 +08:00 committed by GitHub
parent 19049c1302
commit e476ddac71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -490,7 +490,7 @@ public class SchemeInitializer implements ApplicationListener<ApplicationContext
);
is.add(new IndexSpec()
.setName("spec.slug")
.setUnique(true)
.setUnique(false)
.setIndexFunc(
simpleAttribute(SinglePage.class, page -> Optional.ofNullable(page.getSpec())
.map(SinglePage.SinglePageSpec::getSlug)