refactor schema edges

This commit is contained in:
Hayden 2023-03-06 11:43:56 -09:00
parent ccd40ffcac
commit 883468e04c
No known key found for this signature in database
GPG key ID: 17CF79474E257545
12 changed files with 499 additions and 460 deletions

View file

@ -17,29 +17,22 @@ const (
FieldCreatedAt = "created_at"
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
FieldUpdatedAt = "updated_at"
// FieldUserID holds the string denoting the user_id field in the database.
FieldUserID = "user_id"
// FieldGroupID holds the string denoting the group_id field in the database.
FieldGroupID = "group_id"
// FieldUserID holds the string denoting the user_id field in the database.
FieldUserID = "user_id"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldURL holds the string denoting the url field in the database.
FieldURL = "url"
// FieldIsActive holds the string denoting the is_active field in the database.
FieldIsActive = "is_active"
// EdgeUser holds the string denoting the user edge name in mutations.
EdgeUser = "user"
// EdgeGroup holds the string denoting the group edge name in mutations.
EdgeGroup = "group"
// EdgeUser holds the string denoting the user edge name in mutations.
EdgeUser = "user"
// Table holds the table name of the notifier in the database.
Table = "notifiers"
// UserTable is the table that holds the user relation/edge.
UserTable = "notifiers"
// UserInverseTable is the table name for the User entity.
// It exists in this package in order to avoid circular dependency with the "user" package.
UserInverseTable = "users"
// UserColumn is the table column denoting the user relation/edge.
UserColumn = "user_id"
// GroupTable is the table that holds the group relation/edge.
GroupTable = "notifiers"
// GroupInverseTable is the table name for the Group entity.
@ -47,6 +40,13 @@ const (
GroupInverseTable = "groups"
// GroupColumn is the table column denoting the group relation/edge.
GroupColumn = "group_id"
// UserTable is the table that holds the user relation/edge.
UserTable = "notifiers"
// UserInverseTable is the table name for the User entity.
// It exists in this package in order to avoid circular dependency with the "user" package.
UserInverseTable = "users"
// UserColumn is the table column denoting the user relation/edge.
UserColumn = "user_id"
)
// Columns holds all SQL columns for notifier fields.
@ -54,8 +54,8 @@ var Columns = []string{
FieldID,
FieldCreatedAt,
FieldUpdatedAt,
FieldUserID,
FieldGroupID,
FieldUserID,
FieldName,
FieldURL,
FieldIsActive,