Last active
September 2, 2019 20:22
-
-
Save calebkleveter/e5b7384f967edf1185f82fdef866aef4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Property { | |
final class Model: FluentKit.Model, AutoMigrating { | |
static let schema: String = "properties" | |
@FluentKit.ID(key: "id") var id: UUID? | |
@Parent(key: "preset") var preset: PropertyPreset.Model | |
// These are the ploymorphic properties that connect a given `Property` model row | |
// to any other model row. If we only want the parent to have a single `Property`, we | |
// can mark the `parent` field as `UINIQUE`. | |
@Field(key: "parent") var parent: UUID? | |
@Field(key: "parent_type") var parentType: String? | |
// Other properties go here... | |
@Field(key: "key") var key: String | |
@Field(key: "value") var value: PropertyValue<Property> | |
init() { } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment