Skip to content

Commit

Permalink
Make regexps adapt to newer error messages in SQLite 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
itswindtw committed Feb 19, 2014
1 parent 7c2768a commit 672de3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/sequel/adapters/shared/sqlite.rb
Expand Up @@ -332,10 +332,10 @@ def create_view_prefix_sql(name, options)
end

DATABASE_ERROR_REGEXPS = {
/(is|are) not unique\z/ => UniqueConstraintViolation,
/foreign key constraint failed\z/ => ForeignKeyConstraintViolation,
/(is|are) not unique\z|UNIQUE constraint failed: .+\z/ => UniqueConstraintViolation,
/foreign key constraint failed\z|FOREIGN KEY constraint failed\z/ => ForeignKeyConstraintViolation,
/\A(SQLITE ERROR 19 \(CONSTRAINT\) : )?constraint failed\z/ => ConstraintViolation,
/may not be NULL\z/ => NotNullConstraintViolation,
/may not be NULL\z|NOT NULL constraint failed: .+\z/ => NotNullConstraintViolation,
}.freeze
def database_error_regexps
DATABASE_ERROR_REGEXPS
Expand Down

0 comments on commit 672de3d

Please sign in to comment.