Ghost/core/test/utils/fixtures
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
..
app Cleanup indentation now JSCS can see it 2016-06-11 20:25:15 +01:00
config 🎨 config optimisations (#7921) 2017-02-02 12:46:30 +00:00
csv 🎨 Use GhostAuth name and example emails (#7475) 2016-10-03 15:11:43 +01:00
data feature: define redirects in a custom file (#7719) (#7945) 2017-02-06 15:32:40 +01:00
export 🔥 remove database version (#7894) 2017-01-26 12:12:00 +00:00
filter-param replace auto increment id's by object id (#7495) 2016-11-17 09:09:11 +00:00
images Favicon URI (#7700) 2017-01-26 18:01:19 +00:00
import Add markdown file handler to importer 2015-01-09 20:04:56 +00:00
theme/partials Move API tests to /integration/ 2013-11-07 14:26:47 +01:00
themes feature: define redirects in a custom file (#7719) (#7945) 2017-02-06 15:32:40 +01:00
data-generator.js 🚨 database: change hard limits and field types (#7932) 2017-02-17 23:20:59 +01:00
example.js Add jscs task to grunt file and clean up files to adhere to jscs rules. 2014-09-17 21:44:29 -04:00
test.hbs Move API tests to /integration/ 2013-11-07 14:26:47 +01:00