vapor / fluent-mysql-driver

🖋🐬 Swift ORM (queries, models, relations, etc) built on MySQL.
MIT License
78 stars 52 forks source link

Unable to remove constraints in update #148

Closed siemensikkema closed 5 years ago

siemensikkema commented 5 years ago

On version 3.0.2 when doing

return Database.update(Product.self, on: conn) { updater in
  updater.deleteConstraint(.constraint(.notNull, .keyPath(\Product.someProperty)))
}

No statement to delete the constraint is created: ALTER TABLE `Product` []

The deleteConstraints value from FluentMySQLSchema is not copied to MySQLAlterTable here as there is no such property on that struct.

This issue is similar to https://github.com/vapor/fluent-mysql-driver/pull/147

tanner0101 commented 5 years ago

thanks @siemensikkema ! fixed here: https://github.com/vapor/fluent-mysql-driver/releases/tag/3.1.0