2020-12-31 03:37:32 +05:30
|
|
|
package schema
|
|
|
|
|
|
|
|
import (
|
2021-03-24 12:07:51 +05:30
|
|
|
"entgo.io/ent"
|
|
|
|
"entgo.io/ent/schema/field"
|
2020-12-31 03:37:32 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
/* Original SQL table:
|
|
|
|
create table connector
|
|
|
|
(
|
|
|
|
id text not null primary key,
|
|
|
|
type text not null,
|
|
|
|
name text not null,
|
|
|
|
resource_version text not null,
|
|
|
|
config blob
|
|
|
|
);
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Connector holds the schema definition for the Client entity.
|
|
|
|
type Connector struct {
|
|
|
|
ent.Schema
|
|
|
|
}
|
|
|
|
|
|
|
|
// Fields of the Connector.
|
|
|
|
func (Connector) Fields() []ent.Field {
|
|
|
|
return []ent.Field{
|
|
|
|
field.Text("id").
|
|
|
|
SchemaType(textSchema).
|
2021-09-13 19:18:02 +05:30
|
|
|
MaxLen(100).
|
2020-12-31 03:37:32 +05:30
|
|
|
NotEmpty().
|
|
|
|
Unique(),
|
|
|
|
field.Text("type").
|
|
|
|
SchemaType(textSchema).
|
|
|
|
NotEmpty(),
|
|
|
|
field.Text("name").
|
|
|
|
SchemaType(textSchema).
|
|
|
|
NotEmpty(),
|
|
|
|
field.Text("resource_version").
|
|
|
|
SchemaType(textSchema),
|
|
|
|
field.Bytes("config"),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Edges of the Connector.
|
|
|
|
func (Connector) Edges() []ent.Edge {
|
|
|
|
return []ent.Edge{}
|
|
|
|
}
|