-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite: Use versions and branches to control the public and private …
…status of the article. Happy Lantern Festiva🎉🎉🎉. see ##1
- Loading branch information
Showing
16 changed files
with
60 additions
and
484 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package schema | ||
|
||
import ( | ||
"github.com/facebook/ent" | ||
"github.com/facebook/ent/schema/edge" | ||
"github.com/facebook/ent/schema/field" | ||
) | ||
|
||
// Draft holds the schema definition for the Draft entity. | ||
type Draft struct { | ||
ent.Schema | ||
} | ||
|
||
// Fields of the Draft. | ||
func (Draft) Fields() []ent.Field { | ||
return []ent.Field{ | ||
field.Enum("status").Values("read", "write").Default("write"), | ||
} | ||
} | ||
|
||
// Edges of the Draft. | ||
func (Draft) Edges() []ent.Edge { | ||
return []ent.Edge{ | ||
edge.To("snapshots", Content.Type), | ||
edge.From("user", User.Type).Ref("drafts").Unique().Required(), | ||
edge.From("article", Article.Type).Ref("branches").Unique().Required(), | ||
} | ||
} |
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
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.