diff options
Diffstat (limited to 'Database')
-rw-r--r-- | Database/Keys.hs | 5 | ||||
-rw-r--r-- | Database/Keys/SQL.hs | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/Database/Keys.hs b/Database/Keys.hs index a711ba7ca..faf34132a 100644 --- a/Database/Keys.hs +++ b/Database/Keys.hs @@ -127,14 +127,13 @@ openDb createdb _ = withExclusiveLock gitAnnexKeysDbLock $ do (False, True) -> do liftIO $ do createDirectoryIfMissing True dbdir - H.initDb db $ void $ - runMigrationSilent SQL.migrateKeysDb + H.initDb db SQL.createTables setAnnexDirPerm dbdir setAnnexFilePerm db open db (False, False) -> return DbEmpty where - open db = liftIO $ DbOpen <$> H.openDbQueue db "content" + open db = liftIO $ DbOpen <$> H.openDbQueue db SQL.containedTable addAssociatedFile :: Key -> TopFilePath -> Annex () addAssociatedFile k f = runWriterIO $ SQL.addAssociatedFile (toSKey k) f diff --git a/Database/Keys/SQL.hs b/Database/Keys/SQL.hs index 22bcb86a1..6862b15d9 100644 --- a/Database/Keys/SQL.hs +++ b/Database/Keys/SQL.hs @@ -13,6 +13,7 @@ module Database.Keys.SQL where import Database.Types +import Database.Handle import qualified Database.Queue as H import Utility.InodeCache import Git.FilePath @@ -33,6 +34,12 @@ Content KeyCacheIndex key cache |] +containedTable :: TableName +containedTable = "content" + +createTables :: SqlPersistM () +createTables = void $ runMigrationSilent migrateKeysDb + newtype ReadHandle = ReadHandle H.DbQueue readDb :: SqlPersistM a -> ReadHandle -> IO a |