Skip to content

Commit

Permalink
feat: Allow titles to be up to 250 chars to match v2
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmackay committed Dec 19, 2018
1 parent ee0b780 commit 336c1ab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions migrations/20181219073943_make_post_title_longer.php
@@ -0,0 +1,18 @@
<?php

use Phinx\Migration\AbstractMigration;

class MakePostTitleLonger extends AbstractMigration
{
public function up()
{
$this->table('posts')
->changeColumn('title', 'string', ['limit' => 255, 'null' => true])
->update();
}

public function down()
{
// No op, don't truncate titles
}
}
2 changes: 1 addition & 1 deletion src/App/Validator/Post/Create.php
Expand Up @@ -104,7 +104,7 @@ protected function getRules()

return [
'title' => [
['max_length', [':value', 150]],
['max_length', [':value', 250]],
],
'slug' => [
['min_length', [':value', 2]],
Expand Down

0 comments on commit 336c1ab

Please sign in to comment.