Skip to content

Commit 78f3a44

Browse files
authored
feat(migrator): deprecate unsupport feature (#132)
1 parent f1bacd7 commit 78f3a44

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

migrator.go

+52
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ func (m Migrator) HasTable(dst interface{}) bool {
172172
return false
173173
}
174174

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

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

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

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

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

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

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

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

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

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

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

279+
// HasConstraint See: [gorm.migrator.Migrator.HasConstraint]
280+
// Deprecated: DynamoDB does not provide constraint feature, so this operation is not supported.
281+
//
282+
// [gorm.migrator.Migrator.HasConstraint]: https://pkg.go.dev/gorm.io/gorm/migrator#Migrator.HasConstraint
235283
func (m Migrator) HasConstraint(dst interface{}, name string) bool {
236284
return false
237285
}
@@ -316,6 +364,10 @@ func (m Migrator) HasIndex(dst interface{}, name string) bool {
316364
return false
317365
}
318366

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

0 commit comments

Comments
 (0)