mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 02:11:53 +00:00
fix migration issues
This commit is contained in:
@@ -150,18 +150,11 @@ makeFoundation appSettings = do
|
||||
|
||||
stopEosWatch <- runLoggingT (runReaderT (watchEosRepoRoot pool) appSettings) logFunc
|
||||
|
||||
runSqlPool
|
||||
(Database.Persist.Migration.Postgres.runMigration Database.Persist.Migration.defaultSettings manualMigration)
|
||||
pool
|
||||
-- Preform database migration using application logging settings
|
||||
runLoggingT (runSqlPool (runMigration migrateAll) pool) logFunc
|
||||
`UnliftIO.catch` (\(e :: SomeException) -> do
|
||||
print e
|
||||
runSqlPool
|
||||
(Database.Persist.Migration.Postgres.runMigration
|
||||
Database.Persist.Migration.defaultSettings
|
||||
manualMigration
|
||||
)
|
||||
pool
|
||||
runLoggingT (runSqlPool (runMigration migrateAll) pool) logFunc
|
||||
)
|
||||
|
||||
-- Return the foundation
|
||||
return $ mkFoundation pool stopEosWatch
|
||||
|
||||
@@ -26,9 +26,9 @@ migration_0_2_0 =
|
||||
populateMetadata :: Operation
|
||||
populateMetadata =
|
||||
RawOperation "Populating Metadata"
|
||||
$ migrateTitles
|
||||
$ migrateMetadata
|
||||
<<$>> rawSql "SELECT pkg_id, title, desc_short, desc_long, icon_type FROM pkg_record" []
|
||||
where
|
||||
migrateTitles (Single id', Single title', Single descShort', Single descLong', Single iconType') = MigrateSql
|
||||
migrateMetadata (Single id', Single title', Single descShort', Single descLong', Single iconType') = MigrateSql
|
||||
"UPDATE version SET title = ?, desc_short = ?, desc_long = ?, icon_type = ? where pkg_id = ?"
|
||||
[PersistText title', PersistText descShort', PersistText descLong', PersistText iconType', PersistText id']
|
||||
|
||||
Reference in New Issue
Block a user