Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Model: Review max length limits in database schema #4134

Closed
ErisDS opened this issue Sep 24, 2014 · 7 comments
Closed

Data Model: Review max length limits in database schema #4134

ErisDS opened this issue Sep 24, 2014 · 7 comments
Assignees
Labels
server / core Issues relating to the server or core of Ghost

Comments

@ErisDS
Copy link
Member

ErisDS commented Sep 24, 2014

Some of the max length limits in the database schema need extending.

With regard to meta_title and meta_description, see: #4126 (comment)

While we're at it, it's worth reviewing all of the max length limits now that we have more information about how people use their blogs.

For all of the "text" fields that don't have a clear answer to how long they should be, we need a plan for:

  • what field types should we use and why
  • what length should the field be in the database (hard limit)
  • to what length should the field be validated (taking utf8mb4) into account (soft limit)

We don't get to change these things later, only thing we can easily do is increase a soft (validated) limit
So it needs to be right, and future proof

In order to implement the changes, we will need #601 - the ability to change the max length on a column.

We're going to make these changes as part of the alpha

@ErisDS ErisDS added the server / core Issues relating to the server or core of Ghost label Sep 24, 2014
@ErisDS ErisDS added this to the 0.5.x Backlog milestone Sep 24, 2014
@javorszky
Copy link
Contributor

Max length for slugs is arbitrary. I don't think there shuold be a limit. We've run into the slugs not being long enough here: https://ghost.org/forum/using-ghost/16161-how-to-change-the-slug-to-include-only-year-and-month

I propose to extend that to 512 or even 1024 char lengths. Currently it's 150.

@halfdan
Copy link
Contributor

halfdan commented Sep 24, 2014

@javorszky At the same time the title length should be reconsidered. It currently has a limit of 150 characters as well.

title: {type: 'string', maxlength: 150, nullable: false},
slug: {type: 'string', maxlength: 150, nullable: false, unique: true},

@JohnONolan
Copy link
Member

Slugs are one thing which can have a pretty restrictive limit without negative consequence. We should simply trim them automatically for both readability and usability. It's also an SEO enhancement (source).

I agree title length should be less restrictive

@javorszky
Copy link
Contributor

Google says (source, march 7, 2014, source of source) that you should keep urls shorter than 2,000 chars, but there's no theoretical limit.

Would definitely help with 301 redirects in that you only need to swap the domains and not cater for regex trimming urls.

@JohnONolan
Copy link
Member

  • Older browsers throw errors on URLs longer than 255 chars
  • Drupal limits to 255
  • WordPress limits to 200
  • Medium limits to 135
  • Tumblr limits to 100

@javorszky
Copy link
Contributor

Let's move the limit to 255 then? :)

@ErisDS ErisDS added the data label Apr 16, 2015
@ErisDS ErisDS modified the milestone: Next Backlog Oct 9, 2015
kirrg001 added a commit to kirrg001/Ghost that referenced this issue Sep 21, 2016
@kirrg001 kirrg001 added this to the 1.0.0-alpha.2 milestone Sep 21, 2016
@ErisDS ErisDS changed the title Review max length limits in database schema Data Model: Review max length limits in database schema Sep 21, 2016
@kirrg001 kirrg001 removed this from the 1.0.0-alpha.2 milestone Sep 23, 2016
@ErisDS ErisDS mentioned this issue Sep 23, 2016
12 tasks
@ErisDS
Copy link
Member Author

ErisDS commented Jan 18, 2017

Closing this as it's effectively covered by #7432 and we don't need 2 issues open :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
server / core Issues relating to the server or core of Ghost
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants