Skip to content

Commit 051900a

Browse files
committed
Fix failing tests
1 parent 8fd5b8b commit 051900a

File tree

6 files changed

+6
-10
lines changed

6 files changed

+6
-10
lines changed

src/lib/migrations/MysqlMigrationBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected function compareColumns(ColumnSchema $current, ColumnSchema $desired):
6565
, 'precision', 'scale', 'unsigned'#, 'comment'
6666
];
6767
$comment = false;
68-
if ($this->model->attributes[$desired->name]->xDescriptionIsComment) {
68+
if (isset($this->model->attributes[$desired->name]) && $this->model->attributes[$desired->name]->xDescriptionIsComment) {
6969
$comment = true;
7070
}
7171
if ($this->model->descriptionIsComment) {

tests/specs/blog_v2/migrations_maria_db/m200000_000000_change_table_v2_posts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ public function up()
1111
$this->addColumn('{{%v2_posts}}', 'lang', 'enum("ru", "eng") NULL DEFAULT \'ru\' AFTER slug');
1212
$this->dropIndex('v2_posts_slug_key', '{{%v2_posts}}');
1313
$this->dropColumn('{{%v2_posts}}', 'uid');
14-
$this->alterColumn('{{%v2_posts}}', 'category_id', $this->bigInteger()->notNull()->comment('Category of posts'));
14+
$this->alterColumn('{{%v2_posts}}', 'category_id', $this->bigInteger()->notNull());
1515
$this->alterColumn('{{%v2_posts}}', 'active', $this->tinyInteger(1)->notNull());
16-
$this->alterColumn('{{%v2_posts}}', 'created_by_id', $this->bigInteger()->null()->defaultValue(null)->comment('The User'));
16+
$this->alterColumn('{{%v2_posts}}', 'created_by_id', $this->bigInteger()->null()->defaultValue(null));
1717
}
1818

1919
public function down()

tests/specs/blog_v2/migrations_maria_db/m200000_000005_change_table_v2_comments.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ public function up()
1111
$this->dropForeignKey('fk_v2_comments_author_id_v2_users_id', '{{%v2_comments}}');
1212
$this->addColumn('{{%v2_comments}}', 'user_id', $this->bigInteger()->null()->defaultValue(null)->after('post_id')->comment('The User'));
1313
$this->dropColumn('{{%v2_comments}}', 'author_id');
14-
$this->alterColumn('{{%v2_comments}}', 'post_id', $this->bigInteger(20)->notNull()->comment('A blog post (uid used as pk for test purposes)'));
1514
$this->alterColumn('{{%v2_comments}}', 'message', $this->text()->notNull());
1615
$this->alterColumn('{{%v2_comments}}', 'meta_data', $this->string(300)->null()->defaultValue(''));
1716
$this->alterColumn('{{%v2_comments}}', 'created_at', $this->timestamp()->notNull());
@@ -26,7 +25,6 @@ public function down()
2625
$this->alterColumn('{{%v2_comments}}', 'created_at', $this->integer(11)->notNull());
2726
$this->alterColumn('{{%v2_comments}}', 'meta_data', 'json NOT NULL DEFAULT \'[]\'');
2827
$this->alterColumn('{{%v2_comments}}', 'message', 'json NOT NULL DEFAULT \'[]\'');
29-
$this->alterColumn('{{%v2_comments}}', 'post_id', $this->bigInteger(20)->notNull());
3028
$this->addColumn('{{%v2_comments}}', 'author_id', $this->integer(11)->notNull()->after('post_id'));
3129
$this->dropColumn('{{%v2_comments}}', 'user_id');
3230
$this->addForeignKey('fk_v2_comments_author_id_v2_users_id', '{{%v2_comments}}', 'author_id', 'itt_v2_users', 'id');

tests/specs/blog_v2/migrations_mysql_db/m200000_000000_change_table_v2_posts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ public function up()
1111
$this->addColumn('{{%v2_posts}}', 'lang', 'enum("ru", "eng") NULL DEFAULT \'ru\' AFTER slug');
1212
$this->dropIndex('v2_posts_slug_key', '{{%v2_posts}}');
1313
$this->dropColumn('{{%v2_posts}}', 'uid');
14-
$this->alterColumn('{{%v2_posts}}', 'category_id', $this->bigInteger()->notNull()->comment('Category of posts'));
14+
$this->alterColumn('{{%v2_posts}}', 'category_id', $this->bigInteger()->notNull());
1515
$this->alterColumn('{{%v2_posts}}', 'active', $this->tinyInteger(1)->notNull());
16-
$this->alterColumn('{{%v2_posts}}', 'created_by_id', $this->bigInteger()->null()->defaultValue(null)->comment('The User'));
16+
$this->alterColumn('{{%v2_posts}}', 'created_by_id', $this->bigInteger()->null()->defaultValue(null));
1717
}
1818

1919
public function down()

tests/specs/blog_v2/migrations_mysql_db/m200000_000005_change_table_v2_comments.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ public function up()
1111
$this->dropForeignKey('fk_v2_comments_author_id_v2_users_id', '{{%v2_comments}}');
1212
$this->addColumn('{{%v2_comments}}', 'user_id', $this->bigInteger()->null()->defaultValue(null)->after('post_id')->comment('The User'));
1313
$this->dropColumn('{{%v2_comments}}', 'author_id');
14-
$this->alterColumn('{{%v2_comments}}', 'post_id', $this->bigInteger()->notNull()->comment('A blog post (uid used as pk for test purposes)'));
1514
$this->alterColumn('{{%v2_comments}}', 'message', $this->text()->notNull());
1615
$this->alterColumn('{{%v2_comments}}', 'meta_data', $this->string(300)->null()->defaultValue(''));
1716
$this->alterColumn('{{%v2_comments}}', 'created_at', $this->timestamp()->notNull());
@@ -26,7 +25,6 @@ public function down()
2625
$this->alterColumn('{{%v2_comments}}', 'created_at', $this->integer()->notNull());
2726
$this->alterColumn('{{%v2_comments}}', 'meta_data', 'json NOT NULL');
2827
$this->alterColumn('{{%v2_comments}}', 'message', 'json NOT NULL');
29-
$this->alterColumn('{{%v2_comments}}', 'post_id', $this->bigInteger()->notNull());
3028
$this->addColumn('{{%v2_comments}}', 'author_id', $this->integer()->notNull()->after('post_id'));
3129
$this->dropColumn('{{%v2_comments}}', 'user_id');
3230
$this->addForeignKey('fk_v2_comments_author_id_v2_users_id', '{{%v2_comments}}', 'author_id', 'itt_v2_users', 'id');

tests/specs/issue_fix/60_description_of_a_property_in_spec_must_correspond_to_db_table_column_comment/index.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
openapi: 3.0.3
2-
#x-description-is-comment: true
2+
x-description-is-comment: true
33
info:
44
title: 'Description of a property in spec must correspond to DB TABLE COLUMN COMMENT #60'
55
version: 1.0.0

0 commit comments

Comments
 (0)