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

Commit a83d212

Browse files
Merge branch 'release/0.11.2'
2 parents 51a9d75 + 90177a8 commit a83d212

File tree

4 files changed

+49
-12
lines changed

4 files changed

+49
-12
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 0.11.2 (April 7, 2016)
4+
5+
### FIXED
6+
- Fixed update URL after comment
7+
- Fixed different prefixes with SQLLite
8+
- Fixed SQLite collations
9+
310
## 0.11.1 (April 1, 2016)
411

512
### Changed

app/views/comments.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ module.exports = {
162162

163163
} else {
164164

165-
this.$root.load().success(function () {
165+
this.$root.load().then(function () {
166166
window.location.hash = 'comment-' + data.comment.id;
167167
});
168168
}

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "pagekit/blog",
33
"type": "pagekit-extension",
4-
"version": "0.11.1",
4+
"version": "0.11.2",
55
"title": "Blog",
66
"description": "A blog extensions with a built-in comment system.",
77
"license": "MIT",

scripts.php

+40-10
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
$table->addColumn('data', 'json_array', ['notnull' => false]);
2323
$table->addColumn('roles', 'simple_array', ['notnull' => false]);
2424
$table->setPrimaryKey(['id']);
25-
$table->addUniqueIndex(['slug'], 'BLOG_POST_SLUG');
26-
$table->addIndex(['title'], 'BLOG_POST_TITLE');
27-
$table->addIndex(['user_id'], 'BLOG_POST_USER_ID');
28-
$table->addIndex(['date'], 'BLOG_POST_DATE');
25+
$table->addUniqueIndex(['slug'], '@BLOG_POST_SLUG');
26+
$table->addIndex(['title'], '@BLOG_POST_TITLE');
27+
$table->addIndex(['user_id'], '@BLOG_POST_USER_ID');
28+
$table->addIndex(['date'], '@BLOG_POST_DATE');
2929
});
3030
}
3131

@@ -43,11 +43,11 @@
4343
$table->addColumn('content', 'text');
4444
$table->addColumn('status', 'smallint');
4545
$table->setPrimaryKey(['id']);
46-
$table->addIndex(['author'], 'BLOG_COMMENT_AUTHOR');
47-
$table->addIndex(['created'], 'BLOG_COMMENT_CREATED');
48-
$table->addIndex(['status'], 'BLOG_COMMENT_STATUS');
49-
$table->addIndex(['post_id'], 'BLOG_COMMENT_POST_ID');
50-
$table->addIndex(['post_id', 'status'], 'BLOG_COMMENT_POST_ID_STATUS');
46+
$table->addIndex(['author'], '@BLOG_COMMENT_AUTHOR');
47+
$table->addIndex(['created'], '@BLOG_COMMENT_CREATED');
48+
$table->addIndex(['status'], '@BLOG_COMMENT_STATUS');
49+
$table->addIndex(['post_id'], '@BLOG_COMMENT_POST_ID');
50+
$table->addIndex(['post_id', 'status'], '@BLOG_COMMENT_POST_ID_STATUS');
5151
});
5252
}
5353

@@ -64,6 +64,36 @@
6464
if ($util->tableExists('@blog_comment')) {
6565
$util->dropTable('@blog_comment');
6666
}
67-
}
67+
},
68+
69+
'updates' => [
70+
71+
'0.11.2' => function ($app) {
72+
73+
$db = $app['db'];
74+
$util = $db->getUtility();
75+
76+
foreach (['@blog_post', '@blog_comment'] as $name) {
77+
$table = $util->getTable($name);
78+
79+
foreach ($table->getIndexes() as $name => $index) {
80+
if ($name !== 'primary') {
81+
$table->renameIndex($index->getName(), $app['db']->getPrefix() . $index->getName());
82+
}
83+
}
84+
85+
if ($app['db']->getDatabasePlatform()->getName() === 'sqlite') {
86+
foreach ($table->getColumns() as $column) {
87+
if (in_array($column->getType()->getName(), ['string', 'text'])) {
88+
$column->setOptions(['customSchemaOptions' => ['collation' => 'NOCASE']]);
89+
}
90+
}
91+
}
92+
}
93+
94+
$util->migrate();
95+
}
96+
97+
]
6898

6999
];

0 commit comments

Comments
 (0)