úÎ!xũp‰J      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHINone &',-.;EHMSUVX_mjImoto Errors from .moto Errors from .moto Errors from . moto Errors from 6.Jmoto Errors from K.Lmoto;The migration registry has an unexpected pending migration.Mmoto Errors from N.DBy the time you receive these errors, they have already been logged.OmotoThe currently dirty , as it appears in the ' records, is not present in the given 0.Pmoto'The code for the migration identfified  is gone.Qmoto Errors from R.Smoto The targeted *s are not present in the migrations graph.Tmoto§The specified migration history is not a known possibility according to the migrations dependency graph, meaning that it is not possible to add new migrations to it.Umoto\It is not possible to obtain an execution plan given the requirements and dependency graph.Vmoto9Some migrations required to obtain an execution plan are +.WmotoA 5 representation was malformed and couldn't be parsed.XmotoThis is just like  , except the Y- return values are propagated as exceptions.motooMigrations registry, keeping track of what migrations have been run so far, as well as those that are running.Consider using  as an easy way to create a .motoCurrent registry state.The passed in Z+ can be used for logging if necessary (see Di and Di.Df1), but please don't log exceptions nor messages telling whether this function succeeds or fails, since this library already does that for you.moto.Register a new pending change in the registry. Returns the , that describes this change to the registry.cThis is the first commit in the two-phase commit mechanism to registering migrations as executed ( is the second).If ., then the given I shall be recorded in the registry as fully exceuted after a subsequent . If the given 9 is already present and committed in the registry, then  shall return .If -, then the given •, which must be already present and committed to the registry, will be removed from the list of currently committed migtrations after a subsequent  . If the = is not already present and committed in the registry, then  shall return .IIf there is already an uncommitted migration (that is, if the status is [), then  s shall be returned. This constraint implies that it is impossible to have more than one pending change at a time.After a successful call to ", the registry will be left in a [ status until one of  or  is performed.The passed in Z+ can be used for logging if necessary (see Di and Di.Df1ˆ), but don't log exceptions nor messages telling whether this function succeeds or fails, since this library already does that for you.moto&Abort the pending change in the given , most recently introduced via *, expected to be identified by the given . Returns the , that describes this change to the registry.HIf there is no pending change to be aborted (that is, if the status is \), then  shall be returned.QIf the currently pending migration's identifier is different from the the given ), or if its execution was intended for a ,. different than the one specified here, then  shall be returned.After a successful call to ", the registry will be left in a \ status.The passed in Z+ can be used for logging if necessary (see Di and Di.Df1ˆ), but don't log exceptions nor messages telling whether this function succeeds or fails, since this library already does that for you.moto'Commit the pending change in the given , most recently introduced via *, expected to be identified by the given . Returns the , that describes this change to the registry.cThis is the first commit in the two-phase commit mechanism to registering migrations as executed ( is the first).JIf there is no pending change to be committed (that is, if the status is \), then  shall be returned.QIf the currently pending migration's identifier is different from the the given ), or if its execution was intended for a ,. different than the one specified here, then  shall be returned.After a successful call to ", the registry will be left in a \ status.The passed in Z+ can be used for logging if necessary (see Di and Di.Df1ˆ), but don't log exceptions nor messages telling whether this function succeeds or fails, since this library already does that for you.moto Internal  of a . Create with 5 and 6.]motoRegistry status.[motoXThere is an uncommitted migration being run in the specified direction in the registry.\moto4There are no uncommitted migrations in the registry.motoA  can be described as a list of  s ordered chronologically (see 6).moto%A particular migration identified by + is going to be executed in the specified ,.bThis is the first commit in the two-phase commit approach to registering a migration as executed.>The time when this log entry was created is mentioned as well.moto8The migration most recently prepared for execution with  is being committed.cThis is the second commit in the two-phase commit approach to registering a migration as executed.>The time when this log entry was created is mentioned as well.moto8The migration most recently prepared for execution with  is being aborted.fThis undoes the first commit in the two-phase commit approach to registering a migration as executed.>The time when this log entry was created is mentioned as well.^motoA migrations execution plan._moto9Unsafe constructor. The migrations are always listed in .# order, even if intended to be run -.`motoThe target to which to migrate.motoA term-level identifier for a ).motoA  describes how a ) changes the environment.FThe given function will be called when running the migration both in . or - direction..In both cases, we have access to the original 'v data while running the migration, which implies that even irrecoverable  migrations that delete things when going ., can be undone by relying on data from the '. The given  specifies why and how this ¸ is being run. Particularly, it describes the assumptions you can make about the environment, which is very important if something goes wrong. Please refer to the documentation for  for a better understanding.The passed in Z+ can be used for logging if necessary (see Di and Di.Df1á), but please don't log exceptions nor messages telling whether this function as a whole succeeds or fails, since this library already does that for you. However, for debugging purposes in case something goes wrong, it is very important that you log what your e is doing, particularly if the changes themselves are not atomic. Please see the documentation for !# to understand what can be helpful.After a successful - execution of this ), any recovery data associated with the ) previously obtained during the ' phase can be deleted from its "h, since it is not necessary anymore. This will happen automatically if you request so when instructing moto to run your migrations.moto8Execution mode of a migration, describing why and how a  migration is being run. motoGThe migration is being run as requested by the user, in the requested ,]. Every previous step until now has run successfully. You can assume a clean starting point.If running the migration in  6 mode fails, the same migration will be run again in ! mode in the opposite ,Æ as a way to undo any partial changes and go back to having a clean state. This recovery mechanism survives through different program executions, so even if a failure when running a migration in  < mode causes the whole program to crash, the corresponding !@ mode can still be run from the command line program. In fact, moto^ will refuse making any other changes until this matter is sorted. For this reason, if let a  being executed in  ‰ mode fails, it is always preferrable to let that exception propagate, and instead focus on writing any mitigating code as part of the ! mode.!moto'An attempt to run the migration in the ,ä requested by the user has failed, so as a recovery meassure we are running the same migration in the opposite direction now. You can't make assumptions about the starting point, because running the migration in the desired ,@ failed somewhere in the middle of process. Please rely on the 'A data you obtained before to decide how to correct the situation.#Ultimately, running a migration in ! mode in a particular ,7 needs to accomplish the same outcome as running it in   mode in that same ,.If running a migration in !˙G mode fails, then the program will exit and the migrations registry will be left in a dirty state, from which you can manually attempt to initiate a recovery again. At this point, reading the output logs and understanding what when wrong will be very useful: Maybe the migration failed because of a temporary phenomenon such as a network connectivity issue, in which simply retrying later will solve it, or maybe it failed because of a bug in the migration implementation, in which case logs will be crucial to understand how to change the migrations code in order to fix it."motoA ", describes how to save, load and delete the x data obtained by a '.This x data is used later by the  phase. A single " might be used by different )s.Hint:  from the  Moto.File module is a "/ you can use that's distributed with the main moto library.$moto Saves the x data originating from a '% step for a migration identified by ,  overwriting previous data if any.!If it's not possible to save the x9 data, then this function must fail with some exception.The passed in Z+ can be used for logging if necessary (see Di and Di.Df1), but please don't log exceptions nor messages telling whether this function succeeds or fails, since this library already does that for you.%moto"Load the data previously saved by $+, for a migration identified by the given . Notice that xc is returned in a continuation-passing style so that we can do proper resource deallocation after x has been consumed. Using x- outside of this intended scope is undefined.%If it's was not possible to load the x9 data, then this function must fail with some exception.The passed in Z+ can be used for logging if necessary (see Di and Di.Df1), but please don't log exceptions nor messages telling whether this function succeeds or fails, since this library already does that for you.&moto$Delete the data previously saved by $3, if any. for a migration identified by the given .GIf it's there was no data to delete, then this function should return ()t. On the other hand, if its acceptable to throw exceptions when it's not possible to access the underlying storage.The passed in Z+ can be used for logging if necessary (see Di and Di.Df1), but please don't log exceptions nor messages telling whether this function succeeds or fails, since this library already does that for you.'moto6The backup phase of a migration, collecting some data x for backup in a ".+Here we interact with the environment in a  read-onlyD manner, collecting all data that may be destroyed by a subsequent  phase for backup in some ".=This data will be crucial for automatic recovery in case the  phase of the ) that uses this '4 fails, or in case we manually decide to undo said )> at a later time. Thus, when deciding what data to return as x", please consider those scenarios.:The actual storing of the backup data is performed by the "# that is used as part of the same );. That is, we don't physically store the data within this ', all we do is return it as x.8Please keep in mind that depending on your environment, x< could be really large, so in those situations it best for x to be some kind of stream (e.g., a ). Notice that xc is returned in a continuation-passing style so that we can do proper resource deallocation after x has been consumed. Using x. outside of this intended scope is undefined.amotoInternal. Like )", but without the type level data.)moto8A single side-effecting migration uniquely identfied by id3 and depending on all of the migrations listed in deps.6These migration identifiers that appear as type-level b here, will be of type $ when represented at the type level.*motoPDescription of the different phashes that make up this migration identified by id$, depending on others identified by deps.+moto˙˙This constructor conveys the idea that code for a particular migration is gone, while still communicating the dependencies that this migration used to have so that we don't change the past dependency graph over time, which would make it impossible for moto to operate reliably.,moto$Direction in which a migration runs. Running it .` conveys the idea of advancing  or improving  your state over time somehow, while running it -Q conveys the idea of undoing all the changes that the migration does when going ..cmoto0We don't export this to keep the haddocks clean./motoThis d" is automatically satisfied by an id that is absent from graph, and deps* listing identifiers present in the given graph.In other words, / effectively forces  ; to always build Directed Acyclic Graphs (hence the name). / id deps graph :: d 0motoAThe directed acyclic graph of migrations available for execution.Construct using   and  . For example:     someMig   anotherMig   ... emotoUnsafe constructor. A map from  s, to the a4 identfified by it, as well as a set of all of the "s that must be executed before it.1moto)An empty, yet valid, graph of migrations. You can use  M as a starting point for constructing bigger migrations graphs. For example:     someMig   anotherMig   ... 2moto.Add a new migration with an unique identifier id depending on each of deps to a graph of migrations graph.The /C constraint guarantees that the result is a directed acyclic graph. To create a 0 from scratch, use   in combination with  . For example:     someMig   anotherMig   ... fmotofObtain a term-level representation of a migration identifier from its type-level representation as a b (as it appears in the id type parameter to )).gmotojObtain a term-level representation of some migration identifiers from their type-level representation as [b] (as they appear in the id type parameter to )).3motoCase analysis for ,. Evaluate to the first a in case it is -, otherwise to the second a.hmoto$The opposite of the given direction.imotoAdd some extra logging to a '.4motoGiven isomorpisms between a and b, obtain an function from " a and " b.A " x* is both covariant and contravariant with x.(This function respects the functor laws.jmotoAdd some extra logging to a ".kmotoAdd some extra logging to a .lmoto5Hexadecimal representation of the SHA1 hash for this .RmotoObtain a migrations execution ^ if possible.mmotoLike R<, but gets the history of ran migrations directly from the .nmoto"Whether the registry is currently [ or \.omotoZCommitted migrations, chronologically ordered, with the most recently applied first last.5motoA clean " without any committed migrations.6moto Modify a  by applying a  to it, if possible.Use 5 as the initial state.   6 5 :: p t => t  -> q    NmotoIf the  is currently [a, clean it up by running the dirty migration in the direction opposite than originally intended.rmotoAdd some extra logging to a , and promote the many YsmotoRGet all the topological orders for the given acyclic graph, in depth-first order.Each node is represented as k&, and the graph is represented as an t from nodes to an u1 of nodes it depends on. For example, the graph  1 <- 2 <- 3 where 1 must come before 2 and 2 must come before 3 can be represented as: [(1,[]), (2,[1]), (3,[2])] :: t v (u v) UIf there there are cycles in the graph, or if nodes depended upon are missing, then (w :: u) is returned. If the given map is empty, then (x [] :: u) is returned.The length of each [k] equals the size of the given t (i.e., y).zmotoPRuns the given action, and if some exception happens, then log it to the given Df1.{moto' is covariant with x.*moto.How to save and load data obtained during the ' phase when necessary.)Please note that you can reuse this same " across different migrations.#Any stored data will remain in the "b until it is not necessary anymore (but it can be manually deleted if desired, at your own risk).Please refer to " for further documentation.motoBackup phase of this migrationCThis phase is executed only once when trying to run the migration . for the first time.Please refer to ' for further documentation.motoChange phase of this migration.'This phase is executed both when going . and -D. Here we alter the environment somehow while having access to the x data obtained in the ' phase.Please refer to  for further documentation.2motoid must not be present in graph.All of deps must be present in graph.4motoIsomorphism from b to a.motoIsomorphism from a to b.RmotoAvaiable migrations.moto%Migration history represented as the &s that have already been run, in the . order they have been run.motoMigration target.mmotoAvaiable migrations.moto4Registry representing the current migration history.motoMigration target.U JLQSTVUW|][\^_`} !"#$%&'(a~)*+,-./0e12f€3h4lRmno56NK27 None ESX_mGہmotoRender as plain text.‚motoRender as DOT (Graphviz).ƒmoto3s for which to remove contents from the data store.„moto Acquire a  to use within a limited scope..…moto€Whether to just show whether the registry is clean and exit immediately with status 0 if the so, otherwise exit with status 1.†moto Acquire a  to use within a limited scope..‡moto Acquire a  to use within a limited scope..ˆmoto/Format in which to render the migrations graph.‰moto Acquire a  to use within a limited scope..ŠmotoMigration target.‹moto3Don't run migrations, just show the execution plan.ŒmotoRun migrations.motoShow available migrations.ŽmotoECheck that the available migrations are compatible with the registry.motoShow migrations registry.motoI.Clean the registry if dirty.‘motoDelete content from the store.7motoThis is the input required by >5, obtained from the command line arguments by using =.’motoSubcommand to run.8motoConfiguration for the B that we'll use to keep track of the migrations we've run so far.:motoHelp message for the  --registry command line option.;moto#Parse the string obtained from the  --registry- command line option, refining it into some r, of our choosing acceptable as an input to <.Ideally, this “ should be an URI (e.g., file:///var/db/migrations, or +postgres://user:password@host:port/database).<moto Given the r obtained from ;, get a * that can be used within the given scope.=moto5Run the command-line arguments parser, obtaining the 7 necessary for calling > afterwards.1Notice that we can run the executable that calls = with a --helpK command line switch for extensive documentation on how to interact with moto.>motoRun moto on the given migrations graph 0$, according to the instructions in 7.”moto Renders each MigId in the Plan@ preceded by its direction, and followed by a trailing newline.=motoConfiguration for the  to use.;Among other things, this will dictate how we interpret the  --registry command-line option. Examples: Moto.PostgreSQL.registryConf from the  3https://hackage.haskell.org/package/moto-postgresqlmoto-postgresql library or  Moto.File. from this library.motopThis extra parser can be used to read some extra configuration values from the command-line arguments, besides moto's own.”For example, we can obtain things such as the name of a configuration file or a database connection string we might want to use in our migrations.(If no such extra data is required, then x () can be used. Notice that moto…'s own command-line argument's parser has precedence over this parser. Yet, in the command-line, the argument's for the parser for a should come before moton's own subcommand arguments, otherwise the command line program will complain about a malformed command-line.>moto!Root logger. If you don't have a Z1 for your program yet, you can obtain one using Di.new from the  &https://hackage.haskell.org/package/didi library.motoAvaliable migrations graph.motoBInstructions on how to interact with our migrations. Obtain with =.789:;<=>NoneH= !"#$%&'()*+,-./012347=>>7=)*+"#$%&4'(,-.3 !012/None_Y(?motoThe “ is tainted, meaning our last attempt to interact with the registry's backing storage failed. We can't be certain about the current state of the .Amoto Create a  backed by an append-only  storage.%This registry maintains its internal Ŗ in memory as long as it is possible to successfuly store all the changes in the underlying append-only storage. If at some point this fails unrecoverably, then ?1 will be thrown by the functions acting on this .…It's important to acquire some kind of exclusive lock on the underlying storage, so that other applications can't poke it while our  is running.Amoto+Initial registry state obtained by reading 4s from the backing append-only storage and running 6 on them.motoHow to store a newly generated % in the backing append-only storage.ĩIf this function throws an exception, then the execption will propagated as usual, but also, this registry will be marked as tained and each subsequent operation on it will throw ?.$ 5689:;<?@A$89:;<A56?@  NoneX_pm•motoWrapper around = used for serialization purposes, so that we don't expose a – instance for .Emoto!Command-line configuration for a + stored as a file in the filesystem using F.Fmoto Obtain a . backed by an append-only file storage, using moto's own file format.—moto Obtain a 8 backed by an append-only file storage as described by A.GmotoA Store* that keeps data stored as files (one per MigId) in a filesystem directory.gFor maximum memory consumption efficiency, the data is written and read in a streaming fasion using a ˜.Fmoto&File where to store the registry logs.4An exclusive lock will be set on the this file (see ™’), which will stay open until this function returns. This is to prevent other programs to interact with this file while this program is running.—motoRender a single W. Be sure to add a trailing newline or similar if necessary, in order to separate one  entry from the next.motoParse a single Z. Be sure to consume and discard any trailing newline or similar separating one rendered  entry from the next.moto&File where to store the registry logs.4An exclusive lock will be set on the this file (see ™’), which will stay open until this function returns. This is to prevent other programs to interact with this file while this program is running.Gmoto:Path to a directory where the files are or will be stored.EFGEFGš !"#$%&'(()**+,-../012233456789  :;<= > ? ? @ A B C DEEFGHIJKLDMNOPQRSTUVWXYZ[\]^_`abccdefghifgj9klmnopqrstZ uZ[vwxyz{y|}fg~Z€Zyz‚ƒ„Xde…† ‡ ˆ ‰ Š ‹ Œ  Ž   ‘ ’ “ ” • – — ˜Z™ š›œžŸ ĄZĸŖ¤moto-0.0.3-inplace Moto.RegistryMoto Moto.File Moto.InternalnewAppendOnlyRegistrystorePipesProducer*migs Data.FoldablefoldlMMoto.Internal.Cli registryConf Err_CommitErr_Commit_CleanErr_Commit_Dirty Err_AbortErr_Abort_CleanErr_Abort_Dirty Err_PrepareErr_Prepare_DuplicateErr_Prepare_NotFoundErr_Prepare_DirtyErr_UpdateStateErr_UpdateState_DuplicateErr_UpdateState_NotFoundErr_UpdateState_CleanErr_UpdateState_DirtyRegistryregistry_stateregistry_prepareregistry_abortregistry_commitStateLog Log_Prepare Log_Commit Log_AbortMigIdunMigIdChangeModeNormalRecoveryStore store_save store_load store_deleteBackupMigGone Direction BackwardsForwardsDAGMigs directionmapStore emptyState updateStateOpts RegistryConfregistryConf_helpregistryConf_parseregistryConf_withgetOptsrun Err_Tainted$fExceptionErr_Tainted$fEqErr_Tainted$fShowErr_Tainted withRegistry$fFromJSONLogV1 $fToJSONLogV1Err_Run Err_Run_DirtyErr_CleanRegistry cleanRegistry Err_CleanRegistry_NotFoundInMigsErr_CleanRegistry_MigGoneErr_PlanmkPlanErr_Plan_TargetsNotFoundErr_Plan_HistoryUnknownErr_Plan_TargetImpossibleErr_Plan_TargetsGoneErr_MalformedLog Registrishbase Data.EitherLeft#di-df1-1.0.2-HsBAOd2laTLBeiVApDHjoWDi.Df1Df1DirtyCleanStatusPlanTargetUMigghc-prim GHC.TypesSymbolDAG_ ConstraintmigIdmigIdsopposite pimpBackup pimpStore pimpChange migId_sha1HexgetPlan state_statusstate_committedFoldableEither mkRegistrishtoposcontainers-0.6.0.1Data.Map.InternalMapData.Set.InternalSetIntGHC.Basememptypuresize logException$fFunctorBackupUGone lookupMigsGraphFormatTextGraphFormatDotopts_store_migIdsopts_cleanRegistry_withRegistryopts_cleanRegistry_dryRunopts_showRegistry_withRegistry!opts_checkMigrations_withRegistryopts_showMigrations_graphFormatopts_run_withRegistryopts_run_targetopts_run_dryRunSub_RunSub_ShowMigrationsSub_CheckMigrationsSub_ShowRegistrySub_CleanRegistrySub_DeleteRecoveryDataopts_subString renderPlanLogV1$aeson-1.3.1.1-IddRZG1y1M3Henz8aoaS4rData.Aeson.Types.ToJSONToJSONwithRegistryCustom"pipes-4.3.9-3bryvuuuiojDFN0hr7v2jY Pipes.CoreGHC.IO.Handle.LockhLock