0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00
ghost/core/server/models
Rishabh Garg 8ec12d9eee
🏗 Extracted post metadata in new post_meta table (#11102)
NOTE: The post metadata table split is purely an internal optimization for v3 and doesn't require or expect any external actions including related API usage in v3

We keep running into issues adding new fields to the post table because there are too many fields making the post table "too wide". We have also hit MySQL limitations in how many bytes can be in a row (64kb) with post table.

In v3, we decided to split the 8 post fields (meta, twitter and og) used for meta data into a posts_meta table as these 8 fields are all "problem" `varchar` fields and make sense logically grouped together. The API layer is unaffected by the split as input/output serializers ensure the data flow works the same way as it was in v2. Only thing to note is json export in v3 will have slightly different structure with posts meta fields as separate.

- Creates new post_meta schema/table with 8 fields (2 meta_* , 3 twitter_* and 3 og_*)
- Update relations between post and post_meta table
- Update input/output serializers to keep existing API behavior
- Avoids new entry in post_meta table for post where all meta fields are null
- Keeps the current fields API param behavior
- Handles migration of existing posts to new table structure
- Updates importer/exporter to work seamlessly with table changes
2019-09-16 14:15:55 +05:30
..
base 🏗 Extracted post metadata in new post_meta table (#11102) 2019-09-16 14:15:55 +05:30
plugins Revert post.page->post.type handling 2019-08-19 12:02:14 +01:00
relations 🐛 Fixed field filtering for /authors/:id endpoints 2019-03-05 15:18:32 +08:00
action.js Added model implementation for actions 2019-02-06 21:36:09 +01:00
api-key.js Created DB Backup integration (#10974) 2019-08-02 17:28:02 +08:00
app-field.js
app-setting.js
app.js Updated permittedOptions to correctly call super 2018-09-21 12:15:29 +02:00
author.js Added plugin based author and public tag models in API v2 (#10284) 2019-01-03 20:30:35 +01:00
index.js 🏗 Extracted post metadata in new post_meta table (#11102) 2019-09-16 14:15:55 +05:30
integration.js Ensured Admin API cannot fetch internal integrations (#10501) 2019-07-24 11:52:55 +02:00
invite.js Updated permissible methods for hasApiKeyPermissions (#9970) 2019-01-18 13:39:53 +01:00
member.js Added members related db changes and models 2018-12-11 11:53:55 +07:00
mobiledoc-revision.js Added mobiledoc revisions functionality 2018-10-09 15:31:09 +02:00
permission.js 🔥 Drop Node v4 Support 2018-05-01 14:06:18 +02:00
post.js 🏗 Extracted post metadata in new post_meta table (#11102) 2019-09-16 14:15:55 +05:30
posts-meta.js 🏗 Extracted post metadata in new post_meta table (#11102) 2019-09-16 14:15:55 +05:30
role.js Updated permissible methods for hasApiKeyPermissions (#9970) 2019-01-18 13:39:53 +01:00
session.js Removed user_id constraint when upserting session (#10085) 2018-10-30 16:15:48 +07:00
settings.js Update Test & linting packages (major) (#10858) 2019-07-05 13:40:43 +02:00
subscriber.js Ensured consistency for event handlers in the model layer 2019-02-07 11:02:35 +01:00
tag-public.js Added plugin based author and public tag models in API v2 (#10284) 2019-01-03 20:30:35 +01:00
tag.js Reverted parent_id removal in tags in toJSON 2019-09-13 20:49:20 +02:00
user.js 🔥 Removed v0.1 leftover code in model layer (#11107) 2019-09-12 17:39:16 +02:00
webhook.js Ensured consistency for event handlers in the model layer 2019-02-07 11:02:35 +01:00