-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🏗️ Added meta fields to collections table
closes https://github.com/TryGhost/Arch/issues/19 - Adds "meta" fields similarly to the ones in "tags" table. We need these fields in collections as collections as a resource will be routable page - should be able to have customizable meta fields for the meta HTML headers and some extras like "accent_color"
- Loading branch information
Showing
3 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
75 changes: 75 additions & 0 deletions
75
...e/server/data/migrations/versions/5.60/2023-08-16-08-45-37-add-collections-meta-fields.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
const {combineNonTransactionalMigrations, createAddColumnMigration} = require('../../utils'); | ||
|
||
module.exports = combineNonTransactionalMigrations( | ||
createAddColumnMigration('collections', 'og_image', { | ||
type: 'string', | ||
maxlength: 2000, | ||
nullable: true | ||
}), | ||
createAddColumnMigration('collections', 'og_title', { | ||
type: 'string', | ||
maxlength: 300, | ||
nullable: true | ||
}), | ||
createAddColumnMigration('collections', 'og_description', { | ||
type: 'string', | ||
maxlength: 500, | ||
nullable: true | ||
}), | ||
createAddColumnMigration('collections', 'twitter_image', { | ||
type: 'string', | ||
maxlength: 2000, | ||
nullable: true | ||
}), | ||
createAddColumnMigration('collections', 'twitter_title', { | ||
type: 'string', | ||
maxlength: 300, | ||
nullable: true | ||
}), | ||
createAddColumnMigration('collections', 'twitter_description', { | ||
type: 'string', | ||
maxlength: 500, | ||
nullable: true | ||
}), | ||
createAddColumnMigration('collections', 'meta_title', { | ||
type: 'string', | ||
maxlength: 2000, | ||
nullable: true, | ||
validations: { | ||
isLength: { | ||
max: 300 | ||
} | ||
} | ||
}), | ||
createAddColumnMigration('collections', 'meta_description', { | ||
type: 'string', | ||
maxlength: 2000, | ||
nullable: true, | ||
validations: { | ||
isLength: { | ||
max: 500 | ||
} | ||
} | ||
}), | ||
createAddColumnMigration('collections', 'codeinjection_head', { | ||
type: 'text', | ||
maxlength: 65535, | ||
nullable: true | ||
}), | ||
createAddColumnMigration('collections', 'codeinjection_foot', { | ||
type: 'text', | ||
maxlength: 65535, | ||
nullable: true | ||
}), | ||
createAddColumnMigration('collections', 'canonical_url', { | ||
type: 'string', | ||
maxlength: 2000, | ||
nullable: true | ||
}), | ||
createAddColumnMigration('collections', 'accent_color', { | ||
type: 'string', | ||
maxlength: 50, | ||
nullable: true | ||
}) | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters