@@ -237,6 +237,30 @@ public function testReservedKeywords() {
237237 $ this ->addToAssertionCount (1 );
238238 }
239239
240+ /**
241+ * Test for nextcloud/server#36803
242+ */
243+ public function testColumnCommentsInUpdate () {
244+ $ startSchema = new Schema ([], [], $ this ->getSchemaConfig ());
245+ $ table = $ startSchema ->createTable ($ this ->tableName );
246+ $ table ->addColumn ('id ' , 'integer ' , ['autoincrement ' => true , 'comment ' => 'foo ' ]);
247+ $ table ->setPrimaryKey (['id ' ]);
248+
249+ $ endSchema = new Schema ([], [], $ this ->getSchemaConfig ());
250+ $ table = $ endSchema ->createTable ($ this ->tableName );
251+ $ table ->addColumn ('id ' , 'integer ' , ['autoincrement ' => true , 'comment ' => 'foo ' ]);
252+ // Assert adding comments on existing tables work (or at least does not throw)
253+ $ table ->addColumn ('time ' , 'integer ' , ['comment ' => 'unix-timestamp ' , 'notnull ' => false ]);
254+ $ table ->setPrimaryKey (['id ' ]);
255+
256+ $ migrator = $ this ->getMigrator ();
257+ $ migrator ->migrate ($ startSchema );
258+
259+ $ migrator ->migrate ($ endSchema );
260+
261+ $ this ->addToAssertionCount (1 );
262+ }
263+
240264 public function testAddingForeignKey () {
241265 $ startSchema = new Schema ([], [], $ this ->getSchemaConfig ());
242266 $ table = $ startSchema ->createTable ($ this ->tableName );
0 commit comments