úÎēģĐmĪ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢ None !"#$%&*,/59:;<=DIOQRT[bf:Data type of a migration, with its key, type, and actions.LSchema for the migration to run in, which also qualifies the migration key."ĪUnique key to identify this migration among all known migrations. Never reuse keys, as they're the only link between the stored migration log and known migrations.What type of migration this is.POptional action to execute before the primary execution to verify preconditions.@Main migration action, such as creating tables or updating data.{Constraint for actions run in the context of a migration, with access to underlying IO, PostgreSQL connection, and logging.;Enumeration of the types of migration that are known about.OMigration that updates the schema of the database and should be run everywhere.dMigration that installs or replaces data for testing purposes and should never be run in production.EStructure with connection information for connecting to the database.0Hostname or IP address of the PostgreSQL server.9Port number the PostgreSQL server is running on (usually 5432).(What user to connect to the database as. .What password to connect to the database with.!4What database in the PostgreSQL server to attach to.ĪGiven a  generate the connection string pairs that are shared between the loggable and real version, that is all of them except password.Ĩ+Given a list of key/value pairs, make up a key1=value1 key2=value2 string that PostgreSQL expects."Given a r make up the real connection string to pass when connecting to the database. Includes password, so never log this.#Given a T make up the log-safe connection string to show to humans, which omits the password.$4The fully qualified key of the migration, schema.key,Helper to construct a  type 5 with the given execution action and no check action.-Helper to construct a  type 5 with the given execution action and no check action..Attach a check function to a . !ĪĨ"#$'()*+,-.! "#$'()*+,-. !"#*)+'($,-. !ĪĨ"#$'()*+,-.None !"#$%&*,/59:;<=DIOQRT[bf/[Simple quasiquoter which just makes it easier to embed literal chunks of SQL in migrations. For example: Į createStuffIndex :: MonadMigration m => m () createStuffIndex = execute_ [qqSql| create index stuff_index on stuff (things) where is_what_we_want_to_index = t |] 0NQuasiquoter which takes a block of literal SQL and converts it into a list of Ķ values, e.g. to pass to 4\. A semicolon at the beginning or end of a line (sans whitespace) separates SQL statements. For example: É createStuff :: MonadMigration m => m () createStuff = executeSeries_ [qqSqls| create sequence stuff_seq; create table stuff ( id bigint not null primary key default nextval( stuff_seq) ); |] 1GExecute some parameterized SQL against the database connection. Wraps § using the  reader to get the connection.2GExecute some parameterized SQL against the database connection. Wraps Ļ using the  reader to get the connection.3?Execute some fixed SQL against the database connection. Wraps Đ using the  reader to get the connection.4vExecute a series of fixed SQL statements against the database connection. Equivalent to `traverse_ (void . execute_)`5BRun a parameterized query against the database connection. Wraps Š using the  reader to get the connection.6:Run a fixed query against the database connection. Wraps Ŧ using the  reader to get the connection.7=Run an Opaleye query against the database connection. Wraps Ž using the  reader to get the connection.8Run an Opaleye ­! against the database connection.9Run an Opaleye Ū! against the database connection.:Run an Opaleye Ŋ! against the database connection.;#Check if a schema exists using the information_schema views.<.Check if a table exists in a schema using the information_schema views./0123456789:;</0123456789:;</0123456789:;</0123456789:;<None !"#$%&*,/59:;<=DIOQRT[bf =9Result of running a migration, either success or failure.F,Columns of the Refurb config in the databaseG%Fields of the Refurb config in memoryHUColumns of a migration log when inserting into the database (with ID column optional)ICColumns of a migration log when reading from the database (with ID)JWFields of a migration log entry to insert in the database (with the ID column optional)KMFields of a migration log entry in memory fetched from the database (with ID)lOThe migration log table which records all executed migrations and their resultsmbThe refurb config table which controls whether this database is considered a production one or notn^Test to see if the schema seems to be installed by looking for an existing refurb_config tableo`Check if this database is configured as a production database by reading the refurb config tablepCCreate the refurb schema elements. Will fail if they already exist.q“Read the migration log and stitch it together with the expected migration list, forming a list in the same order as the known migrations but with °R representing whether the migration log for the known migration is present or not.ą migration4 represents a known migration that has no log entry.ē migrationLog> represents an unknown migration that was applied in the past.° migration migrationLogE represents a migration that has an attempted application in the log.A =>?BCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopq@ =>?BFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqC=>?BCCC kjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFlmnopq? =>?BCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqNone !"#$%&*,/59:;<=DIOQRT[bfr@Structure holding the parsed command line arguments and options.t/Whether to turn on debug logging to the consoleu"Whether to colorize console outputvWThe configuration file where (presumably) the database connection information is storedw=Which command the user chose and the options for that commandx@The various top level commands that can be requested by the usery^Migrate the database or show what migrations would be applied, possibly backing up beforehand.zShow the migration status.{:Show status of a particular migration with its log output.|Back up the database.}Newtype wrapper for the --seed boolean (True if given, False if omitted)Newtype wrapper for the --backup-first option to the migrate command.Newtype wrapper for the  --execute boolean (True if given, False if omitted)ƒOption parser for the migrate command„Option parser for the show-log command…Option parser for the show-migration command†Option parser for the backup command‡%Parser for the command line argumentsrstuvwxyz{|}~€‚ƒ„…†‡rswtvuxyz{|}~€‚ƒ„…†‡‚€}~xyz{|ƒ„…†rstuvw‡ rstuvwxyz{|}~€‚ƒ„…†‡None !"#$%&*,/59:;<=DIOQRT[bf EConstraint of actions for command execution, including access to the ‘, logging, and underlying IO.‘—Reader context for all command execution which contains the command line options, database connection and connection information, and known migrations.“The r+ structure parsed from the command line by  Refurb.Cli.”The open database ģ.•^The information used to connect to the database, required for running command line tools like pg_dump against the same database.–"The known migrations passed in to  .—0Given the configuration implicitly available to D, produce a function which possibly strips ANSI colorization from a ī) if the user requested colorless output.˜0Given the configuration implicitly available to #, produce a function which emits a īG on stdout that is colored unless the user requested colorless output.™Produce a colorized ī with success or failure, based on which = value was passed. ‘’“”•–—˜™ ‘’•”–“—˜™ ‘’“”•–—˜™‘’“”•–—˜™None !"#$%&*,/59:;<=DIOQRT[bfš Handle the backup command by calling pg_dump to save a database backup.ššššNone !"#$%&*,/59:;<=DIOQRT[bf›$Given a migration status as read by q5, pretty print that information as a table on stdout.œImplement the show-logD command by reading the entire migration log and displaying it with ›.Implement the show-migration_ command by reading migration log pertaining to the given migration key and displaying it with › plus its log output.›œ›œ›œ›œNone !"#$%&*,/59:;<=DIOQRT[bfž*Helper which produces the standard prefix ī for a given migration: migration key:  with color.ŸImplement the migrateč command by verifying that seed data is only applied to non-production databases, reading the migration status, and determining from that status which migrations to apply. If the user requested execution of migrations, delegate to   to actually do the work. Given a pre-vetted list of ˜ structures to apply to the database, iterate through them and run their check actions (if any) followed by execution actions with log output captured.Ą Format a ĩ) in the way we want for logging output - #package:module filename:line:columnĒEFormat the current timestamp in the way we want for logging output - yyyy-mm-dd hh:mm:ss.SSSžŸ ĄĒžŸ ĄĒžŸ ĄĒžŸ ĄĒ None !"#$%&*,/59:;<=DIOQRT[bfĢ"Main entry point for refurbishing.In .refurb readDatabaseConnectionString migrations, readDatabaseConnectionStringŒ is a function taking the configuration file path from the command line and yielding a pair of actual and loggable connection strings, and  migrations is a list of  records to consider. For example: & module Main where import Refurb (, , 3, , , refurbMain) migrations :: [ĸ] migrations = [ schemaMigration "create-my-table" createMyTable ] createMyTable :: MonadMigration m => m () createMyTable = void $ execute_ "create table my_table (...)" main :: IO () main = refurbMain readDatabaseConnInfo migrations Ģ,! "#$'()*+,-./0123456789:;<ĢĢĢķ    !"#$%%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{{|}~€‚ƒ„……††‡‡ˆ‰Š‹ŒŽ‘’“”•––—˜™š›œžŸ ĄĒĢĪĨĶ §ĻĐŠŦĐŽ:ĐŽ;Đ­<ĐŽ>ĐŽ?ŪŊ@Ū°AŪ°BŪ°CąēģąēīąēĩĐ­ķ·ļđšŧž―%refurb-0.2.2.0-GRwVaOKLjZhDyO3SV3QNz8 Refurb.Store Refurb.TypesRefurb.MigrationUtils Refurb.CliRefurb.Run.InternalRefurb.Run.BackupRefurb.Run.InfoRefurb.Run.MigrateRefurb refurbMainFIdFIdMayCIdCIdMay FQualifiedKey CQualifiedKeyFAppliedCAppliedFOutputCOutputFResultCResult FDuration CDuration FProdSystem CProdSystem Migration_migrationSchema _migrationKey_migrationType_migrationCheck_migrationExecuteMonadMigration MigrationTypeMigrationSchemaMigrationSeedDataConnInfoconnHostconnPortconnUser connPassword connDbNameconnInfoAsConnStringconnInfoAsLogStringmigrationQualifiedKey$fEqMigrationType$fShowMigrationTypemigrationCheckmigrationExecute migrationKeymigrationSchema migrationTypeschemaMigrationseedDataMigration withCheckqqSqlqqSqlsexecute executeManyexecute_executeSeries_queryquery_runQuery runInsertMany runUpdate runDeletedoesSchemaExistdoesTableExistMigrationResultMigrationSuccessMigrationFailure$fEqMigrationResult$fShowMigrationResultPGMigrationResult&$fDefaultConstantMigrationResultColumn:$fQueryRunnerColumnDefaultPGMigrationResultMigrationResult$fFromFieldMigrationResultRefurbConfigCols RefurbConfigMigrationLogColsWMigrationLogColsR MigrationLogW MigrationLogfId_fIdMay_cId_cIdMay_fQualifiedKey_cQualifiedKey_ fApplied_ cApplied_fOutput_cOutput_fResult_cResult_ fDuration_ cDuration_ fProdSystem_ cProdSystem_fIdfIdMaycIdcIdMay fQualifiedKey cQualifiedKeyfAppliedcAppliedfOutputcOutputfResultcResult fDuration cDuration fProdSystem cProdSystem migrationLog refurbConfigisSchemaPresent isProdSysteminitializeSchemareadMigrationStatusOptsdebugcolorize configFilecommandCommandCommandMigrateCommandShowLogCommandShowMigration CommandBackupInstallSeedDataPreMigrationBackupGoNoGocommandMigrateParsercommandShowLogParsercommandShowMigrationParsercommandBackupParser optsParser $fEqGoNoGo $fShowGoNoGo$fEqPreMigrationBackup$fShowPreMigrationBackup$fEqInstallSeedData$fShowInstallSeedData $fEqCommand $fShowCommand MonadRefurbContextcontextOptions contextDbConncontextDbConnInfocontextMigrationsoptionallyColorMoptionallyColoredMmigrationResultDocbackupshowMigrationStatusshowLog showMigrationmigrationPrefixDocmigrateapplyMigrations locLogString nowLogString commonParams asConnString0postgresql-simple-0.5.2.1-6oRsIsDLhC4LPVmmueKcJJ Database.PostgreSQL.Simple.TypesQueryDatabase.PostgreSQL.Simple#Database.PostgreSQL.Simple.Internal&opaleye-0.5.3.0-8R1WUb0Leyi7tZlIcB1XrPOpaleye.RunQueryOpaleye.Manipulation"these-0.7.3-4ZjSwqC34Du526IiqZONmh Data.TheseTheseThisThat Connection,ansi-wl-pprint-0.6.7.3-EqhsHSbxOT2xFHZZJCFwfText.PrettyPrint.ANSI.LeijenDoctemplate-haskellLanguage.Haskell.TH.SyntaxLoc