mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-07-29 01:10:08 +00:00
remove migration
This commit is contained in:
@@ -141,7 +141,6 @@ library
|
||||
Simplex.Chat.Migrations.M20240313_drop_agent_ack_cmd_id
|
||||
Simplex.Chat.Migrations.M20240324_custom_data
|
||||
Simplex.Chat.Migrations.M20240402_item_forwarded
|
||||
Simplex.Chat.Migrations.M20240419_enable_pq_support
|
||||
Simplex.Chat.Mobile
|
||||
Simplex.Chat.Mobile.File
|
||||
Simplex.Chat.Mobile.Shared
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
|
||||
module Simplex.Chat.Migrations.M20240419_enable_pq_support where
|
||||
|
||||
import Database.SQLite.Simple (Query)
|
||||
import Database.SQLite.Simple.QQ (sql)
|
||||
|
||||
m20240419_enable_pq_support :: Query
|
||||
m20240419_enable_pq_support =
|
||||
[sql|
|
||||
UPDATE connections SET pq_support = 1 WHERE conn_type = 'contact';
|
||||
|]
|
||||
|
||||
down_m20240419_enable_pq_support :: Query
|
||||
down_m20240419_enable_pq_support =
|
||||
[sql|
|
||||
|]
|
||||
@@ -105,7 +105,6 @@ import Simplex.Chat.Migrations.M20240228_pq
|
||||
import Simplex.Chat.Migrations.M20240313_drop_agent_ack_cmd_id
|
||||
import Simplex.Chat.Migrations.M20240324_custom_data
|
||||
import Simplex.Chat.Migrations.M20240402_item_forwarded
|
||||
import Simplex.Chat.Migrations.M20240419_enable_pq_support
|
||||
import Simplex.Messaging.Agent.Store.SQLite.Migrations (Migration (..))
|
||||
|
||||
schemaMigrations :: [(String, Query, Maybe Query)]
|
||||
@@ -210,8 +209,7 @@ schemaMigrations =
|
||||
("20240228_pq", m20240228_pq, Just down_m20240228_pq),
|
||||
("20240313_drop_agent_ack_cmd_id", m20240313_drop_agent_ack_cmd_id, Just down_m20240313_drop_agent_ack_cmd_id),
|
||||
("20240324_custom_data", m20240324_custom_data, Just down_m20240324_custom_data),
|
||||
("20240402_item_forwarded", m20240402_item_forwarded, Just down_m20240402_item_forwarded),
|
||||
("20240419_enable_pq_support", m20240419_enable_pq_support, Just down_m20240419_enable_pq_support)
|
||||
("20240402_item_forwarded", m20240402_item_forwarded, Just down_m20240402_item_forwarded)
|
||||
]
|
||||
|
||||
-- | The list of migrations in ascending order by date
|
||||
|
||||
+1
-9
@@ -50,13 +50,11 @@ testSchemaMigrations = withTmpFiles $ do
|
||||
whenM (doesFileExist testSchema) $ removeFile testSchema
|
||||
where
|
||||
testDownMigration st m = do
|
||||
putStrLn $ "down migration " <> name m
|
||||
let downMigr = fromJust $ toDownMigration m
|
||||
schema <- getSchema testDB testSchema
|
||||
Migrations.run st $ MTRUp [m]
|
||||
schema' <- getSchema testDB testSchema
|
||||
unless (name m `elem` skipComparisonForUpMigrations) $
|
||||
schema' `shouldNotBe` schema
|
||||
schema' `shouldNotBe` schema
|
||||
Migrations.run st $ MTRDown [downMigr]
|
||||
unless (name m `elem` skipComparisonForDownMigrations) $ do
|
||||
schema'' <- getSchema testDB testSchema
|
||||
@@ -65,12 +63,6 @@ testSchemaMigrations = withTmpFiles $ do
|
||||
schema''' <- getSchema testDB testSchema
|
||||
schema''' `shouldBe` schema'
|
||||
|
||||
skipComparisonForUpMigrations :: [String]
|
||||
skipComparisonForUpMigrations =
|
||||
[ -- schema doesn't change
|
||||
"20240419_enable_pq_support"
|
||||
]
|
||||
|
||||
skipComparisonForDownMigrations :: [String]
|
||||
skipComparisonForDownMigrations =
|
||||
[ -- on down migration msg_delivery_events table moves down to the end of the file
|
||||
|
||||
Reference in New Issue
Block a user