{"action":"created","issue":{"url":"https://api.github.com/repos/stephencelis/SQLite.swift/issues/111","labels_url":"https://api.github.com/repos/stephencelis/SQLite.swift/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/stephencelis/SQLite.swift/issues/111/comments","events_url":"https://api.github.com/repos/stephencelis/SQLite.swift/issues/111/events","html_url":"https://github.com/stephencelis/SQLite.swift/issues/111","id":69601549,"number":111,"title":"Unable to set foreign key","user":{"login":"kylejm","id":3501212,"avatar_url":"https://avatars.githubusercontent.com/u/3501212?v=3","gravatar_id":"","url":"https://api.github.com/users/kylejm","html_url":"https://github.com/kylejm","followers_url":"https://api.github.com/users/kylejm/followers","following_url":"https://api.github.com/users/kylejm/following{/other_user}","gists_url":"https://api.github.com/users/kylejm/gists{/gist_id}","starred_url":"https://api.github.com/users/kylejm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylejm/subscriptions","organizations_url":"https://api.github.com/users/kylejm/orgs","repos_url":"https://api.github.com/users/kylejm/repos","events_url":"https://api.github.com/users/kylejm/events{/privacy}","received_events_url":"https://api.github.com/users/kylejm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-04-20T14:36:24Z","updated_at":"2015-04-20T14:58:02Z","closed_at":null,"body":"I'm trying to setup a foreign key with an `ON UPDATE` and `ON DELETE` setting, but the call I make seems to have no effect.\r\n\r\nHere's my code:\r\n\r\n```\r\ndb.foreignKeys = true\r\n            \r\nlet categories = db[\"Categories\"]\r\nlet categoryID = Expression<Int64>(\"id\")\r\net name = Expression<String>(\"name\")\r\n\r\ndb.create(table: categories) { t in\r\n    t.column(categoryID, primaryKey: .Autoincrement)\r\n    t.column(name)\r\n}\r\n\r\nlet bookmarks = db[\"Bookmarks\"]\r\nlet bookmarkID = Expression<Int64>(\"bookmark_id\")\r\nlet url = Expression<String>(\"url\")\r\nlet comment = Expression<String?>(\"comment\")\r\nlet categoryFK = Expression<Int64?>(\"category_id\")\r\n\r\ndb.create(table: bookmarks) { t in\r\n    t.column(bookmarkID, primaryKey: .Autoincrement)\r\n    t.column(name)\r\n    t.column(url)\r\n    t.column(comment)\r\n    t.column(categoryFK)\r\n    t.foreignKey(categoryFK, references: categories[categoryID], update: SchemaBuilder.Dependency.Cascade, delete: SchemaBuilder.Dependency.Cascade)\r\n}\r\n```\r\n\r\nAm I using the `foreighKey` function on the last line, correctly? No relationship is setup by the end of the this code being executed.\r\n\r\nMany thanks in advance, and awesome job on SQLite.swift!"},"comment":{"url":"https://api.github.com/repos/stephencelis/SQLite.swift/issues/comments/94475481","html_url":"https://github.com/stephencelis/SQLite.swift/issues/111#issuecomment-94475481","issue_url":"https://api.github.com/repos/stephencelis/SQLite.swift/issues/111","id":94475481,"user":{"login":"kylejm","id":3501212,"avatar_url":"https://avatars.githubusercontent.com/u/3501212?v=3","gravatar_id":"","url":"https://api.github.com/users/kylejm","html_url":"https://github.com/kylejm","followers_url":"https://api.github.com/users/kylejm/followers","following_url":"https://api.github.com/users/kylejm/following{/other_user}","gists_url":"https://api.github.com/users/kylejm/gists{/gist_id}","starred_url":"https://api.github.com/users/kylejm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylejm/subscriptions","organizations_url":"https://api.github.com/users/kylejm/orgs","repos_url":"https://api.github.com/users/kylejm/repos","events_url":"https://api.github.com/users/kylejm/events{/privacy}","received_events_url":"https://api.github.com/users/kylejm/received_events","type":"User","site_admin":false},"created_at":"2015-04-20T14:58:02Z","updated_at":"2015-04-20T14:58:02Z","body":"Awesome, BRB"}}