Skip to content

Commit

Permalink
feat(migrator): deprecate unsupport feature (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
miyamo2 committed Jun 23, 2024
1 parent f1bacd7 commit 78f3a44
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ func (m Migrator) HasTable(dst interface{}) bool {
return false
}

// RenameTable See: [gorm.migrator.Migrator.RenameTable]
// Deprecated: DynamoDB does not possibly rename an existing table, so this operation is not supported.
//
// [gorm.migrator.Migrator.RenameTable]: https://pkg.go.dev/gorm.io/gorm/migrator#Migrator.RenameTable
func (m Migrator) RenameTable(oldName, newName interface{}) error {
return ErrDynmgrmAreNotSupported
}
Expand All @@ -184,22 +188,42 @@ func (m Migrator) TableType(dst interface{}) (gorm.TableType, error) {
return nil, ErrDynmgrmAreNotSupported
}

// AddColumn See: [gorm.migrator.Migrator.AddColumn]
// Deprecated: DynamoDB are schema less, so this operation is not supported.
//
// [gorm.migrator.Migrator.AlterColumn]: https://pkg.go.dev/gorm.io/gorm/migrator#Migrator.AddColumn
func (m Migrator) AddColumn(dst interface{}, field string) error {
return ErrDynmgrmAreNotSupported
}

// DropColumn See: [gorm.migrator.Migrator.DropColumn]
// Deprecated: DynamoDB are schema less, so this operation is not supported.
//
// [gorm.migrator.Migrator.DropColumn]: https://pkg.go.dev/gorm.io/gorm/migrator#Migrator.DropColumn
func (m Migrator) DropColumn(dst interface{}, field string) error {
return ErrDynmgrmAreNotSupported
}

// AlterColumn See: [gorm.migrator.Migrator.AlterColumn]
// Deprecated: DynamoDB are schema less, so this operation is not supported.
//
// [gorm.migrator.Migrator.AlterColumn]: https://pkg.go.dev/gorm.io/gorm/migrator#Migrator.AlterColumn
func (m Migrator) AlterColumn(dst interface{}, field string) error {
return ErrDynmgrmAreNotSupported
}

// MigrateColumn See: [gorm.migrator.Migrator.MigrateColumn]
// Deprecated: DynamoDB are schema less, so this operation is not supported.
//
// [gorm.migrator.Migrator.MigrateColumn]: https://pkg.go.dev/gorm.io/gorm/migrator#Migrator.MigrateColumn
func (m Migrator) MigrateColumn(dst interface{}, field *schema.Field, columnType gorm.ColumnType) error {
return ErrDynmgrmAreNotSupported
}

// MigrateColumnUnique See: [gorm.migrator.Migrator.MigrateColumnUnique]
// Deprecated: DynamoDB are schema less, so this operation is not supported.
//
// [gorm.migrator.Migrator.MigrateColumnUnique]: https://pkg.go.dev/gorm.io/gorm/migrator#Migrator.MigrateColumnUnique
func (m Migrator) MigrateColumnUnique(dst interface{}, field *schema.Field, columnType gorm.ColumnType) error {
return ErrDynmgrmAreNotSupported
}
Expand All @@ -208,6 +232,10 @@ func (m Migrator) HasColumn(dst interface{}, field string) bool {
return false
}

// RenameColumn See: [gorm.migrator.Migrator.RenameColumn]
// Deprecated: DynamoDB are schema less, so this operation is not supported.
//
// [gorm.migrator.Migrator.RenameColumn]: https://pkg.go.dev/gorm.io/gorm/migrator#Migrator.RenameColumn
func (m Migrator) RenameColumn(dst interface{}, oldName, field string) error {
return ErrDynmgrmAreNotSupported
}
Expand All @@ -216,22 +244,42 @@ func (m Migrator) ColumnTypes(dst interface{}) ([]gorm.ColumnType, error) {
return []gorm.ColumnType{}, ErrDynmgrmAreNotSupported
}

// CreateView See: [gorm.migrator.Migrator.CreateView]
// Deprecated: DynamoDB does not provide View feature, so this operation is not supported.
//
// [gorm.migrator.Migrator.CreateView]: https://pkg.go.dev/gorm.io/gorm/migrator#Migrator.CreateView
func (m Migrator) CreateView(name string, option gorm.ViewOption) error {
return ErrDynmgrmAreNotSupported
}

// DropView See: [gorm.migrator.Migrator.DropView]
// Deprecated: DynamoDB does not provide View feature, so this operation is not supported.
//
// [gorm.migrator.Migrator.DropView]: https://pkg.go.dev/gorm.io/gorm/migrator#Migrator.DropView
func (m Migrator) DropView(name string) error {
return ErrDynmgrmAreNotSupported
}

// CreateConstraint See: [gorm.migrator.Migrator.CreateConstraint]
// Deprecated: DynamoDB does not provide constraint feature, so this operation is not supported.
//
// [gorm.migrator.Migrator.CreateConstraint]: https://pkg.go.dev/gorm.io/gorm/migrator#Migrator.CreateConstraint
func (m Migrator) CreateConstraint(dst interface{}, name string) error {
return ErrDynmgrmAreNotSupported
}

// DropConstraint See: [gorm.migrator.Migrator.DropConstraint]
// Deprecated: DynamoDB does not provide constraint feature, so this operation is not supported.
//
// [gorm.migrator.Migrator.DropConstraint]: https://pkg.go.dev/gorm.io/gorm/migrator#Migrator.DropConstraint
func (m Migrator) DropConstraint(dst interface{}, name string) error {
return ErrDynmgrmAreNotSupported
}

// HasConstraint See: [gorm.migrator.Migrator.HasConstraint]
// Deprecated: DynamoDB does not provide constraint feature, so this operation is not supported.
//
// [gorm.migrator.Migrator.HasConstraint]: https://pkg.go.dev/gorm.io/gorm/migrator#Migrator.HasConstraint
func (m Migrator) HasConstraint(dst interface{}, name string) bool {
return false
}
Expand Down Expand Up @@ -316,6 +364,10 @@ func (m Migrator) HasIndex(dst interface{}, name string) bool {
return false
}

// RenameIndex See: [gorm.migrator.Migrator.RenameIndex]
// Deprecated: DynamoDB does not possibly rename an existing index, so this operation is not supported.
//
// [gorm.migrator.Migrator.RenameIndex]: https://pkg.go.dev/gorm.io/gorm/migrator#Migrator.RenameIndex
func (m Migrator) RenameIndex(dst interface{}, oldName, newName string) error {
return ErrDynmgrmAreNotSupported
}
Expand Down

0 comments on commit 78f3a44

Please sign in to comment.