Ghost/core/server/models/base
Naz 6b61bcf123 Added unique constraint notation to schema definition
refs https://github.com/TryGhost/Ghost/issues/12567

- Introduced here @@UNIQUE_CONSTRAINTS@@ notation allows to create unique contraints over multiple database fields. This will be needed to change posts' table unique constraint from `slug` to `slug+type`.
- The notation is equivalent to SQL's: UNIQUE(column_name1,column_name2)
- Example use in schema:
posts: {
    slug: {type: 'string', maxlength: 191, nullable: false},
    type: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'post', validations: {isIn: [['post', 'page']]}},
    '@@UNIQUES@@': [
        ['slug', 'type']
    ]
}
2021-02-04 13:37:20 +13:00
..
bulk-operations.js Added error handling for failed member imports 2020-08-26 17:11:35 +12:00
index.js Added unique constraint notation to schema definition 2021-02-04 13:37:20 +13:00
listeners.js Extracted promise libs and history into @tryghost/promise 2020-08-11 18:44:21 +01:00
utils.js Fixed "no-shadow" linting error in server modules (#12287) 2020-10-20 12:02:56 +13:00