Skip to content

Commit

Permalink
Added MariaDB
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Mar 11, 2024
1 parent 16a55b5 commit f149329
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Postgres-specific checks:
- [setting NOT NULL on an existing column](#setting-not-null-on-an-existing-column)
- [adding a column with a default value](#adding-a-column-with-a-default-value)

MySQL-specific checks:
MySQL/MariaDB-specific checks:

- [adding an AUTO_INCREMENT column](#adding-an-auto-increment-column) [unreleased]

Expand Down Expand Up @@ -674,7 +674,7 @@ Then [backfill the data](#backfilling-data).

#### Bad

In MySQL, adding an `AUTO_INCREMENT` column blocks writes while the entire table is rewritten.
In MySQL and MariaDB, adding an `AUTO_INCREMENT` column blocks writes while the entire table is rewritten.

```ruby
class AddIdToCitiesUsers < ActiveRecord::Migration[7.1]
Expand Down
2 changes: 1 addition & 1 deletion lib/strong_migrations/checks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def check_add_column(*args)
raise_error :add_column_generated_stored, rewrite_blocks: adapter.rewrite_blocks
end

if type.to_s == "primary_key" && mysql?
if type.to_s == "primary_key" && (mysql? || mariadb?)
raise_error :add_column_primary_key, rewrite_blocks: adapter.rewrite_blocks
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/add_column_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def test_generated_virtual
end

def test_primary_key
skip unless mysql?
skip unless mysql? || mariadb?
assert_unsafe AddColumnPrimaryKey
end
end

0 comments on commit f149329

Please sign in to comment.