Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/0.11.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
malte-christian committed Apr 7, 2016
2 parents 51a9d75 + 90177a8 commit a83d212
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 12 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.11.2 (April 7, 2016)

### FIXED
- Fixed update URL after comment
- Fixed different prefixes with SQLLite
- Fixed SQLite collations

## 0.11.1 (April 1, 2016)

### Changed
Expand Down
2 changes: 1 addition & 1 deletion app/views/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ module.exports = {

} else {

this.$root.load().success(function () {
this.$root.load().then(function () {
window.location.hash = 'comment-' + data.comment.id;
});
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pagekit/blog",
"type": "pagekit-extension",
"version": "0.11.1",
"version": "0.11.2",
"title": "Blog",
"description": "A blog extensions with a built-in comment system.",
"license": "MIT",
Expand Down
50 changes: 40 additions & 10 deletions scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
$table->addColumn('data', 'json_array', ['notnull' => false]);
$table->addColumn('roles', 'simple_array', ['notnull' => false]);
$table->setPrimaryKey(['id']);
$table->addUniqueIndex(['slug'], 'BLOG_POST_SLUG');
$table->addIndex(['title'], 'BLOG_POST_TITLE');
$table->addIndex(['user_id'], 'BLOG_POST_USER_ID');
$table->addIndex(['date'], 'BLOG_POST_DATE');
$table->addUniqueIndex(['slug'], '@BLOG_POST_SLUG');
$table->addIndex(['title'], '@BLOG_POST_TITLE');
$table->addIndex(['user_id'], '@BLOG_POST_USER_ID');
$table->addIndex(['date'], '@BLOG_POST_DATE');
});
}

Expand All @@ -43,11 +43,11 @@
$table->addColumn('content', 'text');
$table->addColumn('status', 'smallint');
$table->setPrimaryKey(['id']);
$table->addIndex(['author'], 'BLOG_COMMENT_AUTHOR');
$table->addIndex(['created'], 'BLOG_COMMENT_CREATED');
$table->addIndex(['status'], 'BLOG_COMMENT_STATUS');
$table->addIndex(['post_id'], 'BLOG_COMMENT_POST_ID');
$table->addIndex(['post_id', 'status'], 'BLOG_COMMENT_POST_ID_STATUS');
$table->addIndex(['author'], '@BLOG_COMMENT_AUTHOR');
$table->addIndex(['created'], '@BLOG_COMMENT_CREATED');
$table->addIndex(['status'], '@BLOG_COMMENT_STATUS');
$table->addIndex(['post_id'], '@BLOG_COMMENT_POST_ID');
$table->addIndex(['post_id', 'status'], '@BLOG_COMMENT_POST_ID_STATUS');
});
}

Expand All @@ -64,6 +64,36 @@
if ($util->tableExists('@blog_comment')) {
$util->dropTable('@blog_comment');
}
}
},

'updates' => [

'0.11.2' => function ($app) {

$db = $app['db'];
$util = $db->getUtility();

foreach (['@blog_post', '@blog_comment'] as $name) {
$table = $util->getTable($name);

foreach ($table->getIndexes() as $name => $index) {
if ($name !== 'primary') {
$table->renameIndex($index->getName(), $app['db']->getPrefix() . $index->getName());
}
}

if ($app['db']->getDatabasePlatform()->getName() === 'sqlite') {
foreach ($table->getColumns() as $column) {
if (in_array($column->getType()->getName(), ['string', 'text'])) {
$column->setOptions(['customSchemaOptions' => ['collation' => 'NOCASE']]);
}
}
}
}

$util->migrate();
}

]

];

0 comments on commit a83d212

Please sign in to comment.