mirror of
https://github.com/ent/ent.git
synced 2026-04-29 14:10:55 +03:00
go: rename module from github.com/facebook/ent => entgo.io/ent (#1226)
This commit is contained in:
@@ -20,11 +20,11 @@ and maintain applications with large data-models and sticks with the following p
|
||||
## Installation
|
||||
|
||||
```console
|
||||
go get github.com/facebook/ent/cmd/ent
|
||||
go get entgo.io/ent/cmd/ent
|
||||
```
|
||||
|
||||
After installing `ent` codegen tool, you should have it in your `PATH`.
|
||||
If you don't find it your path, you can also run: `go run github.com/facebook/ent/cmd/ent <command>`
|
||||
If you don't find it your path, you can also run: `go run entgo.io/ent/cmd/ent <command>`
|
||||
|
||||
## Setup A Go Environment
|
||||
|
||||
@@ -49,7 +49,7 @@ The command above will generate the schema for `User` under `<project>/ent/schem
|
||||
|
||||
package schema
|
||||
|
||||
import "github.com/facebook/ent"
|
||||
import "entgo.io/ent"
|
||||
|
||||
// User holds the schema definition for the User entity.
|
||||
type User struct {
|
||||
@@ -74,8 +74,8 @@ Add 2 fields to the `User` schema:
|
||||
package schema
|
||||
|
||||
import (
|
||||
"github.com/facebook/ent"
|
||||
"github.com/facebook/ent/schema/field"
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ Let's create 2 additional entities named `Car` and `Group` with a few fields. We
|
||||
to generate the initial schemas:
|
||||
|
||||
```console
|
||||
go run github.com/facebook/ent/cmd/ent init Car Group
|
||||
go run entgo.io/ent/cmd/ent init Car Group
|
||||
```
|
||||
|
||||
And then we add the rest of the fields manually:
|
||||
@@ -213,8 +213,8 @@ And then we add the rest of the fields manually:
|
||||
import (
|
||||
"regexp"
|
||||
|
||||
"github.com/facebook/ent"
|
||||
"github.com/facebook/ent/schema/field"
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
// Fields of the Car.
|
||||
@@ -247,8 +247,8 @@ Let's add the `"cars"` edge to the `User` schema, and run `go generate ./ent`:
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/facebook/ent"
|
||||
"github.com/facebook/ent/schema/edge"
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/edge"
|
||||
)
|
||||
|
||||
// Edges of the User.
|
||||
@@ -342,8 +342,8 @@ in the `User` schema, and run `go generate ./ent`.
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/facebook/ent"
|
||||
"github.com/facebook/ent/schema/edge"
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/edge"
|
||||
)
|
||||
|
||||
// Edges of the Car.
|
||||
@@ -403,8 +403,8 @@ relationship named `groups`. Let's define this relationship in our schemas:
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/facebook/ent"
|
||||
"github.com/facebook/ent/schema/edge"
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/edge"
|
||||
)
|
||||
|
||||
// Edges of the Group.
|
||||
@@ -420,8 +420,8 @@ relationship named `groups`. Let's define this relationship in our schemas:
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/facebook/ent"
|
||||
"github.com/facebook/ent/schema/edge"
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/edge"
|
||||
)
|
||||
|
||||
// Edges of the User.
|
||||
@@ -610,4 +610,4 @@ Now when we have a graph with data, we can run a few queries on it:
|
||||
}
|
||||
```
|
||||
|
||||
The full example exists in [GitHub](https://github.com/facebook/ent/tree/master/examples/start).
|
||||
The full example exists in [GitHub](https://entgo.io/ent/tree/master/examples/start).
|
||||
|
||||
Reference in New Issue
Block a user