{"action":"created","issue":{"url":"https://api.github.com/repos/TryGhost/Ghost/issues/6301","labels_url":"https://api.github.com/repos/TryGhost/Ghost/issues/6301/labels{/name}","comments_url":"https://api.github.com/repos/TryGhost/Ghost/issues/6301/comments","events_url":"https://api.github.com/repos/TryGhost/Ghost/issues/6301/events","html_url":"https://github.com/TryGhost/Ghost/issues/6301","id":125374138,"number":6301,"title":"Database schema & fixtures migration v005","user":{"login":"ErisDS","id":101513,"avatar_url":"https://avatars.githubusercontent.com/u/101513?v=3","gravatar_id":"","url":"https://api.github.com/users/ErisDS","html_url":"https://github.com/ErisDS","followers_url":"https://api.github.com/users/ErisDS/followers","following_url":"https://api.github.com/users/ErisDS/following{/other_user}","gists_url":"https://api.github.com/users/ErisDS/gists{/gist_id}","starred_url":"https://api.github.com/users/ErisDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErisDS/subscriptions","organizations_url":"https://api.github.com/users/ErisDS/orgs","repos_url":"https://api.github.com/users/ErisDS/repos","events_url":"https://api.github.com/users/ErisDS/events{/privacy}","received_events_url":"https://api.github.com/users/ErisDS/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TryGhost/Ghost/labels/data","name":"data","color":"C0E5C8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-01-07T11:13:36Z","updated_at":"2016-01-12T19:03:43Z","closed_at":null,"body":"Several of the new features we want to add require us to make changes to the schema & fixtures, so we're going to need to setup a new data migration.\r\n\r\nDoing this for Ghost is not as easy as we'd like, but then again, we don't do it very often atm, so optimising this process isn't high priority. Still, for this migration, we need to make some changes and improvements to the system as well as the migration itself.\r\n\r\nThis issue documents two sections of changes: must-haves and nice-to-haves. It's basically a log of all the outstanding issues with data and fixtures that we should change if we can, as well as the things we *have* to do for upcoming features.\r\n\r\n## Must haves\r\n\r\nThese things need to be done for 005:\r\n\r\n### Schema\r\n\r\n- [ ] add posts.mobiledoc - this is for the new editor spike #6255\r\n- [ ] add posts.is_private - this is speculative, as there's high demand for certain posts being private\r\n- [ ] change tags.hidden to tags.hashtag - this is for #6165\r\n- [ ] move the fix for the client secret from migrations/index.js into a migration for 005\r\n\r\n### Fixtures\r\n\r\n- [ ] client API permissions (refs #4175, #4176,  and #4177)\r\n\r\n### Code changes\r\n\r\n- [ ] Make it possible to remove a column (requires #6103)\r\n\r\n\r\n## Nice to haves \r\n\r\nIt would be great if we could also do these things:\r\n\r\n### Schema\r\n\r\n- [ ] client_trusted_domains table should ideally have timestamps, not sure if these can be easily added as we don't have values for existing entries.\r\n- [ ] look at fixing slugs which contained `{`, `}` or \\` - not sure if this is a good idea as it would break old posts\r\n- [ ] fix the field lengths #4134 (maybe set markdown, mobiledoc & html to be long as well)\r\n\r\n### Fixtures\r\n- [ ] theme API permissions\r\n- [ ] config API permissions\r\n- [ ] audit any remaining missing API permissions (apps?)\r\n\r\n### Code changes\r\n- [ ] Review the idea of switching to knex migrations: #4824\r\n- [ ] Review the issues here: #4479\r\n- [ ] Code cleanup/improvement around migrations & fixtures (smaller functions, clearer naming, etc)\r\n- [ ] Ensure that all the functions which modify a fixture (E.g. [this code](https://github.com/TryGhost/Ghost/blob/a87715f68851a2937749fdfbb25e639274ae8d2b/core/server/data/fixtures/index.js#L185-L185) are idempotent (they won't have any effect if run a second time), and make sure they're all clearly named and documented.  \r\n- [ ] Change the [through version](https://github.com/TryGhost/Ghost/blob/a87715f68851a2937749fdfbb25e639274ae8d2b/core/server/data/fixtures/index.js#L347-L347) fixture code to be dynamic rather than hard-coded. It'd be great to just register a set of fixture migrations that have to happen at a particular version, and let those be handled without having to write extra code each time."},"comment":{"url":"https://api.github.com/repos/TryGhost/Ghost/issues/comments/171017036","html_url":"https://github.com/TryGhost/Ghost/issues/6301#issuecomment-171017036","issue_url":"https://api.github.com/repos/TryGhost/Ghost/issues/6301","id":171017036,"user":{"login":"halfdan","id":176576,"avatar_url":"https://avatars.githubusercontent.com/u/176576?v=3","gravatar_id":"","url":"https://api.github.com/users/halfdan","html_url":"https://github.com/halfdan","followers_url":"https://api.github.com/users/halfdan/followers","following_url":"https://api.github.com/users/halfdan/following{/other_user}","gists_url":"https://api.github.com/users/halfdan/gists{/gist_id}","starred_url":"https://api.github.com/users/halfdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halfdan/subscriptions","organizations_url":"https://api.github.com/users/halfdan/orgs","repos_url":"https://api.github.com/users/halfdan/repos","events_url":"https://api.github.com/users/halfdan/events{/privacy}","received_events_url":"https://api.github.com/users/halfdan/received_events","type":"User","site_admin":false},"created_at":"2016-01-12T19:03:43Z","updated_at":"2016-01-12T19:03:43Z","body":"@kevinansfield @ErisDS It makes me slightly uneasy seeing `page`, `featured`, `hashtag` as booleans without the `is_` prefix and then `is_private`. I understand the reasoning - but it seems very inconsistent with the existing boolean flags. I realise it's difficult finding a fitting synonym that would work here - `secret` or `concealed` come to mind, but those aren't in line with the use of \"private\" in the UI. \r\n\r\nThis might also have an impact on the theme / public API where it's going to be odd having `isPrivate` (because, consistency) and just `page` (not `isPage` nor `isFeatured`). "}}