Skip to content

Commit

Permalink
Fixed a type-safety issue with DatabaseSchema (removed IsString insta…
Browse files Browse the repository at this point in the history
…nce)
  • Loading branch information
LaurentRDC committed Oct 8, 2024
1 parent 5a29df2 commit ed6b95c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions beam-migrate/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.5.3.1

## Bug fixes

* Removed the `IsString` instance for `DatabaseSchema`, which allowed for the use of database schemas that did not exist.

# 0.5.3.0

## Added features
Expand Down
7 changes: 3 additions & 4 deletions beam-migrate/Database/Beam/Migrate/SQL/Tables.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module Database.Beam.Migrate.SQL.Tables
, addColumn, dropColumn

-- * Schema manipulation
, DatabaseSchema(..), createDatabaseSchema, dropDatabaseSchema, existingDatabaseSchema
, DatabaseSchema(databaseSchemaName), createDatabaseSchema, dropDatabaseSchema, existingDatabaseSchema

-- * Field specification
, DefaultValue, Constraint(..), NotNullConstraint
Expand Down Expand Up @@ -55,7 +55,6 @@ import Control.Monad.State

import Data.Coerce (coerce)
import Data.Kind (Type)
import Data.String (IsString)
import Data.Text (Text)
import Data.Typeable
import qualified Data.Kind as Kind (Constraint)
Expand Down Expand Up @@ -85,8 +84,8 @@ createTable = createTableWithSchema Nothing
-- | Represents a database schema. To create one, see 'createDatabaseSchema';
-- to materialize one, see 'existingDatabaseSchema'.
newtype DatabaseSchema
= DatabaseSchema Text
deriving (Eq, Show, IsString)
= DatabaseSchema{databaseSchemaName :: Text}
deriving (Eq, Show)

-- | Add a @CREATE SCHEMA@ statement to this migration
--
Expand Down
2 changes: 1 addition & 1 deletion beam-migrate/beam-migrate.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: beam-migrate
version: 0.5.3.0
version: 0.5.3.1
synopsis: SQL DDL support and migrations support library for Beam
description: This package provides type classes to allow backends to implement
SQL DDL support for beam. This allows you to use beam syntax to
Expand Down

0 comments on commit ed6b95c

Please sign in to comment.