View Source Polyn.Migration.Migrator (Polyn v0.6.1)
Manages the creation and updating of streams and consumers that an application owns
Link to this section Summary
Types
:migrations_dir
- Location of migration files:running_migration_id
- The timestamp/id of the migration file being run. Taken from the beginning of the file name:migration_bucket_info
- The Stream info for the migration KV bucket:runner
- Process for keeping commands to run:migration_files
- The file names of migration files:migration_modules
- A list of tuples with the migration id and module code:already_run_migrations
- Migrations we've determined have already been executed on the server:commands
- list of tuples with {migration_id, command_name, command_options}
Link to this section Types
@type t() :: %Polyn.Migration.Migrator{ already_run_migrations: [binary()], commands: [{integer(), atom(), any()}], migration_bucket_info: Jetstream.API.Stream.info() | nil, migration_files: [binary()], migration_modules: [{integer(), module()}], migrations_dir: binary(), runner: pid() | nil, running_migration_id: non_neg_integer() | nil }
:migrations_dir
- Location of migration files:running_migration_id
- The timestamp/id of the migration file being run. Taken from the beginning of the file name:migration_bucket_info
- The Stream info for the migration KV bucket:runner
- Process for keeping commands to run:migration_files
- The file names of migration files:migration_modules
- A list of tuples with the migration id and module code:already_run_migrations
- Migrations we've determined have already been executed on the server:commands
- list of tuples with {migration_id, command_name, command_options}
Link to this section Functions
Path of migration files
@spec run(opts :: [{:migrations_dir, binary()}]) :: :ok
Entry point for starting migrations