Add first google auth
This commit is contained in:
@@ -8,6 +8,28 @@ import (
|
||||
)
|
||||
|
||||
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,
|
||||
},
|
||||
},
|
||||
}
|
||||
// UsersColumns holds the columns for the "users" table.
|
||||
UsersColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeInt, Increment: true},
|
||||
@@ -24,9 +46,11 @@ var (
|
||||
}
|
||||
// Tables holds all the tables in the schema.
|
||||
Tables = []*schema.Table{
|
||||
GoogleAuthsTable,
|
||||
UsersTable,
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
GoogleAuthsTable.ForeignKeys[0].RefTable = UsersTable
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user