mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-30 19:54:47 +00:00
fix migration issues
This commit is contained in:
@@ -150,18 +150,11 @@ makeFoundation appSettings = do
|
|||||||
|
|
||||||
stopEosWatch <- runLoggingT (runReaderT (watchEosRepoRoot pool) appSettings) logFunc
|
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
|
-- Preform database migration using application logging settings
|
||||||
runLoggingT (runSqlPool (runMigration migrateAll) pool) logFunc
|
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 the foundation
|
||||||
return $ mkFoundation pool stopEosWatch
|
return $ mkFoundation pool stopEosWatch
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ migration_0_2_0 =
|
|||||||
populateMetadata :: Operation
|
populateMetadata :: Operation
|
||||||
populateMetadata =
|
populateMetadata =
|
||||||
RawOperation "Populating Metadata"
|
RawOperation "Populating Metadata"
|
||||||
$ migrateTitles
|
$ migrateMetadata
|
||||||
<<$>> rawSql "SELECT pkg_id, title, desc_short, desc_long, icon_type FROM pkg_record" []
|
<<$>> rawSql "SELECT pkg_id, title, desc_short, desc_long, icon_type FROM pkg_record" []
|
||||||
where
|
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 = ?"
|
"UPDATE version SET title = ?, desc_short = ?, desc_long = ?, icon_type = ? where pkg_id = ?"
|
||||||
[PersistText title', PersistText descShort', PersistText descLong', PersistText iconType', PersistText id']
|
[PersistText title', PersistText descShort', PersistText descLong', PersistText iconType', PersistText id']
|
||||||
|
|||||||
Reference in New Issue
Block a user