Skip to content

Commit

Permalink
Update type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuk09 committed Jan 8, 2024
1 parent 0061ca6 commit a071c9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/sequel_data/migrate/migrator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize(config)
end

def migrate
connect_to_db do |db|
connect_database do |db|
dataset = ensure_table_exists(db)

already_migrated = dataset.select_map(column).to_set
Expand All @@ -32,7 +32,7 @@ def migrate
end

def rollback(step = 1)
connect_to_db do |db|
connect_database do |db|
dataset = ensure_table_exists(db)

already_migrated = dataset.select_map(column).to_set
Expand Down Expand Up @@ -65,7 +65,7 @@ def table
:data_migrations
end

def connect_to_db(&block)
def connect_database(&block)
raise ConfigurationError, "db_configuration is not set" if config.db_configuration.host.nil?

Sequel.connect(config.db_configuration.host, &block)
Expand Down
2 changes: 1 addition & 1 deletion sig/sequel_data/migrate.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module SequelData
attr_reader config: untyped
def column: -> :version
def table: -> :data_migrations
def connect_database: -> untyped
def connect_database: () { (untyped db) -> void } -> untyped
def ensure_table_exists: (untyped db) -> untyped
def fetch_migration_files: -> Array[String]
def load_migration_file: (String file) -> untyped
Expand Down

0 comments on commit a071c9d

Please sign in to comment.