feat: complete template
This commit is contained in:
84
backend/database/models/qvyun/public/table/users_tenants.go
Normal file
84
backend/database/models/qvyun/public/table/users_tenants.go
Normal file
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// Code generated by go-jet DO NOT EDIT.
|
||||
//
|
||||
// WARNING: Changes to this file may cause incorrect behavior
|
||||
// and will be lost if the code is regenerated
|
||||
//
|
||||
|
||||
package table
|
||||
|
||||
import (
|
||||
"github.com/go-jet/jet/v2/postgres"
|
||||
)
|
||||
|
||||
var UsersTenants = newUsersTenantsTable("public", "users_tenants", "")
|
||||
|
||||
type usersTenantsTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnInteger
|
||||
UserID postgres.ColumnInteger
|
||||
TenantID postgres.ColumnInteger
|
||||
CreatedAt postgres.ColumnTimestamp
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type UsersTenantsTable struct {
|
||||
usersTenantsTable
|
||||
|
||||
EXCLUDED usersTenantsTable
|
||||
}
|
||||
|
||||
// AS creates new UsersTenantsTable with assigned alias
|
||||
func (a UsersTenantsTable) AS(alias string) *UsersTenantsTable {
|
||||
return newUsersTenantsTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new UsersTenantsTable with assigned schema name
|
||||
func (a UsersTenantsTable) FromSchema(schemaName string) *UsersTenantsTable {
|
||||
return newUsersTenantsTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new UsersTenantsTable with assigned table prefix
|
||||
func (a UsersTenantsTable) WithPrefix(prefix string) *UsersTenantsTable {
|
||||
return newUsersTenantsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new UsersTenantsTable with assigned table suffix
|
||||
func (a UsersTenantsTable) WithSuffix(suffix string) *UsersTenantsTable {
|
||||
return newUsersTenantsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newUsersTenantsTable(schemaName, tableName, alias string) *UsersTenantsTable {
|
||||
return &UsersTenantsTable{
|
||||
usersTenantsTable: newUsersTenantsTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newUsersTenantsTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newUsersTenantsTableImpl(schemaName, tableName, alias string) usersTenantsTable {
|
||||
var (
|
||||
IDColumn = postgres.IntegerColumn("id")
|
||||
UserIDColumn = postgres.IntegerColumn("user_id")
|
||||
TenantIDColumn = postgres.IntegerColumn("tenant_id")
|
||||
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
||||
allColumns = postgres.ColumnList{IDColumn, UserIDColumn, TenantIDColumn, CreatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{UserIDColumn, TenantIDColumn, CreatedAtColumn}
|
||||
)
|
||||
|
||||
return usersTenantsTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
UserID: UserIDColumn,
|
||||
TenantID: TenantIDColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user