我尝试迁移并得到没有唯一约束匹配的故障。
这些是我的模特
let rec partitionWhile p = function
| x::xs, y::ys when p x y -> partitionWhile p (y::x::xs, ys)
| xss, yss -> List.rev xss, yss
let rec splitList list = [
if not <| List.isEmpty list then
let acc, rest = partitionWhile (<=) ([list.Head], list.Tail)
if not <| List.isEmpty acc then
yield acc
yield! splitList rest ]
splitList [1;2;3;3;4]
// val it : int list list = [[1; 2; 3; 3; 4]]
splitList [1;2;3;2;4;3;5]
// val it : int list list = [[1; 2; 3]; [2; 4]; [3; 5]]
故障消息是
django.db.utils.ProgrammingError:没有唯一约束 匹配参考表“ team_teamrole”的给定键
有趣的是,使用sqlite在我的开发设置上没问题。但是在我的带有postgres的生产服务器上,它在迁移时会抱怨。
我迷路了。