Experimental: better quoting
This commit is contained in:
parent
e32ad38fb9
commit
fadd7c4d88
@ -88,7 +88,7 @@ customMigrations :: MonadIO m => Map (Key AppliedMigration) (ReaderT SqlBackend
|
|||||||
customMigrations = Map.fromListWith (>>)
|
customMigrations = Map.fromListWith (>>)
|
||||||
[ ( AppliedMigrationKey [migrationVersion|initial|] [version|0.0.0|]
|
[ ( AppliedMigrationKey [migrationVersion|initial|] [version|0.0.0|]
|
||||||
, whenM (tableExists "user") $ do -- New theme format
|
, whenM (tableExists "user") $ do -- New theme format
|
||||||
userThemes <- [sqlQQ| SELECT 'id', 'theme' FROM 'user'; |]
|
userThemes <- [sqlQQ| SELECT "id", "theme" FROM "user"; |]
|
||||||
forM_ userThemes $ \(uid, Single str) -> case stripPrefix "theme--" str of
|
forM_ userThemes $ \(uid, Single str) -> case stripPrefix "theme--" str of
|
||||||
Just v
|
Just v
|
||||||
| Just theme <- fromPathPiece v -> update uid [UserTheme =. theme]
|
| Just theme <- fromPathPiece v -> update uid [UserTheme =. theme]
|
||||||
@ -97,8 +97,8 @@ customMigrations = Map.fromListWith (>>)
|
|||||||
, ( AppliedMigrationKey [migrationVersion|0.0.0|] [version|1.0.0|]
|
, ( AppliedMigrationKey [migrationVersion|0.0.0|] [version|1.0.0|]
|
||||||
, whenM (tableExists "sheet") $ -- Better JSON encoding
|
, whenM (tableExists "sheet") $ -- Better JSON encoding
|
||||||
[executeQQ|
|
[executeQQ|
|
||||||
ALTER TABLE 'sheet' ALTER COLUMN 'type' TYPE json USING 'type'::json;
|
ALTER TABLE "sheet" ALTER COLUMN "type" TYPE json USING "type"::json;
|
||||||
ALTER TABLE 'sheet' ALTER COLUMN 'grouping' TYPE json USING 'grouping'::json;
|
ALTER TABLE "sheet" ALTER COLUMN "grouping" TYPE json USING "grouping"::json;
|
||||||
|]
|
|]
|
||||||
)
|
)
|
||||||
, ( AppliedMigrationKey [migrationVersion|1.0.0|] [version|2.0.0|]
|
, ( AppliedMigrationKey [migrationVersion|1.0.0|] [version|2.0.0|]
|
||||||
|
|||||||
Reference in New Issue
Block a user