0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/test/unit
Katharina Irrgang 2e1d7fcc42 🚨 database: change hard limits and field types (#7932)
refs #7432

🚨  database: change hard limits and field types

- we went over all schema fields and decided to decrease/increase the hard limits
- the core goal is to have more flexibility in the future
- we reconsidered string vs. text

There are 5 groups:

- small strings: 50 characters
    - static strings
    - status, visibility, language, role name, permission name, client name etc.
- medium strings: 191 characters
    - all unique fields or fields which can be unique in the future
    - slug, tokens, user name, password, tag name, email
- large strings: 1000-2000 characters
    - these fields need to be very flexible
    - these fields get a soft limit attached (in a different PR)
    - post title, meta title, meta description, urls
- medium text: 64kb characters
    - bio, settings, location, tour
- long text: 1000000000 chars
    - html, amp, mobiledoc, markdown

🙄  sort_order for tests

- sort order was not set for the tests, so it was always 0
- mysql could return a different result

in my case:
- field length 156 returned the following related tags ["bacon", "kitchen"]
- field length 157 returned the following related tags ["kitchen", "kitchen"]

Change client.secret to 191

Tweak field lengths

- Add 24 char limit for ids
- Limited fields are the exact length they need
- Unified 1000 and 2000 char string classes to all be 2000
- Changed descriptions to be either 2000, except user & tag which is text 65535 as these may be used to store HTML later?!
- Updated tests

🛠  Update importer tests

- The old 001-003 tests are kind of less relevant now.
- Rather than worrying about past versions of the data structure, we should check that the importer only imports what we consider to be valid data
- I've changed the tests to treat the title-length check as a length-validation check, rather than a test for each of the old versions

🔥 Remove foreign key from subscribers.post_id

- There's no real need to have an index on this column, it just makes deleting posts hard.
- Same as created_by type columns, we can reference ids without needing keys/indexes
2017-02-17 23:20:59 +01:00
..
api 🎨 change how we get and set config 2016-09-20 15:59:34 +01:00
auth 🎨 add urlFor('admin') and increase usage of urlFor helper (#7935) 2017-02-02 18:51:35 +00:00
config 🔥 remove imageRelPath (#7927) 2017-02-03 14:42:05 +00:00
controllers/frontend 🔥 do not store settings in config (#7924) 2017-02-03 13:15:11 +00:00
mail 🔥 do not store settings in config (#7924) 2017-02-03 13:15:11 +00:00
metadata 🔥 do not store settings in config (#7924) 2017-02-03 13:15:11 +00:00
middleware 🎹 re-work url redirects (#7956) 2017-02-10 11:42:18 +00:00
models/base improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
models_plugins change default order of posts (#7096) 2016-07-15 11:04:10 +01:00
scheduling Error creation (#7477) 2016-10-06 13:27:35 +01:00
server_helpers 🔥 do not store settings in config (#7924) 2017-02-03 13:15:11 +00:00
sitemap 🎨 source out url utils from ConfigManager (#7347) 2016-09-20 15:59:34 +01:00
storage add read method to local file storage 2016-11-09 11:31:56 +01:00
utils 🔥 remove forceAdminSSL and urlSSL, add admin url (#7937) 2017-02-03 18:13:22 +00:00
api_utils_spec.js replace auto increment id's by object id (#7495) 2016-11-17 09:09:11 +00:00
apps_filters_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
apps_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
errors_spec.js 🛠 use Ignition for logging/errors (#7869) 2017-01-23 11:04:01 +00:00
exporter_spec.js 🔥 remove database version (#7894) 2017-01-26 12:12:00 +00:00
filters_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
ghost_url_spec.js 🔥 remove forceAdminSSL and urlSSL, add admin url (#7937) 2017-02-03 18:13:22 +00:00
importer_spec.js feature: upload validation middleware (#7208) 2016-08-18 20:25:51 +01:00
migration_fixture_utils_spec.js 🔥 😎 remove old migrations (#7887) 2017-01-25 13:47:49 +00:00
migration_spec.js 🚨 database: change hard limits and field types (#7932) 2017-02-17 23:20:59 +01:00
permissions_spec.js 🎨 configurable logging with bunyan (#7431) 2016-10-04 16:33:43 +01:00
rss_spec.js 🔥 do not store settings in config (#7924) 2017-02-03 13:15:11 +00:00
server_helpers_index_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
server_helpers_template_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
server_utils_spec.js 🎨 😎 config env usages (#7929) 2017-02-03 18:25:39 +00:00
showdown_client_integrated_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
slack_spec.js 🔥 remove forceAdminSSL and urlSSL, add admin url (#7937) 2017-02-03 18:13:22 +00:00
social-urls_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
utils_pipeline_spec.js Update mocha to version 3.0.2 🚀 (#7165) 2016-08-11 08:51:19 +01:00
validation_spec.js 🔑 Update Validator to 6.2.1 (#7823) 2017-01-10 13:05:25 +01:00
xmlrpc_spec.js 🎨 😎 config env usages (#7929) 2017-02-03 18:25:39 +00:00