51 lines
1.9 KiB
Go
51 lines
1.9 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package migrate
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql/schema"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
var (
|
|
// WalletsColumns holds the columns for the "wallets" table.
|
|
WalletsColumns = []*schema.Column{
|
|
{Name: "user_id", Type: field.TypeInt64, Increment: true},
|
|
{Name: "balance", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "decimal(12,2)"}},
|
|
{Name: "frozen_balance", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "decimal(12,2)"}},
|
|
{Name: "version", Type: field.TypeInt, Default: 1},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
}
|
|
// WalletsTable holds the schema information for the "wallets" table.
|
|
WalletsTable = &schema.Table{
|
|
Name: "wallets",
|
|
Columns: WalletsColumns,
|
|
PrimaryKey: []*schema.Column{WalletsColumns[0]},
|
|
}
|
|
// WalletTransactionsColumns holds the columns for the "wallet_transactions" table.
|
|
WalletTransactionsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeString, Unique: true},
|
|
{Name: "user_id", Type: field.TypeInt64, Unique: true},
|
|
{Name: "type", Type: field.TypeString},
|
|
{Name: "amount", Type: field.TypeOther, Unique: true, SchemaType: map[string]string{"postgres": "decimal(12,2"}},
|
|
{Name: "balance_after", Type: field.TypeOther, Unique: true, SchemaType: map[string]string{"postgres": "decimal(12,2)"}},
|
|
{Name: "description", Type: field.TypeJSON},
|
|
{Name: "order_id", Type: field.TypeInt64, Unique: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
}
|
|
// WalletTransactionsTable holds the schema information for the "wallet_transactions" table.
|
|
WalletTransactionsTable = &schema.Table{
|
|
Name: "wallet_transactions",
|
|
Columns: WalletTransactionsColumns,
|
|
PrimaryKey: []*schema.Column{WalletTransactionsColumns[0]},
|
|
}
|
|
// Tables holds all the tables in the schema.
|
|
Tables = []*schema.Table{
|
|
WalletsTable,
|
|
WalletTransactionsTable,
|
|
}
|
|
)
|
|
|
|
func init() {
|
|
}
|