Skip to content

Commit

Permalink
feat: version column is BIGINT now
Browse files Browse the repository at this point in the history
  • Loading branch information
vladfaust committed Jan 28, 2018
1 parent fda0400 commit b1e2c8a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/migrate/migrator.cr
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ module Migrate
# Return a sorted array of versions extracted from filenames in migrations dir. Contains 0 version which means no migrations.
protected def all_versions
migrations.map do |filename|
MIGRATION_FILE_REGEX.match(filename).not_nil!["version"].to_i
end.unshift(0)
MIGRATION_FILE_REGEX.match(filename).not_nil!["version"].to_i64
end.unshift(0i64)
end

# Return sorted array of migration file names.
Expand All @@ -164,8 +164,8 @@ module Migrate
end
end

private CREATE_TABLE_SQL = <<-SQL
CREATE TABLE IF NOT EXISTS %{table} (%{column} INT NOT NULL)
private CREATE_VERSION_TABLE_SQL = <<-SQL
CREATE TABLE IF NOT EXISTS %{table} (%{column} BIGINT NOT NULL)
SQL

private COUNT_ROWS_SQL = <<-SQL
Expand All @@ -177,7 +177,7 @@ module Migrate
SQL

protected def ensure_version_table_exist
table_query = CREATE_TABLE_SQL % {
table_query = CREATE_VERSION_TABLE_SQL % {
table: @table,
column: @column,
}
Expand Down

0 comments on commit b1e2c8a

Please sign in to comment.