From a9aef2dd90791b88febfb0b85fa4d7ce597acd93 Mon Sep 17 00:00:00 2001 From: nicholasf Date: Wed, 22 Apr 2015 12:54:19 -0700 Subject: [PATCH] Simpler (and correct) example for showing how to declare foreign keys. Impact: Trivial. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ab38976..6e929c4c 100644 --- a/README.md +++ b/README.md @@ -1091,7 +1091,7 @@ type Product struct { // 2nd param : destination table(id) // 3rd param : ONDELETE // 4th param : ONUPDATE -db.Model(&User{}).AddForeignKey("user_id", "destination_table(id)", "CASCADE", "RESTRICT") +db.Model(&User{}).AddForeignKey("role_id", "roles", "CASCADE", "RESTRICT") // Add index db.Model(&User{}).AddIndex("idx_user_name", "name")