2018-11-19 13:29:31 +03:00
|
|
|
/* String Column Sizes Information
|
|
|
|
* (From: https://github.com/TryGhost/Ghost/pull/7932)
|
|
|
|
*
|
|
|
|
* Small strings = length 50
|
|
|
|
* Medium strings = length 191
|
|
|
|
* Large strings = length 1000-2000
|
|
|
|
* Text = length 65535 (64 KiB)
|
|
|
|
* Long text = length 1,000,000,000
|
|
|
|
*/
|
2016-01-25 20:50:04 +03:00
|
|
|
module.exports = {
|
|
|
|
posts: {
|
🚨 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-18 01:20:59 +03:00
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
2016-01-25 20:50:04 +03:00
|
|
|
uuid: {type: 'string', maxlength: 36, nullable: false, validations: {isUUID: true}},
|
Added more database soft limits (#9225)
refs #8143
Sets soft limits for certain db fields:
- `posts`:
- `title`: 255 chars (current hard limit: 2,000 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- `users`:
- `bio`: 200 chars (current hard limit: 65,535 chars)
- `location`: 150 chars (current hard limit: 65,535 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `tags`:
- `description`: 500 chars (current hard limit: 65,535 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- same error message for isLength validator as for hard limits (more improvements are comming with https://github.com/TryGhost/Ghost/issues/6050)
- added more tests for importer
- added dynamic translation key handling for validators errors (isLength is only supported atm)
2017-11-09 17:22:20 +03:00
|
|
|
title: {type: 'string', maxlength: 2000, nullable: false, validations: {isLength: {max: 255}}},
|
🚨 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-18 01:20:59 +03:00
|
|
|
slug: {type: 'string', maxlength: 191, nullable: false, unique: true},
|
2016-03-26 17:07:59 +03:00
|
|
|
mobiledoc: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
|
🚨 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-18 01:20:59 +03:00
|
|
|
html: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
|
2018-07-19 12:35:55 +03:00
|
|
|
comment_id: {type: 'string', maxlength: 50, nullable: true},
|
2017-04-05 22:28:13 +03:00
|
|
|
plaintext: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
|
2017-04-24 20:21:47 +03:00
|
|
|
feature_image: {type: 'string', maxlength: 2000, nullable: true},
|
2016-03-27 13:19:32 +03:00
|
|
|
featured: {type: 'bool', nullable: false, defaultTo: false},
|
2019-09-16 13:51:54 +03:00
|
|
|
type: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'post', validations: {isIn: [['post', 'page']]}},
|
🚨 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-18 01:20:59 +03:00
|
|
|
status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'draft'},
|
2017-05-31 18:05:49 +03:00
|
|
|
locale: {type: 'string', maxlength: 6, nullable: true},
|
2018-03-27 17:16:15 +03:00
|
|
|
visibility: {
|
|
|
|
type: 'string',
|
|
|
|
maxlength: 50,
|
|
|
|
nullable: false,
|
|
|
|
defaultTo: 'public',
|
2019-09-26 16:38:35 +03:00
|
|
|
validations: {isIn: [['public', 'members', 'paid']]}
|
2018-03-27 17:16:15 +03:00
|
|
|
},
|
2020-11-03 16:58:23 +03:00
|
|
|
email_recipient_filter: {
|
|
|
|
type: 'string',
|
|
|
|
maxlength: 50,
|
|
|
|
nullable: false,
|
|
|
|
defaultTo: 'none',
|
|
|
|
validations: {isIn: [['none', 'all', 'free', 'paid']]}
|
|
|
|
},
|
2018-03-27 17:16:15 +03:00
|
|
|
/**
|
2018-08-03 16:14:38 +03:00
|
|
|
* @deprecated: `author_id`, might be removed in Ghost 3.0
|
2018-03-27 17:16:15 +03:00
|
|
|
* If we keep it, then only, because you can easier query post.author_id than posts_authors[*].sort_order.
|
|
|
|
*/
|
🚨 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-18 01:20:59 +03:00
|
|
|
author_id: {type: 'string', maxlength: 24, nullable: false},
|
2016-01-25 20:50:04 +03:00
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
2019-01-03 19:14:52 +03:00
|
|
|
/**
|
|
|
|
* @deprecated: https://github.com/TryGhost/Ghost/issues/10286
|
|
|
|
*
|
|
|
|
* This is valid for all x_by fields.
|
|
|
|
*/
|
🚨 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-18 01:20:59 +03:00
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
2016-01-25 20:50:04 +03:00
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
🚨 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-18 01:20:59 +03:00
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true},
|
2016-01-25 20:50:04 +03:00
|
|
|
published_at: {type: 'dateTime', nullable: true},
|
2017-08-01 11:39:34 +03:00
|
|
|
published_by: {type: 'string', maxlength: 24, nullable: true},
|
2017-08-02 12:38:19 +03:00
|
|
|
custom_excerpt: {type: 'string', maxlength: 2000, nullable: true, validations: {isLength: {max: 300}}},
|
|
|
|
codeinjection_head: {type: 'text', maxlength: 65535, nullable: true},
|
2017-08-03 14:48:39 +03:00
|
|
|
codeinjection_foot: {type: 'text', maxlength: 65535, nullable: true},
|
2019-09-16 11:45:55 +03:00
|
|
|
custom_template: {type: 'string', maxlength: 100, nullable: true},
|
|
|
|
canonical_url: {type: 'text', maxlength: 2000, nullable: true}
|
|
|
|
},
|
|
|
|
posts_meta: {
|
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
post_id: {type: 'string', maxlength: 24, nullable: false, references: 'posts.id', unique: true},
|
2017-08-03 14:48:39 +03:00
|
|
|
og_image: {type: 'string', maxlength: 2000, nullable: true},
|
|
|
|
og_title: {type: 'string', maxlength: 300, nullable: true},
|
|
|
|
og_description: {type: 'string', maxlength: 500, nullable: true},
|
|
|
|
twitter_image: {type: 'string', maxlength: 2000, nullable: true},
|
|
|
|
twitter_title: {type: 'string', maxlength: 300, nullable: true},
|
2017-10-10 15:36:35 +03:00
|
|
|
twitter_description: {type: 'string', maxlength: 500, nullable: true},
|
2019-09-16 11:45:55 +03:00
|
|
|
meta_title: {type: 'string', maxlength: 2000, nullable: true, validations: {isLength: {max: 300}}},
|
2019-11-04 09:15:23 +03:00
|
|
|
meta_description: {type: 'string', maxlength: 2000, nullable: true, validations: {isLength: {max: 500}}},
|
|
|
|
email_subject: {type: 'string', maxlength: 300, nullable: true}
|
2016-01-25 20:50:04 +03:00
|
|
|
},
|
|
|
|
users: {
|
🚨 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-18 01:20:59 +03:00
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
name: {type: 'string', maxlength: 191, nullable: false},
|
|
|
|
slug: {type: 'string', maxlength: 191, nullable: false, unique: true},
|
2016-01-25 20:50:04 +03:00
|
|
|
password: {type: 'string', maxlength: 60, nullable: false},
|
2016-09-20 17:52:43 +03:00
|
|
|
email: {type: 'string', maxlength: 191, nullable: false, unique: true, validations: {isEmail: true}},
|
2017-04-24 20:21:47 +03:00
|
|
|
profile_image: {type: 'string', maxlength: 2000, nullable: true},
|
|
|
|
cover_image: {type: 'string', maxlength: 2000, nullable: true},
|
Added more database soft limits (#9225)
refs #8143
Sets soft limits for certain db fields:
- `posts`:
- `title`: 255 chars (current hard limit: 2,000 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- `users`:
- `bio`: 200 chars (current hard limit: 65,535 chars)
- `location`: 150 chars (current hard limit: 65,535 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `tags`:
- `description`: 500 chars (current hard limit: 65,535 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- same error message for isLength validator as for hard limits (more improvements are comming with https://github.com/TryGhost/Ghost/issues/6050)
- added more tests for importer
- added dynamic translation key handling for validators errors (isLength is only supported atm)
2017-11-09 17:22:20 +03:00
|
|
|
bio: {type: 'text', maxlength: 65535, nullable: true, validations: {isLength: {max: 200}}},
|
🚨 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-18 01:20:59 +03:00
|
|
|
website: {type: 'string', maxlength: 2000, nullable: true, validations: {isEmptyOrURL: true}},
|
Added more database soft limits (#9225)
refs #8143
Sets soft limits for certain db fields:
- `posts`:
- `title`: 255 chars (current hard limit: 2,000 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- `users`:
- `bio`: 200 chars (current hard limit: 65,535 chars)
- `location`: 150 chars (current hard limit: 65,535 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `tags`:
- `description`: 500 chars (current hard limit: 65,535 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- same error message for isLength validator as for hard limits (more improvements are comming with https://github.com/TryGhost/Ghost/issues/6050)
- added more tests for importer
- added dynamic translation key handling for validators errors (isLength is only supported atm)
2017-11-09 17:22:20 +03:00
|
|
|
location: {type: 'text', maxlength: 65535, nullable: true, validations: {isLength: {max: 150}}},
|
🚨 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-18 01:20:59 +03:00
|
|
|
facebook: {type: 'string', maxlength: 2000, nullable: true},
|
|
|
|
twitter: {type: 'string', maxlength: 2000, nullable: true},
|
2016-01-25 20:50:04 +03:00
|
|
|
accessibility: {type: 'text', maxlength: 65535, nullable: true},
|
🚨 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-18 01:20:59 +03:00
|
|
|
status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'active'},
|
2017-05-31 18:05:49 +03:00
|
|
|
locale: {type: 'string', maxlength: 6, nullable: true},
|
2018-03-27 17:16:15 +03:00
|
|
|
visibility: {
|
|
|
|
type: 'string',
|
|
|
|
maxlength: 50,
|
|
|
|
nullable: false,
|
|
|
|
defaultTo: 'public',
|
|
|
|
validations: {isIn: [['public']]}
|
|
|
|
},
|
Added more database soft limits (#9225)
refs #8143
Sets soft limits for certain db fields:
- `posts`:
- `title`: 255 chars (current hard limit: 2,000 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- `users`:
- `bio`: 200 chars (current hard limit: 65,535 chars)
- `location`: 150 chars (current hard limit: 65,535 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `tags`:
- `description`: 500 chars (current hard limit: 65,535 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- same error message for isLength validator as for hard limits (more improvements are comming with https://github.com/TryGhost/Ghost/issues/6050)
- added more tests for importer
- added dynamic translation key handling for validators errors (isLength is only supported atm)
2017-11-09 17:22:20 +03:00
|
|
|
meta_title: {type: 'string', maxlength: 2000, nullable: true, validations: {isLength: {max: 300}}},
|
|
|
|
meta_description: {type: 'string', maxlength: 2000, nullable: true, validations: {isLength: {max: 500}}},
|
2016-01-25 20:50:04 +03:00
|
|
|
tour: {type: 'text', maxlength: 65535, nullable: true},
|
2017-04-05 22:45:55 +03:00
|
|
|
last_seen: {type: 'dateTime', nullable: true},
|
2016-01-25 20:50:04 +03:00
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
🚨 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-18 01:20:59 +03:00
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
2016-01-25 20:50:04 +03:00
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
🚨 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-18 01:20:59 +03:00
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true}
|
2016-01-25 20:50:04 +03:00
|
|
|
},
|
2018-03-27 17:16:15 +03:00
|
|
|
posts_authors: {
|
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
post_id: {type: 'string', maxlength: 24, nullable: false, references: 'posts.id'},
|
|
|
|
author_id: {type: 'string', maxlength: 24, nullable: false, references: 'users.id'},
|
|
|
|
sort_order: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0}
|
|
|
|
},
|
2016-01-25 20:50:04 +03:00
|
|
|
roles: {
|
🚨 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-18 01:20:59 +03:00
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
name: {type: 'string', maxlength: 50, nullable: false, unique: true},
|
|
|
|
description: {type: 'string', maxlength: 2000, nullable: true},
|
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true}
|
2016-01-25 20:50:04 +03:00
|
|
|
},
|
|
|
|
roles_users: {
|
🚨 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-18 01:20:59 +03:00
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
role_id: {type: 'string', maxlength: 24, nullable: false},
|
|
|
|
user_id: {type: 'string', maxlength: 24, nullable: false}
|
2016-01-25 20:50:04 +03:00
|
|
|
},
|
|
|
|
permissions: {
|
🚨 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-18 01:20:59 +03:00
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
name: {type: 'string', maxlength: 50, nullable: false, unique: true},
|
|
|
|
object_type: {type: 'string', maxlength: 50, nullable: false},
|
|
|
|
action_type: {type: 'string', maxlength: 50, nullable: false},
|
|
|
|
object_id: {type: 'string', maxlength: 24, nullable: true},
|
2016-01-25 20:50:04 +03:00
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
🚨 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-18 01:20:59 +03:00
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
2016-01-25 20:50:04 +03:00
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
🚨 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-18 01:20:59 +03:00
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true}
|
2016-01-25 20:50:04 +03:00
|
|
|
},
|
|
|
|
permissions_users: {
|
🚨 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-18 01:20:59 +03:00
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
user_id: {type: 'string', maxlength: 24, nullable: false},
|
|
|
|
permission_id: {type: 'string', maxlength: 24, nullable: false}
|
2016-01-25 20:50:04 +03:00
|
|
|
},
|
|
|
|
permissions_roles: {
|
🚨 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-18 01:20:59 +03:00
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
role_id: {type: 'string', maxlength: 24, nullable: false},
|
|
|
|
permission_id: {type: 'string', maxlength: 24, nullable: false}
|
2016-01-25 20:50:04 +03:00
|
|
|
},
|
|
|
|
permissions_apps: {
|
🚨 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-18 01:20:59 +03:00
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
app_id: {type: 'string', maxlength: 24, nullable: false},
|
|
|
|
permission_id: {type: 'string', maxlength: 24, nullable: false}
|
2016-01-25 20:50:04 +03:00
|
|
|
},
|
|
|
|
settings: {
|
🚨 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-18 01:20:59 +03:00
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
2020-06-24 13:58:15 +03:00
|
|
|
group: {
|
|
|
|
type: 'string',
|
|
|
|
maxlength: 50,
|
|
|
|
nullable: false,
|
|
|
|
defaultTo: 'core',
|
|
|
|
validations: {
|
|
|
|
isIn: [[
|
|
|
|
'amp',
|
|
|
|
'core',
|
|
|
|
'email',
|
|
|
|
'labs',
|
|
|
|
'members',
|
|
|
|
'portal',
|
|
|
|
'private',
|
|
|
|
'site',
|
|
|
|
'slack',
|
|
|
|
'theme',
|
|
|
|
'unsplash',
|
|
|
|
'views'
|
|
|
|
]]
|
|
|
|
}
|
|
|
|
},
|
🚨 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-18 01:20:59 +03:00
|
|
|
key: {type: 'string', maxlength: 50, nullable: false, unique: true},
|
2016-01-25 20:50:04 +03:00
|
|
|
value: {type: 'text', maxlength: 65535, nullable: true},
|
2018-03-27 17:16:15 +03:00
|
|
|
type: {
|
|
|
|
type: 'string',
|
|
|
|
maxlength: 50,
|
|
|
|
nullable: false,
|
2020-06-24 14:38:18 +03:00
|
|
|
validations: {
|
|
|
|
isIn: [[
|
2020-06-30 15:02:43 +03:00
|
|
|
'array',
|
|
|
|
'string',
|
|
|
|
'number',
|
|
|
|
'boolean',
|
|
|
|
// TODO: `object` type needs to be removed once all existing object settings are removed
|
|
|
|
'object'
|
2020-06-24 14:38:18 +03:00
|
|
|
]]
|
|
|
|
}
|
2018-03-27 17:16:15 +03:00
|
|
|
},
|
2020-06-24 13:58:15 +03:00
|
|
|
flags: {type: 'string', maxlength: 50, nullable: true},
|
2016-01-25 20:50:04 +03:00
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
🚨 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-18 01:20:59 +03:00
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
2016-01-25 20:50:04 +03:00
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
🚨 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-18 01:20:59 +03:00
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true}
|
2016-01-25 20:50:04 +03:00
|
|
|
},
|
|
|
|
tags: {
|
🚨 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-18 01:20:59 +03:00
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
name: {type: 'string', maxlength: 191, nullable: false, validations: {matches: /^([^,]|$)/}},
|
|
|
|
slug: {type: 'string', maxlength: 191, nullable: false, unique: true},
|
Added more database soft limits (#9225)
refs #8143
Sets soft limits for certain db fields:
- `posts`:
- `title`: 255 chars (current hard limit: 2,000 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- `users`:
- `bio`: 200 chars (current hard limit: 65,535 chars)
- `location`: 150 chars (current hard limit: 65,535 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `tags`:
- `description`: 500 chars (current hard limit: 65,535 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- same error message for isLength validator as for hard limits (more improvements are comming with https://github.com/TryGhost/Ghost/issues/6050)
- added more tests for importer
- added dynamic translation key handling for validators errors (isLength is only supported atm)
2017-11-09 17:22:20 +03:00
|
|
|
description: {type: 'text', maxlength: 65535, nullable: true, validations: {isLength: {max: 500}}},
|
2017-04-24 20:21:47 +03:00
|
|
|
feature_image: {type: 'string', maxlength: 2000, nullable: true},
|
✨ replace auto increment id's by object id (#7495)
* 🛠 bookshelf tarball, bson-objectid
* 🎨 schema changes
- change increment type to string
- add a default fallback for string length 191 (to avoid adding this logic to every single column which uses an ID)
- remove uuid, because ID now represents a global resource identifier
- keep uuid for post, because we are using this as preview id
- keep uuid for clients for now - we are using this param for Ghost-Auth
* ✨ base model: generate ObjectId on creating event
- each new resource get's a auto generate ObjectId
- this logic won't work for attached models, this commit comes later
* 🎨 centralised attach method
When attaching models there are two things important two know
1. To be able to attach an ObjectId, we need to register the `onCreating` event the fetched model!This is caused by the Bookshelf design in general. On this target model we are attaching the new model.
2. We need to manually fetch the target model, because Bookshelf has a weird behaviour (which is known as a bug, see see https://github.com/tgriesser/bookshelf/issues/629). The most important property when attaching a model is `parentFk`, which is the foreign key. This can be null when fetching the model with the option `withRelated`. To ensure quality and consistency, the custom attach wrapper always fetches the target model manual. By fetching the target model (again) is a little performance decrease, but it also has advantages: we can register the event, and directly unregister the event again. So very clean code.
Important: please only use the custom attach wrapper in the future.
* 🎨 token model had overriden the onCreating function because of the created_at field
- we need to ensure that the base onCreating hook get's triggered for ALL models
- if not, they don't get an ObjectId assigned
- in this case: be smart and check if the target model has a created_at field
* 🎨 we don't have a uuid field anymore, remove the usages
- no default uuid creation in models
- i am pretty sure we have some more definitions in our tests (for example in the export json files), but that is too much work to delete them all
* 🎨 do not parse ID to Number
- we had various occurances of parsing all ID's to numbers
- we don't need this behaviour anymore
- ID is string
- i will adapt the ID validation in the next commit
* 🎨 change ID regex for validation
- we only allow: ID as ObjectId, ID as 1 and ID as me
- we need to keep ID 1, because our whole software relies on ID 1 (permissions etc)
* 🎨 owner fixture
- roles: [4] does not work anymore
- 4 means -> static id 4
- this worked in an auto increment system (not even in a system with distributed writes)
- with ObjectId we generate each ID automatically (for static and dynamic resources)
- it is possible to define all id's for static resources still, but that means we need to know which ID is already used and for consistency we have to define ObjectId's for these static resources
- so no static id's anymore, except of: id 1 for owner and id 0 for external usage (because this is required from our permission system)
- NOTE: please read through the comment in the user model
* 🎨 tests: DataGenerator and test utils
First of all: we need to ensure using ObjectId's in the tests. When don't, we can't ensure that ObjectId's work properly.
This commit brings lot's of dynamic into all the static defined id's.
In one of the next commits, i will adapt all the tests.
* 🚨 remove counter in Notification API
- no need to add a counter
- we simply generate ObjectId's (they are auto incremental as well)
- our id validator does only allow ObjectId as id,1 and me
* 🎨 extend contextUser in Base Model
- remove isNumber check, because id's are no longer numbers, except of id 0/1
- use existing isExternalUser
- support id 0/1 as string or number
* ✨ Ghost Owner has id 1
- ensure we define this id in the fixtures.json
- doesn't matter if number or string
* 🎨 functional tests adaptions
- use dynamic id's
* 🎨 fix unit tests
* 🎨 integration tests adaptions
* 🎨 change importer utils
- all our export examples (test/fixtures/exports) contain id's as numbers
- fact: but we ignore them anyway when inserting into the database, see https://github.com/TryGhost/Ghost/blob/master/core/server/data/import/utils.js#L249
- in https://github.com/TryGhost/Ghost/pull/7495/commits/0e6ed957cd54dc02a25cf6fb1ab7d7e723295e2c#diff-70f514a06347c048648be464819503c4L67 i removed parsing id's to integers
- i realised that this ^ check just existed, because the userIdToMap was an object key and object keys are always strings!
- i think this logic is a little bit complicated, but i don't want to refactor this now
- this commit ensures when trying to find the user, the id comparison works again
- i've added more documentation to understand this logic ;)
- plus i renamed an attribute to improve readability
* 🎨 Data-Generator: add more defaults to createUser
- if i use the function DataGenerator.forKnex.createUser i would like to get a full set of defaults
* 🎨 test utils: change/extend function set for functional tests
- functional tests work a bit different
- they boot Ghost and seed the database
- some functional tests have mis-used the test setup
- the test setup needs two sections: integration/unit and functional tests
- any functional test is allowed to either add more data or change data in the existing Ghost db
- but what it should not do is: add test fixtures like roles or users from our DataGenerator and cross fingers it will work
- this commit adds a clean method for functional tests to add extra users
* 🎨 functional tests adaptions
- use last commit to insert users for functional tests clean
- tidy up usage of testUtils.setup or testUtils.doAuth
* 🐛 test utils: reset database before init
- ensure we don't have any left data from other tests in the database when starting ghost
* 🐛 fix test (unrelated to this PR)
- fixes a random failure
- return statement was missing
* 🎨 make changes for invites
2016-11-17 12:09:11 +03:00
|
|
|
parent_id: {type: 'string', nullable: true},
|
2018-03-27 17:16:15 +03:00
|
|
|
visibility: {
|
|
|
|
type: 'string',
|
|
|
|
maxlength: 50,
|
|
|
|
nullable: false,
|
|
|
|
defaultTo: 'public',
|
|
|
|
validations: {isIn: [['public', 'internal']]}
|
|
|
|
},
|
2020-07-06 13:12:30 +03:00
|
|
|
og_image: {type: 'string', maxlength: 2000, nullable: true},
|
|
|
|
og_title: {type: 'string', maxlength: 300, nullable: true},
|
|
|
|
og_description: {type: 'string', maxlength: 500, nullable: true},
|
|
|
|
twitter_image: {type: 'string', maxlength: 2000, nullable: true},
|
|
|
|
twitter_title: {type: 'string', maxlength: 300, nullable: true},
|
|
|
|
twitter_description: {type: 'string', maxlength: 500, nullable: true},
|
Added more database soft limits (#9225)
refs #8143
Sets soft limits for certain db fields:
- `posts`:
- `title`: 255 chars (current hard limit: 2,000 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- `users`:
- `bio`: 200 chars (current hard limit: 65,535 chars)
- `location`: 150 chars (current hard limit: 65,535 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `tags`:
- `description`: 500 chars (current hard limit: 65,535 chars)
- `meta_title`: 300 chars (current hard limit: 2,000 chars)
- `meta_description`: 500 chars (current hard limit: 2,000 chars)
- same error message for isLength validator as for hard limits (more improvements are comming with https://github.com/TryGhost/Ghost/issues/6050)
- added more tests for importer
- added dynamic translation key handling for validators errors (isLength is only supported atm)
2017-11-09 17:22:20 +03:00
|
|
|
meta_title: {type: 'string', maxlength: 2000, nullable: true, validations: {isLength: {max: 300}}},
|
|
|
|
meta_description: {type: 'string', maxlength: 2000, nullable: true, validations: {isLength: {max: 500}}},
|
2020-07-06 13:12:30 +03:00
|
|
|
codeinjection_head: {type: 'text', maxlength: 65535, nullable: true},
|
|
|
|
codeinjection_foot: {type: 'text', maxlength: 65535, nullable: true},
|
|
|
|
canonical_url: {type: 'string', maxlength: 2000, nullable: true},
|
|
|
|
accent_color: {type: 'string', maxlength: 50, nullable: true},
|
2016-01-25 20:50:04 +03:00
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
🚨 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-18 01:20:59 +03:00
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
2016-01-25 20:50:04 +03:00
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
🚨 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-18 01:20:59 +03:00
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true}
|
2016-01-25 20:50:04 +03:00
|
|
|
},
|
|
|
|
posts_tags: {
|
🚨 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-18 01:20:59 +03:00
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
post_id: {type: 'string', maxlength: 24, nullable: false, references: 'posts.id'},
|
|
|
|
tag_id: {type: 'string', maxlength: 24, nullable: false, references: 'tags.id'},
|
✨ replace auto increment id's by object id (#7495)
* 🛠 bookshelf tarball, bson-objectid
* 🎨 schema changes
- change increment type to string
- add a default fallback for string length 191 (to avoid adding this logic to every single column which uses an ID)
- remove uuid, because ID now represents a global resource identifier
- keep uuid for post, because we are using this as preview id
- keep uuid for clients for now - we are using this param for Ghost-Auth
* ✨ base model: generate ObjectId on creating event
- each new resource get's a auto generate ObjectId
- this logic won't work for attached models, this commit comes later
* 🎨 centralised attach method
When attaching models there are two things important two know
1. To be able to attach an ObjectId, we need to register the `onCreating` event the fetched model!This is caused by the Bookshelf design in general. On this target model we are attaching the new model.
2. We need to manually fetch the target model, because Bookshelf has a weird behaviour (which is known as a bug, see see https://github.com/tgriesser/bookshelf/issues/629). The most important property when attaching a model is `parentFk`, which is the foreign key. This can be null when fetching the model with the option `withRelated`. To ensure quality and consistency, the custom attach wrapper always fetches the target model manual. By fetching the target model (again) is a little performance decrease, but it also has advantages: we can register the event, and directly unregister the event again. So very clean code.
Important: please only use the custom attach wrapper in the future.
* 🎨 token model had overriden the onCreating function because of the created_at field
- we need to ensure that the base onCreating hook get's triggered for ALL models
- if not, they don't get an ObjectId assigned
- in this case: be smart and check if the target model has a created_at field
* 🎨 we don't have a uuid field anymore, remove the usages
- no default uuid creation in models
- i am pretty sure we have some more definitions in our tests (for example in the export json files), but that is too much work to delete them all
* 🎨 do not parse ID to Number
- we had various occurances of parsing all ID's to numbers
- we don't need this behaviour anymore
- ID is string
- i will adapt the ID validation in the next commit
* 🎨 change ID regex for validation
- we only allow: ID as ObjectId, ID as 1 and ID as me
- we need to keep ID 1, because our whole software relies on ID 1 (permissions etc)
* 🎨 owner fixture
- roles: [4] does not work anymore
- 4 means -> static id 4
- this worked in an auto increment system (not even in a system with distributed writes)
- with ObjectId we generate each ID automatically (for static and dynamic resources)
- it is possible to define all id's for static resources still, but that means we need to know which ID is already used and for consistency we have to define ObjectId's for these static resources
- so no static id's anymore, except of: id 1 for owner and id 0 for external usage (because this is required from our permission system)
- NOTE: please read through the comment in the user model
* 🎨 tests: DataGenerator and test utils
First of all: we need to ensure using ObjectId's in the tests. When don't, we can't ensure that ObjectId's work properly.
This commit brings lot's of dynamic into all the static defined id's.
In one of the next commits, i will adapt all the tests.
* 🚨 remove counter in Notification API
- no need to add a counter
- we simply generate ObjectId's (they are auto incremental as well)
- our id validator does only allow ObjectId as id,1 and me
* 🎨 extend contextUser in Base Model
- remove isNumber check, because id's are no longer numbers, except of id 0/1
- use existing isExternalUser
- support id 0/1 as string or number
* ✨ Ghost Owner has id 1
- ensure we define this id in the fixtures.json
- doesn't matter if number or string
* 🎨 functional tests adaptions
- use dynamic id's
* 🎨 fix unit tests
* 🎨 integration tests adaptions
* 🎨 change importer utils
- all our export examples (test/fixtures/exports) contain id's as numbers
- fact: but we ignore them anyway when inserting into the database, see https://github.com/TryGhost/Ghost/blob/master/core/server/data/import/utils.js#L249
- in https://github.com/TryGhost/Ghost/pull/7495/commits/0e6ed957cd54dc02a25cf6fb1ab7d7e723295e2c#diff-70f514a06347c048648be464819503c4L67 i removed parsing id's to integers
- i realised that this ^ check just existed, because the userIdToMap was an object key and object keys are always strings!
- i think this logic is a little bit complicated, but i don't want to refactor this now
- this commit ensures when trying to find the user, the id comparison works again
- i've added more documentation to understand this logic ;)
- plus i renamed an attribute to improve readability
* 🎨 Data-Generator: add more defaults to createUser
- if i use the function DataGenerator.forKnex.createUser i would like to get a full set of defaults
* 🎨 test utils: change/extend function set for functional tests
- functional tests work a bit different
- they boot Ghost and seed the database
- some functional tests have mis-used the test setup
- the test setup needs two sections: integration/unit and functional tests
- any functional test is allowed to either add more data or change data in the existing Ghost db
- but what it should not do is: add test fixtures like roles or users from our DataGenerator and cross fingers it will work
- this commit adds a clean method for functional tests to add extra users
* 🎨 functional tests adaptions
- use last commit to insert users for functional tests clean
- tidy up usage of testUtils.setup or testUtils.doAuth
* 🐛 test utils: reset database before init
- ensure we don't have any left data from other tests in the database when starting ghost
* 🐛 fix test (unrelated to this PR)
- fixes a random failure
- return statement was missing
* 🎨 make changes for invites
2016-11-17 12:09:11 +03:00
|
|
|
sort_order: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0}
|
2016-01-25 20:50:04 +03:00
|
|
|
},
|
|
|
|
apps: {
|
🚨 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-18 01:20:59 +03:00
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
name: {type: 'string', maxlength: 191, nullable: false, unique: true},
|
|
|
|
slug: {type: 'string', maxlength: 191, nullable: false, unique: true},
|
|
|
|
version: {type: 'string', maxlength: 50, nullable: false},
|
|
|
|
status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'inactive'},
|
2016-01-25 20:50:04 +03:00
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
🚨 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-18 01:20:59 +03:00
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
2016-01-25 20:50:04 +03:00
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
🚨 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-18 01:20:59 +03:00
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true}
|
2016-01-25 20:50:04 +03:00
|
|
|
},
|
|
|
|
app_settings: {
|
🚨 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-18 01:20:59 +03:00
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
key: {type: 'string', maxlength: 50, nullable: false, unique: true},
|
2016-01-25 20:50:04 +03:00
|
|
|
value: {type: 'text', maxlength: 65535, nullable: true},
|
🚨 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-18 01:20:59 +03:00
|
|
|
app_id: {type: 'string', maxlength: 24, nullable: false, references: 'apps.id'},
|
2016-01-25 20:50:04 +03:00
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
🚨 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-18 01:20:59 +03:00
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
2016-01-25 20:50:04 +03:00
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
🚨 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-18 01:20:59 +03:00
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true}
|
2016-01-25 20:50:04 +03:00
|
|
|
},
|
|
|
|
app_fields: {
|
🚨 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-18 01:20:59 +03:00
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
key: {type: 'string', maxlength: 50, nullable: false},
|
2016-01-25 20:50:04 +03:00
|
|
|
value: {type: 'text', maxlength: 65535, nullable: true},
|
🚨 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-18 01:20:59 +03:00
|
|
|
type: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'html'},
|
|
|
|
app_id: {type: 'string', maxlength: 24, nullable: false, references: 'apps.id'},
|
|
|
|
relatable_id: {type: 'string', maxlength: 24, nullable: false},
|
|
|
|
relatable_type: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'posts'},
|
2016-03-27 13:19:32 +03:00
|
|
|
active: {type: 'bool', nullable: false, defaultTo: true},
|
2016-01-25 20:50:04 +03:00
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
🚨 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-18 01:20:59 +03:00
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
2016-01-25 20:50:04 +03:00
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
🚨 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-18 01:20:59 +03:00
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true}
|
2016-09-21 17:48:14 +03:00
|
|
|
},
|
|
|
|
invites: {
|
🚨 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-18 01:20:59 +03:00
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
role_id: {type: 'string', maxlength: 24, nullable: false},
|
2018-03-27 17:16:15 +03:00
|
|
|
status: {
|
|
|
|
type: 'string',
|
|
|
|
maxlength: 50,
|
|
|
|
nullable: false,
|
|
|
|
defaultTo: 'pending',
|
|
|
|
validations: {isIn: [['pending', 'sent']]}
|
|
|
|
},
|
2016-09-21 17:48:14 +03:00
|
|
|
token: {type: 'string', maxlength: 191, nullable: false, unique: true},
|
|
|
|
email: {type: 'string', maxlength: 191, nullable: false, unique: true, validations: {isEmail: true}},
|
|
|
|
expires: {type: 'bigInteger', nullable: false},
|
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
🚨 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-18 01:20:59 +03:00
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
2016-09-21 17:48:14 +03:00
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
🚨 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-18 01:20:59 +03:00
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true}
|
2016-09-21 17:48:14 +03:00
|
|
|
},
|
2016-11-08 14:33:19 +03:00
|
|
|
brute: {
|
🚨 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-18 01:20:59 +03:00
|
|
|
key: {type: 'string', maxlength: 191},
|
2016-11-10 13:50:23 +03:00
|
|
|
firstRequest: {type: 'bigInteger'},
|
|
|
|
lastRequest: {type: 'bigInteger'},
|
2016-11-08 14:33:19 +03:00
|
|
|
lifetime: {type: 'bigInteger'},
|
|
|
|
count: {type: 'integer'}
|
2017-11-21 18:43:14 +03:00
|
|
|
},
|
|
|
|
webhooks: {
|
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
event: {type: 'string', maxlength: 50, nullable: false, validations: {isLowercase: true}},
|
|
|
|
target_url: {type: 'string', maxlength: 2000, nullable: false},
|
2018-10-17 14:17:13 +03:00
|
|
|
name: {type: 'string', maxlength: 191, nullable: true},
|
|
|
|
secret: {type: 'string', maxlength: 191, nullable: true},
|
|
|
|
api_version: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'v2'},
|
|
|
|
integration_id: {type: 'string', maxlength: 24, nullable: true},
|
|
|
|
status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'available'},
|
|
|
|
last_triggered_at: {type: 'dateTime', nullable: true},
|
|
|
|
last_triggered_status: {type: 'string', maxlength: 50, nullable: true},
|
|
|
|
last_triggered_error: {type: 'string', maxlength: 50, nullable: true},
|
2017-11-21 18:43:14 +03:00
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true}
|
2018-09-27 10:51:46 +03:00
|
|
|
},
|
|
|
|
sessions: {
|
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
session_id: {type: 'string', maxlength: 32, nullable: false, unique: true},
|
|
|
|
user_id: {type: 'string', maxlength: 24, nullable: false},
|
|
|
|
session_data: {type: 'string', maxlength: 2000, nullable: false},
|
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
|
|
|
updated_at: {type: 'dateTime', nullable: true}
|
2018-10-02 19:46:38 +03:00
|
|
|
},
|
|
|
|
integrations: {
|
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
2019-02-15 17:48:21 +03:00
|
|
|
type: {
|
|
|
|
type: 'string',
|
|
|
|
maxlength: 50,
|
|
|
|
nullable: false,
|
|
|
|
defaultTo: 'custom',
|
|
|
|
validations: {isIn: [['internal', 'builtin', 'custom']]}
|
|
|
|
},
|
2018-10-02 19:46:38 +03:00
|
|
|
name: {type: 'string', maxlength: 191, nullable: false},
|
|
|
|
slug: {type: 'string', maxlength: 191, nullable: false, unique: true},
|
|
|
|
icon_image: {type: 'string', maxlength: 2000, nullable: true},
|
|
|
|
description: {type: 'string', maxlength: 2000, nullable: true},
|
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true}
|
|
|
|
},
|
|
|
|
api_keys: {
|
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
type: {
|
|
|
|
type: 'string',
|
|
|
|
maxlength: 50,
|
|
|
|
nullable: false,
|
|
|
|
validations: {isIn: [['content', 'admin']]}
|
|
|
|
},
|
|
|
|
secret: {
|
|
|
|
type: 'string',
|
|
|
|
maxlength: 191,
|
|
|
|
nullable: false,
|
|
|
|
unique: true,
|
2019-01-04 15:39:54 +03:00
|
|
|
validations: {isLength: {min: 26, max: 128}}
|
2018-10-02 19:46:38 +03:00
|
|
|
},
|
|
|
|
role_id: {type: 'string', maxlength: 24, nullable: true},
|
|
|
|
// integration_id is nullable to allow "internal" API keys that don't show in the UI
|
|
|
|
integration_id: {type: 'string', maxlength: 24, nullable: true},
|
2020-10-23 14:01:14 +03:00
|
|
|
user_id: {type: 'string', maxlength: 24, nullable: true},
|
2018-10-02 19:46:38 +03:00
|
|
|
last_seen_at: {type: 'dateTime', nullable: true},
|
|
|
|
last_seen_version: {type: 'string', maxlength: 50, nullable: true},
|
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true}
|
2018-10-02 19:49:01 +03:00
|
|
|
},
|
|
|
|
mobiledoc_revisions: {
|
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
post_id: {type: 'string', maxlength: 24, nullable: false, index: true},
|
|
|
|
mobiledoc: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
|
|
|
|
created_at_ts: {type: 'bigInteger', nullable: false},
|
|
|
|
created_at: {type: 'dateTime', nullable: false}
|
2018-12-10 12:20:54 +03:00
|
|
|
},
|
|
|
|
members: {
|
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
2019-11-05 13:01:02 +03:00
|
|
|
uuid: {type: 'string', maxlength: 36, nullable: true, unique: true, validations: {isUUID: true}},
|
2018-12-10 12:20:54 +03:00
|
|
|
email: {type: 'string', maxlength: 191, nullable: false, unique: true, validations: {isEmail: true}},
|
2021-01-27 17:06:21 +03:00
|
|
|
status: {
|
|
|
|
type: 'string', maxlength: 50, nullable: false, defaultTo: 'free', validations: {
|
|
|
|
isIn: [['free', 'paid']]
|
|
|
|
}
|
|
|
|
},
|
2019-09-25 11:44:50 +03:00
|
|
|
name: {type: 'string', maxlength: 191, nullable: true},
|
2019-10-10 07:18:09 +03:00
|
|
|
note: {type: 'string', maxlength: 2000, nullable: true},
|
2020-02-19 13:27:55 +03:00
|
|
|
geolocation: {type: 'string', maxlength: 2000, nullable: true},
|
2019-11-05 11:49:40 +03:00
|
|
|
subscribed: {type: 'bool', nullable: true, defaultTo: true},
|
2020-12-09 15:21:56 +03:00
|
|
|
email_count: {type: 'integer', unsigned: true, nullable: false, defaultTo: 0},
|
|
|
|
email_opened_count: {type: 'integer', unsigned: true, nullable: false, defaultTo: 0},
|
2020-12-08 15:20:17 +03:00
|
|
|
email_open_rate: {type: 'integer', unsigned: true, nullable: true, index: true},
|
2018-12-10 12:20:54 +03:00
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
2019-09-19 06:37:33 +03:00
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true}
|
|
|
|
},
|
2020-02-14 12:33:10 +03:00
|
|
|
labels: {
|
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
name: {type: 'string', maxlength: 191, nullable: false, unique: true},
|
|
|
|
slug: {type: 'string', maxlength: 191, nullable: false, unique: true},
|
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true}
|
|
|
|
},
|
|
|
|
members_labels: {
|
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
2020-08-05 14:20:30 +03:00
|
|
|
member_id: {type: 'string', maxlength: 24, nullable: false, references: 'members.id', cascadeDelete: true},
|
|
|
|
label_id: {type: 'string', maxlength: 24, nullable: false, references: 'labels.id', cascadeDelete: true},
|
2020-02-14 12:33:10 +03:00
|
|
|
sort_order: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0}
|
|
|
|
},
|
2019-09-26 08:07:52 +03:00
|
|
|
members_stripe_customers: {
|
2019-09-19 06:37:33 +03:00
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
2020-08-05 14:20:30 +03:00
|
|
|
member_id: {type: 'string', maxlength: 24, nullable: false, unique: false, references: 'members.id', cascadeDelete: true},
|
|
|
|
customer_id: {type: 'string', maxlength: 255, nullable: false, unique: true},
|
2019-10-07 07:54:20 +03:00
|
|
|
name: {type: 'string', maxlength: 191, nullable: true},
|
|
|
|
email: {type: 'string', maxlength: 191, nullable: true},
|
2018-12-10 12:20:54 +03:00
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true}
|
2019-01-29 19:06:11 +03:00
|
|
|
},
|
2019-10-09 08:37:57 +03:00
|
|
|
members_stripe_customers_subscriptions: {
|
2019-10-07 07:54:20 +03:00
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
2020-08-05 14:20:30 +03:00
|
|
|
customer_id: {type: 'string', maxlength: 255, nullable: false, unique: false, references: 'members_stripe_customers.customer_id', cascadeDelete: true},
|
|
|
|
subscription_id: {type: 'string', maxlength: 255, nullable: false, unique: true},
|
2019-10-07 07:54:20 +03:00
|
|
|
plan_id: {type: 'string', maxlength: 255, nullable: false, unique: false},
|
|
|
|
status: {type: 'string', maxlength: 50, nullable: false},
|
2019-12-12 15:59:15 +03:00
|
|
|
cancel_at_period_end: {type: 'bool', nullable: false, defaultTo: false},
|
2020-11-23 18:36:14 +03:00
|
|
|
cancellation_reason: {type: 'string', maxlength: 500, nullable: true},
|
2019-10-07 07:54:20 +03:00
|
|
|
current_period_end: {type: 'dateTime', nullable: false},
|
|
|
|
start_date: {type: 'dateTime', nullable: false},
|
|
|
|
default_payment_card_last4: {type: 'string', maxlength: 4, nullable: true},
|
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true},
|
|
|
|
/* Below fields eventually should be normalised e.g. stripe_plans table, link to here on plan_id */
|
|
|
|
plan_nickname: {type: 'string', maxlength: 50, nullable: false},
|
|
|
|
plan_interval: {type: 'string', maxlength: 50, nullable: false},
|
|
|
|
plan_amount: {type: 'integer', nullable: false},
|
|
|
|
plan_currency: {type: 'string', maxLength: 3, nullable: false}
|
|
|
|
},
|
2019-01-29 19:06:11 +03:00
|
|
|
actions: {
|
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
resource_id: {type: 'string', maxlength: 24, nullable: true},
|
|
|
|
resource_type: {type: 'string', maxlength: 50, nullable: false},
|
|
|
|
actor_id: {type: 'string', maxlength: 24, nullable: false},
|
|
|
|
actor_type: {type: 'string', maxlength: 50, nullable: false},
|
|
|
|
// @NOTE: The event column contains short buzzwords e.g. subscribed, started, added, deleted, edited etc.
|
|
|
|
// We already store and require the target resource type. No need to remember e.g. post.edited
|
|
|
|
event: {type: 'string', maxlength: 50, nullable: false},
|
|
|
|
// @NOTE: The context object can be used to store information about an action e.g. diffs, meta
|
|
|
|
context: {type: 'text', maxlength: 1000000000, nullable: true},
|
|
|
|
created_at: {type: 'dateTime', nullable: false}
|
2019-11-06 07:29:21 +03:00
|
|
|
},
|
|
|
|
emails: {
|
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
2019-11-08 07:40:49 +03:00
|
|
|
post_id: {type: 'string', maxlength: 24, nullable: false, index: true, unique: true},
|
2019-11-06 07:29:21 +03:00
|
|
|
uuid: {type: 'string', maxlength: 36, nullable: false, validations: {isUUID: true}},
|
|
|
|
status: {
|
|
|
|
type: 'string',
|
|
|
|
maxlength: 50,
|
|
|
|
nullable: false,
|
2019-11-07 11:27:49 +03:00
|
|
|
defaultTo: 'pending',
|
|
|
|
validations: {isIn: [['pending', 'submitting', 'submitted', 'failed']]}
|
2019-11-06 07:29:21 +03:00
|
|
|
},
|
2020-11-04 14:06:57 +03:00
|
|
|
recipient_filter: {
|
|
|
|
type: 'string',
|
|
|
|
maxlength: 50,
|
|
|
|
nullable: false,
|
|
|
|
defaultTo: 'paid',
|
|
|
|
validations: {isIn: [['all', 'free', 'paid']]}
|
|
|
|
},
|
2019-11-06 07:29:21 +03:00
|
|
|
error: {type: 'string', maxlength: 2000, nullable: true},
|
2019-11-15 14:25:33 +03:00
|
|
|
error_data: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
|
2019-11-06 07:29:21 +03:00
|
|
|
email_count: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0},
|
2020-11-25 20:48:24 +03:00
|
|
|
delivered_count: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0},
|
|
|
|
opened_count: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0},
|
|
|
|
failed_count: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0},
|
2019-11-06 07:29:21 +03:00
|
|
|
subject: {type: 'string', maxlength: 300, nullable: true},
|
2020-09-24 10:20:10 +03:00
|
|
|
from: {type: 'string', maxlength: 2000, nullable: true},
|
|
|
|
reply_to: {type: 'string', maxlength: 2000, nullable: true},
|
2019-11-06 07:29:21 +03:00
|
|
|
html: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
|
|
|
|
plaintext: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true},
|
2020-11-05 14:39:53 +03:00
|
|
|
track_opens: {type: 'bool', nullable: false, defaultTo: false},
|
2019-11-06 07:29:21 +03:00
|
|
|
submitted_at: {type: 'dateTime', nullable: false},
|
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true}
|
2020-09-14 14:21:58 +03:00
|
|
|
},
|
|
|
|
email_batches: {
|
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
email_id: {type: 'string', maxlength: 24, nullable: false, references: 'emails.id'},
|
|
|
|
provider_id: {type: 'string', maxlength: 255, nullable: true},
|
|
|
|
status: {
|
|
|
|
type: 'string',
|
|
|
|
maxlength: 50,
|
|
|
|
nullable: false,
|
|
|
|
defaultTo: 'pending',
|
|
|
|
validations: {isIn: [['pending', 'submitting', 'submitted', 'failed']]}
|
|
|
|
},
|
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
|
|
|
updated_at: {type: 'dateTime', nullable: false}
|
|
|
|
},
|
|
|
|
email_recipients: {
|
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
email_id: {type: 'string', maxlength: 24, nullable: false, references: 'emails.id'},
|
|
|
|
member_id: {type: 'string', maxlength: 24, nullable: false, index: true},
|
|
|
|
batch_id: {type: 'string', maxlength: 24, nullable: false, references: 'email_batches.id'},
|
|
|
|
processed_at: {type: 'dateTime', nullable: true},
|
2020-11-25 20:48:24 +03:00
|
|
|
delivered_at: {type: 'dateTime', nullable: true, index: true},
|
|
|
|
opened_at: {type: 'dateTime', nullable: true, index: true},
|
|
|
|
failed_at: {type: 'dateTime', nullable: true, index: true},
|
2020-09-14 14:21:58 +03:00
|
|
|
member_uuid: {type: 'string', maxlength: 36, nullable: false},
|
|
|
|
member_email: {type: 'string', maxlength: 191, nullable: false},
|
2020-11-25 20:48:24 +03:00
|
|
|
member_name: {type: 'string', maxlength: 191, nullable: true},
|
|
|
|
'@@INDEXES@@': [
|
|
|
|
['email_id', 'member_email']
|
|
|
|
]
|
2020-09-16 17:56:41 +03:00
|
|
|
},
|
|
|
|
tokens: {
|
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
2020-09-17 19:33:43 +03:00
|
|
|
token: {type: 'string', maxlength: 32, nullable: false, index: true},
|
2020-09-16 17:56:41 +03:00
|
|
|
data: {type: 'string', maxlength: 2000, nullable: true},
|
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false}
|
2020-10-16 14:52:06 +03:00
|
|
|
},
|
|
|
|
snippets: {
|
|
|
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
|
|
name: {type: 'string', maxlength: 191, nullable: false, unique: true},
|
|
|
|
mobiledoc: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: false},
|
|
|
|
created_at: {type: 'dateTime', nullable: false},
|
|
|
|
created_by: {type: 'string', maxlength: 24, nullable: false},
|
|
|
|
updated_at: {type: 'dateTime', nullable: true},
|
|
|
|
updated_by: {type: 'string', maxlength: 24, nullable: true}
|
2016-01-25 20:50:04 +03:00
|
|
|
}
|
|
|
|
};
|