Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix table creation to work better with schemas

  • Loading branch information...
commit f005c6afab43bc928030ade2ec89b501cc5d938f 1 parent 1b3e76f
@mightybyte authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  src/Snap/Snaplet/Auth/Backends/PostgresqlSimple.hs
View
3  src/Snap/Snaplet/Auth/Backends/PostgresqlSimple.hs
@@ -101,11 +101,12 @@ createTableIfMissing PostgresAuthManager{..} = do
withResource pamConnPool $ \conn -> do
res <- P.query_ conn $ Query $ T.encodeUtf8 $
"select relname from pg_class where relname='"
- `T.append` tblName pamTable `T.append` "'"
+ `T.append` schemaless (tblName pamTable) `T.append` "'"
when (null (res :: [Only T.Text])) $
P.execute_ conn (Query $ T.encodeUtf8 q) >> return ()
return ()
where
+ schemaless = T.reverse . T.takeWhile (/='.') . T.reverse
q = T.concat
[ "CREATE TABLE "
, tblName pamTable
Please sign in to comment.
Something went wrong with that request. Please try again.