File tree Expand file tree Collapse file tree
libs/wire-subsystems/src/Wire/JobSubsystem Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919-- with this program. If not, see <https://www.gnu.org/licenses/>.
2020
2121module Wire.JobSubsystem.Migrations
22- ( mkArbiterConnectionString ,
22+ ( defaultSchemaName ,
23+ mkArbiterConnectionString ,
2324 runJobMigrations ,
2425 )
2526where
2627
28+ import Arbiter.Core (defaultSchemaName )
2729import Arbiter.Migrations qualified as ArbiterMigrations
2830import Control.Exception (bracket , bracket_ , throwIO )
2931import Data.Hashable qualified as Hashable
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ import Wire.API.Routes.Version
6969import Wire.API.Routes.Version.Wai
7070import Wire.API.User (AccountStatus (PendingInvitation ))
7171import Wire.DeleteQueue
72+ import Wire.JobSubsystem.Migrations (defaultSchemaName , mkArbiterConnectionString , runJobMigrations )
7273import Wire.OpenTelemetry (withTracer )
7374import Wire.PostgresMigrations
7475import Wire.Sem.Paging qualified as P
@@ -117,6 +118,10 @@ migratePostgres opts resetFirst = do
117118 pool <- (. rawPool) <$> initPostgresPool opts. postgresqlPool opts. postgresql opts. postgresqlPassword
118119 when resetFirst $ resetSchema pool logger
119120 runAllMigrations pool logger
121+ -- Also create the arbiter job schema, so that this command yields the full
122+ -- database schema (e.g. for `make postgres-schema`).
123+ arbiterConnStr <- mkArbiterConnectionString opts. postgresql opts. postgresqlPassword
124+ runJobMigrations arbiterConnStr defaultSchemaName
120125 flush logger
121126
122127mkApp :: Opts -> IO (Wai. Application , Env )
You can’t perform that action at this time.
0 commit comments