Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add versioning to lhm-shopify methods #283

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions rbi/annotations/lhm-shopify.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,14 @@ class Lhm::Migrator
sig { params(table: Lhm::Table, connection: T.nilable(Lhm::Connection)).void }
def initialize(table, connection = nil); end

# @version <= 4.2.1
sig { params(name: T.any(String, Symbol), definition: T.any(String, Symbol)).void }
def add_column(name, definition); end

# @version >= 4.2.2
sig { params(name: T.any(String, Symbol), definition: T.any(String, Symbol), algorithm: T.nilable(String)).void }
def add_column(name, definition, algorithm: T.unsafe(nil)); end

sig do
params(
columns: T.any(String, Symbol, T::Array[T.any(String, Symbol)]),
Expand All @@ -131,15 +136,25 @@ class Lhm::Migrator
sig { params(name: T.any(String, Symbol), definition: T.any(String, Symbol)).void }
def change_column(name, definition); end

# @version <= 4.2.1
sig { params(statement: String).void }
def ddl(statement); end

# @version >= 4.2.2
sig { params(statement: String, algorithm: T.nilable(String)).void }
def ddl(statement, algorithm: T.unsafe(nil)); end

sig { params(sql: String).returns(String) }
def filter(sql); end

# @version <= 4.2.1
sig { params(name: T.any(String, Symbol)).void }
def remove_column(name); end

# @version >= 4.2.2
sig { params(name: T.any(String, Symbol), algorithm: T.nilable(String)).void }
def remove_column(name, algorithm: T.unsafe(nil)); end

sig do
params(
columns: T.any(String, Symbol, T::Array[T.any(String, Symbol)]),
Expand All @@ -148,8 +163,13 @@ class Lhm::Migrator
end
def remove_index(columns, index_name = nil); end

# @version <= 4.2.1
sig { params(old: T.any(String, Symbol), nu: T.any(String, Symbol)).void }
def rename_column(old, nu); end

# @version >= 4.2.2
sig { params(old: T.any(String, Symbol), nu: T.any(String, Symbol), algorithm: T.nilable(String)).void }
def rename_column(old, nu, algorithm: T.unsafe(nil)); end
end

module Lhm::Throttler
Expand Down
Loading