-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs need a note on foreign key references to user #14
Comments
Working example: http://dpaste.com/35XTE73 |
The dpaste I shared with you has been set to expire (and apparently has) so I'm sharing import qualified Snap.Snaplet.Auth.Backends.Persistent as SP
share [mkPersist sqlSettings, mkMigrate "migrateAll"] $ [persistLowerCase|
SomeStuffz
userId SP.SnapAuthUserId Eq reference=snap_auth_user
createdAt UTCTime default=CURRENT_TIMESTAMP
deriving Eq Show Generic
|] ++ SP.authEntityDefs |
@denibertovic you can make it highlight that as Haskell code in the following manner: import Blah (myCode) Example: import Blah (myCode) |
@bitemyapp Yeah I know. Just didn't think about it at the moment. Thanks, I've updated the snippet. |
@denibertovic cheers. Also is it me or is Github missing a "view source" button for comments? |
I don't remember seeing that so it might be just you. :P |
@denibertovic I mean it should be added. It's a turn of phrase. |
Ah. Indeed. :) |
This is from a discussion between myself, @denibertovic, and @bitemyapp. Because of the way QQ scopes things,
schema.txt
in this repo is not in the same scope when the user includes the decls into their own app. The result is that persistent can't figure out thatSnapAuthUserId
is a primary key and thus if you reference it in another table, it will not create a foreign key. The solution is to manually tell persistent's TH that the column is a reference.The text was updated successfully, but these errors were encountered: