mirror of
https://github.com/glebarez/sqlite.git
synced 2025-10-04 07:16:23 +08:00
fix: more explicit error when using sqlite driver with at least one constraint
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
This commit is contained in:
7
errors.go
Normal file
7
errors.go
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package sqlite
|
||||||
|
|
||||||
|
import "errors"
|
||||||
|
|
||||||
|
var (
|
||||||
|
ErrConstraintsNotImplemented = errors.New("constraints not implemented on sqlite, consider using DisableForeignKeyConstraintWhenMigrating, more details https://github.com/go-gorm/gorm/wiki/GORM-V2-Release-Note-Draft#all-new-migrator")
|
||||||
|
)
|
@@ -149,11 +149,11 @@ func (m Migrator) DropColumn(value interface{}, name string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m Migrator) CreateConstraint(interface{}, string) error {
|
func (m Migrator) CreateConstraint(interface{}, string) error {
|
||||||
return gorm.ErrNotImplemented
|
return ErrConstraintsNotImplemented
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m Migrator) DropConstraint(interface{}, string) error {
|
func (m Migrator) DropConstraint(interface{}, string) error {
|
||||||
return gorm.ErrNotImplemented
|
return ErrConstraintsNotImplemented
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m Migrator) HasConstraint(value interface{}, name string) bool {
|
func (m Migrator) HasConstraint(value interface{}, name string) bool {
|
||||||
|
Reference in New Issue
Block a user