Creating a composite Unique constraints on multiple columns

前端 未结 3 1731
轻奢々
轻奢々 2021-02-01 00:33

This is my model:

class User {...}
class Book {
  User author;
  int number;
}

Every book number starts at 1 per author and increments upwards.

3条回答
  •  说谎
    说谎 (楼主)
    2021-02-01 00:49

    When table is created before, it is necessary to remove it. Unique key is not added to existing table.

提交回复
热议问题