mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-07 18:01:42 +00:00
add postgres dialect support for homelab migration
This commit is contained in:
parent
fa5fa7b788
commit
453cd2587b
20 changed files with 851 additions and 159 deletions
|
|
@ -137,6 +137,8 @@ class Book extends Model {
|
|||
* @param {import('../Database').sequelize} sequelize
|
||||
*/
|
||||
static init(sequelize) {
|
||||
const titleIndexField = sequelize.getDialect() === 'postgres' ? 'title' : { name: 'title', collate: 'NOCASE' }
|
||||
|
||||
super.init(
|
||||
{
|
||||
id: {
|
||||
|
|
@ -171,12 +173,7 @@ class Book extends Model {
|
|||
modelName: 'book',
|
||||
indexes: [
|
||||
{
|
||||
fields: [
|
||||
{
|
||||
name: 'title',
|
||||
collate: 'NOCASE'
|
||||
}
|
||||
]
|
||||
fields: [titleIndexField]
|
||||
},
|
||||
// {
|
||||
// fields: [{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue