Currently we have the following attributes and their properties
related to upgrade:
- [Recycled]
- [Field(bool NullableOnUpgrade)]
- [Field(object DefaultValue)]
Also, there are rename
Obviously, that's bad that upgrade related stuff isn't separated. So I suggest
to add a set of [XxxUpgrade] attributes:
1. [TypeUpgrade(
string OldName, // RenameTypeHint
string[] RemovedFields, // RemoveFieldHint
bool RemoveAfterUpgrade, // [Recycled], = UpgradeTypeHint (new)
type MergeIntoAfterUpgrade)] // MergeTypeHint (new)
2. [FieldUpgrade(
string OldName, // RenameFieldHint, CopyFieldHint
string OldType, // RenameFieldHint, CopyFieldHint
bool Copy, // RenameFieldHint or CopyFieldHint
bool ChangeType, ChangeFieldTypeHint
bool RemoveAfterUpgrade, // [Recycled], = UpgradeFieldHint (new)
bool NullableOnUpgrade, // UpgradeFieldHint (new)
bool NoForeignKeyOnUpgrade, // UpgradeFieldHint (new)
object DefaultValue)] // UpgradeFieldHint (new)
2. [IndexUpgrade(
string Name, // We must reference the index
bool RemoveAfterUpgrade, // UpgradeIndexHint (new)
bool RemoveOnUpgrade)], // UpgradeIndexHint (new)
Pros:
- This stuff will allow developers to use attributes instead of upgrade hints
- Some new features are integrated pretty well here.
Cons:
- None. Upgrade hints will still be available ;)
Original issue reported on code.google.com by alex.yakunin on 25 Nov 2010 at 9:29
Original issue reported on code.google.com by
alex.yakunin
on 25 Nov 2010 at 9:29