a15ca501b8
# Conflicts: # starter/ent/runtime.go # starter/go.mod # starter/go.sum # starter/routes/routing.go
82 lines
2.6 KiB
Go
82 lines
2.6 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package migrate
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql/schema"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
var (
|
|
// GoogleAuthsColumns holds the columns for the "google_auths" table.
|
|
GoogleAuthsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeInt, Increment: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
{Name: "credentials", Type: field.TypeJSON},
|
|
{Name: "google_auth_user", Type: field.TypeInt},
|
|
}
|
|
// GoogleAuthsTable holds the schema information for the "google_auths" table.
|
|
GoogleAuthsTable = &schema.Table{
|
|
Name: "google_auths",
|
|
Columns: GoogleAuthsColumns,
|
|
PrimaryKey: []*schema.Column{GoogleAuthsColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "google_auths_users_user",
|
|
Columns: []*schema.Column{GoogleAuthsColumns[4]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
}
|
|
// TodosColumns holds the columns for the "todos" table.
|
|
TodosColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeInt, Increment: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
{Name: "title", Type: field.TypeString, Default: ""},
|
|
{Name: "completed", Type: field.TypeBool, Default: false},
|
|
{Name: "todo_user", Type: field.TypeInt, Nullable: true},
|
|
}
|
|
// TodosTable holds the schema information for the "todos" table.
|
|
TodosTable = &schema.Table{
|
|
Name: "todos",
|
|
Columns: TodosColumns,
|
|
PrimaryKey: []*schema.Column{TodosColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "todos_users_user",
|
|
Columns: []*schema.Column{TodosColumns[5]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.SetNull,
|
|
},
|
|
},
|
|
}
|
|
// UsersColumns holds the columns for the "users" table.
|
|
UsersColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeInt, Increment: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
{Name: "email", Type: field.TypeString, Unique: true},
|
|
{Name: "password_hash", Type: field.TypeString, Default: ""},
|
|
}
|
|
// UsersTable holds the schema information for the "users" table.
|
|
UsersTable = &schema.Table{
|
|
Name: "users",
|
|
Columns: UsersColumns,
|
|
PrimaryKey: []*schema.Column{UsersColumns[0]},
|
|
}
|
|
// Tables holds all the tables in the schema.
|
|
Tables = []*schema.Table{
|
|
GoogleAuthsTable,
|
|
TodosTable,
|
|
UsersTable,
|
|
}
|
|
)
|
|
|
|
func init() {
|
|
GoogleAuthsTable.ForeignKeys[0].RefTable = UsersTable
|
|
TodosTable.ForeignKeys[0].RefTable = UsersTable
|
|
}
|