Skip to content

Commit 113ecca

Browse files
committed
Migration refinements
1 parent 9cd117c commit 113ecca

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

extra/Lamdera/CLI/Login.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ checkApiLoop inProduction appName token =
8888
url =
8989
if textContains "-local" appName
9090
then
91-
"http://localhost:8000/auth/cli/" <> mask
91+
"http://localhost:8082/auth/cli/" <> mask
9292
else
9393
"https://dashboard.lamdera.app/auth/cli/" <> mask
9494

@@ -156,6 +156,7 @@ validateCliToken = do
156156

157157

158158
Nothing -> do
159+
debug_ $ "Found no token in " <> elmHome
159160
Progress.report $ D.fillSep ["───>", D.red "No CLI auth, please run `lamdera login`"]
160161
exitFailure
161162

@@ -167,7 +168,7 @@ fetchApiSession appName token =
167168
endpoint =
168169
if textContains "-local" appName
169170
then
170-
"http://localhost:8000/_r/apiSessionJson"
171+
"http://localhost:8082/_r/apiSessionJson"
171172
-- "https://" <> T.unpack appName <> ".lamdera.test/_i"
172173
else
173174
"https://dashboard.lamdera.app/_r/apiSessionJson"

extra/Lamdera/Evergreen/MigrationHarness.hs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ generateFor nextVersion migrationFilepaths = do
7979
if vinfoVersion nextVersion > 1 then
8080
upgradeFor migrationSequence nextVersion "BackendModel"
8181
else
82-
"upgradeBackendModelPrevious = ()\n\n"
82+
"upgradeBackendModelPrevious = unchanged\n\n"
8383

8484
final =
8585
[text|
@@ -169,17 +169,19 @@ upgradeFor migrationSequence nextVersion valueType = do
169169
case nextVersion of
170170
WithMigrations _ ->
171171
[untrimming|
172-
upgrade${valueType}Previous : T$currentVersion_.$valueType -> UpgradeResult T$nextVersion_.$valueType T$nextVersion_.$cmdMsgType
172+
-- upgrade${valueType}Previous : T$currentVersion_.$valueType -> UpgradeResult T$nextVersion_.$valueType T$nextVersion_.$cmdMsgType
173+
upgrade${valueType}Previous : previousModel -> UpgradeResult T$nextVersion_.$valueType T$nextVersion_.$cmdMsgType
173174
upgrade${valueType}Previous model_v$currentVersion_ =
174-
model_v$currentVersion_
175+
unsafeCoerce model_v$currentVersion_
175176
|> M$nextVersion_.$valueTypeTitleCase
176177

177178

178179
|]
179180

180181
WithoutMigrations _ ->
181182
[untrimming|
182-
upgrade${valueType}Previous : T$nextVersion_.$valueType -> UpgradeResult T$nextVersion_.$valueType T$nextVersion_.$cmdMsgType
183+
-- upgrade${valueType}Previous : T$nextVersion_.$valueType -> UpgradeResult T$nextVersion_.$valueType T$nextVersion_.$cmdMsgType
184+
upgrade${valueType}Previous : previousModel -> UpgradeResult T$nextVersion_.$valueType T$nextVersion_.$cmdMsgType
183185
upgrade${valueType}Previous model_v$currentVersion_ =
184186
unchanged model_v$currentVersion_
185187

extra/Lamdera/Injection.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,6 @@ injections isBackend isLocalDev =
195195
{ decodeWirePayloadHeader: $$author$$project$$LamderaHelpers$$decodeWirePayloadHeader
196196
, decodeWireAnalytics: $$author$$project$$LamderaHelpers$$decodeWireAnalytics
197197
, getUserModel : function() { return model.userModel }
198-
, setUserModel : function(userModel) { model.userModel = userModel }
199-
, upgradeBackendModelPrevious : function() { model.userModel = $$author$$project$$LamderaGenerated$$upgradeBackendModelPrevious(model) }
200198
}
201199
|]
202200
else

extra/LocalDev/LocalDev.elm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,7 +1765,7 @@ getAppSnapshotFilenames appId =
17651765

17661766
-- , url = "http://apps.lamdera.com:8080/v1/app/" ++ appId ++ "/snapshots"
17671767
-- , url = "http://localhost:8080/v1/app/" ++ appId ++ "/snapshots"
1768-
, url = "http://localhost:8000/_x/list/snapshots"
1768+
, url = "/_x/list/snapshots"
17691769
, body = LD.emptyBody
17701770
, resolver = LD.stringResolver <| LD.handleJsonResponse <| Json.decoderList Json.decoderString
17711771
, timeout = Nothing
@@ -1804,7 +1804,7 @@ getAppSnapshot snapshot =
18041804
-- , headers = []
18051805
-- -- , url = "http://apps.lamdera.com:8080/v1/app/" ++ appId ++ "/snapshot-retrieve/" ++ snapshot ++ "/" ++ token
18061806
-- -- , url = "http://localhost:8080/v1/app/" ++ appId ++ "/snapshot-retrieve/" ++ snapshot ++ "/" ++ token
1807-
-- , url = "http://localhost:8000/_x/read/" ++ "snapshots/" ++ snapshot
1807+
-- , url = "/_x/read/" ++ "snapshots/" ++ snapshot
18081808
-- , body = LD.emptyBody
18091809
-- , resolver = Http.bytesResolver handleBytesResponse
18101810
-- , timeout = Nothing

0 commit comments

Comments
 (0)