docs: reorder & testing
This commit is contained in:
@@ -13,17 +13,18 @@ import (
|
||||
)
|
||||
|
||||
type Accounts struct {
|
||||
UserID uuid.UUID `sql:"primary_key"`
|
||||
Email string
|
||||
UserName string
|
||||
DisplayName string
|
||||
PreferredLanguage string
|
||||
TimeZone string
|
||||
DeclaredCountry *string
|
||||
PermanentBlock bool
|
||||
DeletedActorType *string
|
||||
DeletedActorID *string
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
DeletedAt *time.Time
|
||||
UserID uuid.UUID `sql:"primary_key"`
|
||||
Email string
|
||||
UserName string
|
||||
DisplayName string
|
||||
PreferredLanguage string
|
||||
TimeZone string
|
||||
DeclaredCountry *string
|
||||
PermanentBlock bool
|
||||
DeletedActorType *string
|
||||
DeletedActorUserID *uuid.UUID
|
||||
DeletedActorUsername *string
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
DeletedAt *time.Time
|
||||
}
|
||||
|
||||
@@ -13,15 +13,16 @@ import (
|
||||
)
|
||||
|
||||
type EntitlementRecords struct {
|
||||
RecordID uuid.UUID `sql:"primary_key"`
|
||||
UserID uuid.UUID
|
||||
Tier string
|
||||
IsPaid bool
|
||||
Source string
|
||||
ActorType string
|
||||
ActorID *string
|
||||
ReasonCode string
|
||||
StartsAt time.Time
|
||||
EndsAt *time.Time
|
||||
CreatedAt time.Time
|
||||
RecordID uuid.UUID `sql:"primary_key"`
|
||||
UserID uuid.UUID
|
||||
Tier string
|
||||
IsPaid bool
|
||||
Source string
|
||||
ActorType string
|
||||
ActorUserID *uuid.UUID
|
||||
ActorUsername *string
|
||||
ReasonCode string
|
||||
StartsAt time.Time
|
||||
EndsAt *time.Time
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
@@ -18,7 +18,8 @@ type EntitlementSnapshots struct {
|
||||
IsPaid bool
|
||||
Source string
|
||||
ActorType string
|
||||
ActorID *string
|
||||
ActorUserID *uuid.UUID
|
||||
ActorUsername *string
|
||||
ReasonCode string
|
||||
StartsAt time.Time
|
||||
EndsAt *time.Time
|
||||
|
||||
@@ -19,11 +19,13 @@ type LimitRecords struct {
|
||||
Value int32
|
||||
ReasonCode string
|
||||
ActorType string
|
||||
ActorID *string
|
||||
ActorUserID *uuid.UUID
|
||||
ActorUsername *string
|
||||
AppliedAt time.Time
|
||||
ExpiresAt *time.Time
|
||||
RemovedAt *time.Time
|
||||
RemovedByType *string
|
||||
RemovedByID *string
|
||||
RemovedByUserID *uuid.UUID
|
||||
RemovedByUsername *string
|
||||
RemovedReasonCode *string
|
||||
}
|
||||
|
||||
@@ -19,11 +19,13 @@ type SanctionRecords struct {
|
||||
Scope string
|
||||
ReasonCode string
|
||||
ActorType string
|
||||
ActorID *string
|
||||
ActorUserID *uuid.UUID
|
||||
ActorUsername *string
|
||||
AppliedAt time.Time
|
||||
ExpiresAt *time.Time
|
||||
RemovedAt *time.Time
|
||||
RemovedByType *string
|
||||
RemovedByID *string
|
||||
RemovedByUserID *uuid.UUID
|
||||
RemovedByUsername *string
|
||||
RemovedReasonCode *string
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// 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 model
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"time"
|
||||
)
|
||||
|
||||
type SessionRevocations struct {
|
||||
RevocationID uuid.UUID `sql:"primary_key"`
|
||||
DeviceSessionID uuid.UUID
|
||||
UserID uuid.UUID
|
||||
ActorKind string
|
||||
ActorUserID *uuid.UUID
|
||||
ActorUsername *string
|
||||
Reason string
|
||||
RevokedAt time.Time
|
||||
}
|
||||
@@ -17,19 +17,20 @@ type accountsTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
UserID postgres.ColumnString
|
||||
Email postgres.ColumnString
|
||||
UserName postgres.ColumnString
|
||||
DisplayName postgres.ColumnString
|
||||
PreferredLanguage postgres.ColumnString
|
||||
TimeZone postgres.ColumnString
|
||||
DeclaredCountry postgres.ColumnString
|
||||
PermanentBlock postgres.ColumnBool
|
||||
DeletedActorType postgres.ColumnString
|
||||
DeletedActorID postgres.ColumnString
|
||||
CreatedAt postgres.ColumnTimestampz
|
||||
UpdatedAt postgres.ColumnTimestampz
|
||||
DeletedAt postgres.ColumnTimestampz
|
||||
UserID postgres.ColumnString
|
||||
Email postgres.ColumnString
|
||||
UserName postgres.ColumnString
|
||||
DisplayName postgres.ColumnString
|
||||
PreferredLanguage postgres.ColumnString
|
||||
TimeZone postgres.ColumnString
|
||||
DeclaredCountry postgres.ColumnString
|
||||
PermanentBlock postgres.ColumnBool
|
||||
DeletedActorType postgres.ColumnString
|
||||
DeletedActorUserID postgres.ColumnString
|
||||
DeletedActorUsername postgres.ColumnString
|
||||
CreatedAt postgres.ColumnTimestampz
|
||||
UpdatedAt postgres.ColumnTimestampz
|
||||
DeletedAt postgres.ColumnTimestampz
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
@@ -71,41 +72,43 @@ func newAccountsTable(schemaName, tableName, alias string) *AccountsTable {
|
||||
|
||||
func newAccountsTableImpl(schemaName, tableName, alias string) accountsTable {
|
||||
var (
|
||||
UserIDColumn = postgres.StringColumn("user_id")
|
||||
EmailColumn = postgres.StringColumn("email")
|
||||
UserNameColumn = postgres.StringColumn("user_name")
|
||||
DisplayNameColumn = postgres.StringColumn("display_name")
|
||||
PreferredLanguageColumn = postgres.StringColumn("preferred_language")
|
||||
TimeZoneColumn = postgres.StringColumn("time_zone")
|
||||
DeclaredCountryColumn = postgres.StringColumn("declared_country")
|
||||
PermanentBlockColumn = postgres.BoolColumn("permanent_block")
|
||||
DeletedActorTypeColumn = postgres.StringColumn("deleted_actor_type")
|
||||
DeletedActorIDColumn = postgres.StringColumn("deleted_actor_id")
|
||||
CreatedAtColumn = postgres.TimestampzColumn("created_at")
|
||||
UpdatedAtColumn = postgres.TimestampzColumn("updated_at")
|
||||
DeletedAtColumn = postgres.TimestampzColumn("deleted_at")
|
||||
allColumns = postgres.ColumnList{UserIDColumn, EmailColumn, UserNameColumn, DisplayNameColumn, PreferredLanguageColumn, TimeZoneColumn, DeclaredCountryColumn, PermanentBlockColumn, DeletedActorTypeColumn, DeletedActorIDColumn, CreatedAtColumn, UpdatedAtColumn, DeletedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{EmailColumn, UserNameColumn, DisplayNameColumn, PreferredLanguageColumn, TimeZoneColumn, DeclaredCountryColumn, PermanentBlockColumn, DeletedActorTypeColumn, DeletedActorIDColumn, CreatedAtColumn, UpdatedAtColumn, DeletedAtColumn}
|
||||
defaultColumns = postgres.ColumnList{DisplayNameColumn, PermanentBlockColumn, CreatedAtColumn, UpdatedAtColumn}
|
||||
UserIDColumn = postgres.StringColumn("user_id")
|
||||
EmailColumn = postgres.StringColumn("email")
|
||||
UserNameColumn = postgres.StringColumn("user_name")
|
||||
DisplayNameColumn = postgres.StringColumn("display_name")
|
||||
PreferredLanguageColumn = postgres.StringColumn("preferred_language")
|
||||
TimeZoneColumn = postgres.StringColumn("time_zone")
|
||||
DeclaredCountryColumn = postgres.StringColumn("declared_country")
|
||||
PermanentBlockColumn = postgres.BoolColumn("permanent_block")
|
||||
DeletedActorTypeColumn = postgres.StringColumn("deleted_actor_type")
|
||||
DeletedActorUserIDColumn = postgres.StringColumn("deleted_actor_user_id")
|
||||
DeletedActorUsernameColumn = postgres.StringColumn("deleted_actor_username")
|
||||
CreatedAtColumn = postgres.TimestampzColumn("created_at")
|
||||
UpdatedAtColumn = postgres.TimestampzColumn("updated_at")
|
||||
DeletedAtColumn = postgres.TimestampzColumn("deleted_at")
|
||||
allColumns = postgres.ColumnList{UserIDColumn, EmailColumn, UserNameColumn, DisplayNameColumn, PreferredLanguageColumn, TimeZoneColumn, DeclaredCountryColumn, PermanentBlockColumn, DeletedActorTypeColumn, DeletedActorUserIDColumn, DeletedActorUsernameColumn, CreatedAtColumn, UpdatedAtColumn, DeletedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{EmailColumn, UserNameColumn, DisplayNameColumn, PreferredLanguageColumn, TimeZoneColumn, DeclaredCountryColumn, PermanentBlockColumn, DeletedActorTypeColumn, DeletedActorUserIDColumn, DeletedActorUsernameColumn, CreatedAtColumn, UpdatedAtColumn, DeletedAtColumn}
|
||||
defaultColumns = postgres.ColumnList{DisplayNameColumn, PermanentBlockColumn, CreatedAtColumn, UpdatedAtColumn}
|
||||
)
|
||||
|
||||
return accountsTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
UserID: UserIDColumn,
|
||||
Email: EmailColumn,
|
||||
UserName: UserNameColumn,
|
||||
DisplayName: DisplayNameColumn,
|
||||
PreferredLanguage: PreferredLanguageColumn,
|
||||
TimeZone: TimeZoneColumn,
|
||||
DeclaredCountry: DeclaredCountryColumn,
|
||||
PermanentBlock: PermanentBlockColumn,
|
||||
DeletedActorType: DeletedActorTypeColumn,
|
||||
DeletedActorID: DeletedActorIDColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
UpdatedAt: UpdatedAtColumn,
|
||||
DeletedAt: DeletedAtColumn,
|
||||
UserID: UserIDColumn,
|
||||
Email: EmailColumn,
|
||||
UserName: UserNameColumn,
|
||||
DisplayName: DisplayNameColumn,
|
||||
PreferredLanguage: PreferredLanguageColumn,
|
||||
TimeZone: TimeZoneColumn,
|
||||
DeclaredCountry: DeclaredCountryColumn,
|
||||
PermanentBlock: PermanentBlockColumn,
|
||||
DeletedActorType: DeletedActorTypeColumn,
|
||||
DeletedActorUserID: DeletedActorUserIDColumn,
|
||||
DeletedActorUsername: DeletedActorUsernameColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
UpdatedAt: UpdatedAtColumn,
|
||||
DeletedAt: DeletedAtColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
|
||||
@@ -17,17 +17,18 @@ type entitlementRecordsTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
RecordID postgres.ColumnString
|
||||
UserID postgres.ColumnString
|
||||
Tier postgres.ColumnString
|
||||
IsPaid postgres.ColumnBool
|
||||
Source postgres.ColumnString
|
||||
ActorType postgres.ColumnString
|
||||
ActorID postgres.ColumnString
|
||||
ReasonCode postgres.ColumnString
|
||||
StartsAt postgres.ColumnTimestampz
|
||||
EndsAt postgres.ColumnTimestampz
|
||||
CreatedAt postgres.ColumnTimestampz
|
||||
RecordID postgres.ColumnString
|
||||
UserID postgres.ColumnString
|
||||
Tier postgres.ColumnString
|
||||
IsPaid postgres.ColumnBool
|
||||
Source postgres.ColumnString
|
||||
ActorType postgres.ColumnString
|
||||
ActorUserID postgres.ColumnString
|
||||
ActorUsername postgres.ColumnString
|
||||
ReasonCode postgres.ColumnString
|
||||
StartsAt postgres.ColumnTimestampz
|
||||
EndsAt postgres.ColumnTimestampz
|
||||
CreatedAt postgres.ColumnTimestampz
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
@@ -69,37 +70,39 @@ func newEntitlementRecordsTable(schemaName, tableName, alias string) *Entitlemen
|
||||
|
||||
func newEntitlementRecordsTableImpl(schemaName, tableName, alias string) entitlementRecordsTable {
|
||||
var (
|
||||
RecordIDColumn = postgres.StringColumn("record_id")
|
||||
UserIDColumn = postgres.StringColumn("user_id")
|
||||
TierColumn = postgres.StringColumn("tier")
|
||||
IsPaidColumn = postgres.BoolColumn("is_paid")
|
||||
SourceColumn = postgres.StringColumn("source")
|
||||
ActorTypeColumn = postgres.StringColumn("actor_type")
|
||||
ActorIDColumn = postgres.StringColumn("actor_id")
|
||||
ReasonCodeColumn = postgres.StringColumn("reason_code")
|
||||
StartsAtColumn = postgres.TimestampzColumn("starts_at")
|
||||
EndsAtColumn = postgres.TimestampzColumn("ends_at")
|
||||
CreatedAtColumn = postgres.TimestampzColumn("created_at")
|
||||
allColumns = postgres.ColumnList{RecordIDColumn, UserIDColumn, TierColumn, IsPaidColumn, SourceColumn, ActorTypeColumn, ActorIDColumn, ReasonCodeColumn, StartsAtColumn, EndsAtColumn, CreatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{UserIDColumn, TierColumn, IsPaidColumn, SourceColumn, ActorTypeColumn, ActorIDColumn, ReasonCodeColumn, StartsAtColumn, EndsAtColumn, CreatedAtColumn}
|
||||
defaultColumns = postgres.ColumnList{ReasonCodeColumn, StartsAtColumn, CreatedAtColumn}
|
||||
RecordIDColumn = postgres.StringColumn("record_id")
|
||||
UserIDColumn = postgres.StringColumn("user_id")
|
||||
TierColumn = postgres.StringColumn("tier")
|
||||
IsPaidColumn = postgres.BoolColumn("is_paid")
|
||||
SourceColumn = postgres.StringColumn("source")
|
||||
ActorTypeColumn = postgres.StringColumn("actor_type")
|
||||
ActorUserIDColumn = postgres.StringColumn("actor_user_id")
|
||||
ActorUsernameColumn = postgres.StringColumn("actor_username")
|
||||
ReasonCodeColumn = postgres.StringColumn("reason_code")
|
||||
StartsAtColumn = postgres.TimestampzColumn("starts_at")
|
||||
EndsAtColumn = postgres.TimestampzColumn("ends_at")
|
||||
CreatedAtColumn = postgres.TimestampzColumn("created_at")
|
||||
allColumns = postgres.ColumnList{RecordIDColumn, UserIDColumn, TierColumn, IsPaidColumn, SourceColumn, ActorTypeColumn, ActorUserIDColumn, ActorUsernameColumn, ReasonCodeColumn, StartsAtColumn, EndsAtColumn, CreatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{UserIDColumn, TierColumn, IsPaidColumn, SourceColumn, ActorTypeColumn, ActorUserIDColumn, ActorUsernameColumn, ReasonCodeColumn, StartsAtColumn, EndsAtColumn, CreatedAtColumn}
|
||||
defaultColumns = postgres.ColumnList{ReasonCodeColumn, StartsAtColumn, CreatedAtColumn}
|
||||
)
|
||||
|
||||
return entitlementRecordsTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
RecordID: RecordIDColumn,
|
||||
UserID: UserIDColumn,
|
||||
Tier: TierColumn,
|
||||
IsPaid: IsPaidColumn,
|
||||
Source: SourceColumn,
|
||||
ActorType: ActorTypeColumn,
|
||||
ActorID: ActorIDColumn,
|
||||
ReasonCode: ReasonCodeColumn,
|
||||
StartsAt: StartsAtColumn,
|
||||
EndsAt: EndsAtColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
RecordID: RecordIDColumn,
|
||||
UserID: UserIDColumn,
|
||||
Tier: TierColumn,
|
||||
IsPaid: IsPaidColumn,
|
||||
Source: SourceColumn,
|
||||
ActorType: ActorTypeColumn,
|
||||
ActorUserID: ActorUserIDColumn,
|
||||
ActorUsername: ActorUsernameColumn,
|
||||
ReasonCode: ReasonCodeColumn,
|
||||
StartsAt: StartsAtColumn,
|
||||
EndsAt: EndsAtColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
|
||||
@@ -22,7 +22,8 @@ type entitlementSnapshotsTable struct {
|
||||
IsPaid postgres.ColumnBool
|
||||
Source postgres.ColumnString
|
||||
ActorType postgres.ColumnString
|
||||
ActorID postgres.ColumnString
|
||||
ActorUserID postgres.ColumnString
|
||||
ActorUsername postgres.ColumnString
|
||||
ReasonCode postgres.ColumnString
|
||||
StartsAt postgres.ColumnTimestampz
|
||||
EndsAt postgres.ColumnTimestampz
|
||||
@@ -74,14 +75,15 @@ func newEntitlementSnapshotsTableImpl(schemaName, tableName, alias string) entit
|
||||
IsPaidColumn = postgres.BoolColumn("is_paid")
|
||||
SourceColumn = postgres.StringColumn("source")
|
||||
ActorTypeColumn = postgres.StringColumn("actor_type")
|
||||
ActorIDColumn = postgres.StringColumn("actor_id")
|
||||
ActorUserIDColumn = postgres.StringColumn("actor_user_id")
|
||||
ActorUsernameColumn = postgres.StringColumn("actor_username")
|
||||
ReasonCodeColumn = postgres.StringColumn("reason_code")
|
||||
StartsAtColumn = postgres.TimestampzColumn("starts_at")
|
||||
EndsAtColumn = postgres.TimestampzColumn("ends_at")
|
||||
MaxRegisteredRaceNamesColumn = postgres.IntegerColumn("max_registered_race_names")
|
||||
UpdatedAtColumn = postgres.TimestampzColumn("updated_at")
|
||||
allColumns = postgres.ColumnList{UserIDColumn, TierColumn, IsPaidColumn, SourceColumn, ActorTypeColumn, ActorIDColumn, ReasonCodeColumn, StartsAtColumn, EndsAtColumn, MaxRegisteredRaceNamesColumn, UpdatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{TierColumn, IsPaidColumn, SourceColumn, ActorTypeColumn, ActorIDColumn, ReasonCodeColumn, StartsAtColumn, EndsAtColumn, MaxRegisteredRaceNamesColumn, UpdatedAtColumn}
|
||||
allColumns = postgres.ColumnList{UserIDColumn, TierColumn, IsPaidColumn, SourceColumn, ActorTypeColumn, ActorUserIDColumn, ActorUsernameColumn, ReasonCodeColumn, StartsAtColumn, EndsAtColumn, MaxRegisteredRaceNamesColumn, UpdatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{TierColumn, IsPaidColumn, SourceColumn, ActorTypeColumn, ActorUserIDColumn, ActorUsernameColumn, ReasonCodeColumn, StartsAtColumn, EndsAtColumn, MaxRegisteredRaceNamesColumn, UpdatedAtColumn}
|
||||
defaultColumns = postgres.ColumnList{ReasonCodeColumn, UpdatedAtColumn}
|
||||
)
|
||||
|
||||
@@ -94,7 +96,8 @@ func newEntitlementSnapshotsTableImpl(schemaName, tableName, alias string) entit
|
||||
IsPaid: IsPaidColumn,
|
||||
Source: SourceColumn,
|
||||
ActorType: ActorTypeColumn,
|
||||
ActorID: ActorIDColumn,
|
||||
ActorUserID: ActorUserIDColumn,
|
||||
ActorUsername: ActorUsernameColumn,
|
||||
ReasonCode: ReasonCodeColumn,
|
||||
StartsAt: StartsAtColumn,
|
||||
EndsAt: EndsAtColumn,
|
||||
|
||||
@@ -23,12 +23,14 @@ type limitRecordsTable struct {
|
||||
Value postgres.ColumnInteger
|
||||
ReasonCode postgres.ColumnString
|
||||
ActorType postgres.ColumnString
|
||||
ActorID postgres.ColumnString
|
||||
ActorUserID postgres.ColumnString
|
||||
ActorUsername postgres.ColumnString
|
||||
AppliedAt postgres.ColumnTimestampz
|
||||
ExpiresAt postgres.ColumnTimestampz
|
||||
RemovedAt postgres.ColumnTimestampz
|
||||
RemovedByType postgres.ColumnString
|
||||
RemovedByID postgres.ColumnString
|
||||
RemovedByUserID postgres.ColumnString
|
||||
RemovedByUsername postgres.ColumnString
|
||||
RemovedReasonCode postgres.ColumnString
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
@@ -77,15 +79,17 @@ func newLimitRecordsTableImpl(schemaName, tableName, alias string) limitRecordsT
|
||||
ValueColumn = postgres.IntegerColumn("value")
|
||||
ReasonCodeColumn = postgres.StringColumn("reason_code")
|
||||
ActorTypeColumn = postgres.StringColumn("actor_type")
|
||||
ActorIDColumn = postgres.StringColumn("actor_id")
|
||||
ActorUserIDColumn = postgres.StringColumn("actor_user_id")
|
||||
ActorUsernameColumn = postgres.StringColumn("actor_username")
|
||||
AppliedAtColumn = postgres.TimestampzColumn("applied_at")
|
||||
ExpiresAtColumn = postgres.TimestampzColumn("expires_at")
|
||||
RemovedAtColumn = postgres.TimestampzColumn("removed_at")
|
||||
RemovedByTypeColumn = postgres.StringColumn("removed_by_type")
|
||||
RemovedByIDColumn = postgres.StringColumn("removed_by_id")
|
||||
RemovedByUserIDColumn = postgres.StringColumn("removed_by_user_id")
|
||||
RemovedByUsernameColumn = postgres.StringColumn("removed_by_username")
|
||||
RemovedReasonCodeColumn = postgres.StringColumn("removed_reason_code")
|
||||
allColumns = postgres.ColumnList{RecordIDColumn, UserIDColumn, LimitCodeColumn, ValueColumn, ReasonCodeColumn, ActorTypeColumn, ActorIDColumn, AppliedAtColumn, ExpiresAtColumn, RemovedAtColumn, RemovedByTypeColumn, RemovedByIDColumn, RemovedReasonCodeColumn}
|
||||
mutableColumns = postgres.ColumnList{UserIDColumn, LimitCodeColumn, ValueColumn, ReasonCodeColumn, ActorTypeColumn, ActorIDColumn, AppliedAtColumn, ExpiresAtColumn, RemovedAtColumn, RemovedByTypeColumn, RemovedByIDColumn, RemovedReasonCodeColumn}
|
||||
allColumns = postgres.ColumnList{RecordIDColumn, UserIDColumn, LimitCodeColumn, ValueColumn, ReasonCodeColumn, ActorTypeColumn, ActorUserIDColumn, ActorUsernameColumn, AppliedAtColumn, ExpiresAtColumn, RemovedAtColumn, RemovedByTypeColumn, RemovedByUserIDColumn, RemovedByUsernameColumn, RemovedReasonCodeColumn}
|
||||
mutableColumns = postgres.ColumnList{UserIDColumn, LimitCodeColumn, ValueColumn, ReasonCodeColumn, ActorTypeColumn, ActorUserIDColumn, ActorUsernameColumn, AppliedAtColumn, ExpiresAtColumn, RemovedAtColumn, RemovedByTypeColumn, RemovedByUserIDColumn, RemovedByUsernameColumn, RemovedReasonCodeColumn}
|
||||
defaultColumns = postgres.ColumnList{AppliedAtColumn}
|
||||
)
|
||||
|
||||
@@ -99,12 +103,14 @@ func newLimitRecordsTableImpl(schemaName, tableName, alias string) limitRecordsT
|
||||
Value: ValueColumn,
|
||||
ReasonCode: ReasonCodeColumn,
|
||||
ActorType: ActorTypeColumn,
|
||||
ActorID: ActorIDColumn,
|
||||
ActorUserID: ActorUserIDColumn,
|
||||
ActorUsername: ActorUsernameColumn,
|
||||
AppliedAt: AppliedAtColumn,
|
||||
ExpiresAt: ExpiresAtColumn,
|
||||
RemovedAt: RemovedAtColumn,
|
||||
RemovedByType: RemovedByTypeColumn,
|
||||
RemovedByID: RemovedByIDColumn,
|
||||
RemovedByUserID: RemovedByUserIDColumn,
|
||||
RemovedByUsername: RemovedByUsernameColumn,
|
||||
RemovedReasonCode: RemovedReasonCodeColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
|
||||
@@ -23,12 +23,14 @@ type sanctionRecordsTable struct {
|
||||
Scope postgres.ColumnString
|
||||
ReasonCode postgres.ColumnString
|
||||
ActorType postgres.ColumnString
|
||||
ActorID postgres.ColumnString
|
||||
ActorUserID postgres.ColumnString
|
||||
ActorUsername postgres.ColumnString
|
||||
AppliedAt postgres.ColumnTimestampz
|
||||
ExpiresAt postgres.ColumnTimestampz
|
||||
RemovedAt postgres.ColumnTimestampz
|
||||
RemovedByType postgres.ColumnString
|
||||
RemovedByID postgres.ColumnString
|
||||
RemovedByUserID postgres.ColumnString
|
||||
RemovedByUsername postgres.ColumnString
|
||||
RemovedReasonCode postgres.ColumnString
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
@@ -77,15 +79,17 @@ func newSanctionRecordsTableImpl(schemaName, tableName, alias string) sanctionRe
|
||||
ScopeColumn = postgres.StringColumn("scope")
|
||||
ReasonCodeColumn = postgres.StringColumn("reason_code")
|
||||
ActorTypeColumn = postgres.StringColumn("actor_type")
|
||||
ActorIDColumn = postgres.StringColumn("actor_id")
|
||||
ActorUserIDColumn = postgres.StringColumn("actor_user_id")
|
||||
ActorUsernameColumn = postgres.StringColumn("actor_username")
|
||||
AppliedAtColumn = postgres.TimestampzColumn("applied_at")
|
||||
ExpiresAtColumn = postgres.TimestampzColumn("expires_at")
|
||||
RemovedAtColumn = postgres.TimestampzColumn("removed_at")
|
||||
RemovedByTypeColumn = postgres.StringColumn("removed_by_type")
|
||||
RemovedByIDColumn = postgres.StringColumn("removed_by_id")
|
||||
RemovedByUserIDColumn = postgres.StringColumn("removed_by_user_id")
|
||||
RemovedByUsernameColumn = postgres.StringColumn("removed_by_username")
|
||||
RemovedReasonCodeColumn = postgres.StringColumn("removed_reason_code")
|
||||
allColumns = postgres.ColumnList{RecordIDColumn, UserIDColumn, SanctionCodeColumn, ScopeColumn, ReasonCodeColumn, ActorTypeColumn, ActorIDColumn, AppliedAtColumn, ExpiresAtColumn, RemovedAtColumn, RemovedByTypeColumn, RemovedByIDColumn, RemovedReasonCodeColumn}
|
||||
mutableColumns = postgres.ColumnList{UserIDColumn, SanctionCodeColumn, ScopeColumn, ReasonCodeColumn, ActorTypeColumn, ActorIDColumn, AppliedAtColumn, ExpiresAtColumn, RemovedAtColumn, RemovedByTypeColumn, RemovedByIDColumn, RemovedReasonCodeColumn}
|
||||
allColumns = postgres.ColumnList{RecordIDColumn, UserIDColumn, SanctionCodeColumn, ScopeColumn, ReasonCodeColumn, ActorTypeColumn, ActorUserIDColumn, ActorUsernameColumn, AppliedAtColumn, ExpiresAtColumn, RemovedAtColumn, RemovedByTypeColumn, RemovedByUserIDColumn, RemovedByUsernameColumn, RemovedReasonCodeColumn}
|
||||
mutableColumns = postgres.ColumnList{UserIDColumn, SanctionCodeColumn, ScopeColumn, ReasonCodeColumn, ActorTypeColumn, ActorUserIDColumn, ActorUsernameColumn, AppliedAtColumn, ExpiresAtColumn, RemovedAtColumn, RemovedByTypeColumn, RemovedByUserIDColumn, RemovedByUsernameColumn, RemovedReasonCodeColumn}
|
||||
defaultColumns = postgres.ColumnList{AppliedAtColumn}
|
||||
)
|
||||
|
||||
@@ -99,12 +103,14 @@ func newSanctionRecordsTableImpl(schemaName, tableName, alias string) sanctionRe
|
||||
Scope: ScopeColumn,
|
||||
ReasonCode: ReasonCodeColumn,
|
||||
ActorType: ActorTypeColumn,
|
||||
ActorID: ActorIDColumn,
|
||||
ActorUserID: ActorUserIDColumn,
|
||||
ActorUsername: ActorUsernameColumn,
|
||||
AppliedAt: AppliedAtColumn,
|
||||
ExpiresAt: ExpiresAtColumn,
|
||||
RemovedAt: RemovedAtColumn,
|
||||
RemovedByType: RemovedByTypeColumn,
|
||||
RemovedByID: RemovedByIDColumn,
|
||||
RemovedByUserID: RemovedByUserIDColumn,
|
||||
RemovedByUsername: RemovedByUsernameColumn,
|
||||
RemovedReasonCode: RemovedReasonCodeColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
//
|
||||
// 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 SessionRevocations = newSessionRevocationsTable("backend", "session_revocations", "")
|
||||
|
||||
type sessionRevocationsTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
RevocationID postgres.ColumnString
|
||||
DeviceSessionID postgres.ColumnString
|
||||
UserID postgres.ColumnString
|
||||
ActorKind postgres.ColumnString
|
||||
ActorUserID postgres.ColumnString
|
||||
ActorUsername postgres.ColumnString
|
||||
Reason postgres.ColumnString
|
||||
RevokedAt postgres.ColumnTimestampz
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
DefaultColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type SessionRevocationsTable struct {
|
||||
sessionRevocationsTable
|
||||
|
||||
EXCLUDED sessionRevocationsTable
|
||||
}
|
||||
|
||||
// AS creates new SessionRevocationsTable with assigned alias
|
||||
func (a SessionRevocationsTable) AS(alias string) *SessionRevocationsTable {
|
||||
return newSessionRevocationsTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new SessionRevocationsTable with assigned schema name
|
||||
func (a SessionRevocationsTable) FromSchema(schemaName string) *SessionRevocationsTable {
|
||||
return newSessionRevocationsTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new SessionRevocationsTable with assigned table prefix
|
||||
func (a SessionRevocationsTable) WithPrefix(prefix string) *SessionRevocationsTable {
|
||||
return newSessionRevocationsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new SessionRevocationsTable with assigned table suffix
|
||||
func (a SessionRevocationsTable) WithSuffix(suffix string) *SessionRevocationsTable {
|
||||
return newSessionRevocationsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newSessionRevocationsTable(schemaName, tableName, alias string) *SessionRevocationsTable {
|
||||
return &SessionRevocationsTable{
|
||||
sessionRevocationsTable: newSessionRevocationsTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newSessionRevocationsTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newSessionRevocationsTableImpl(schemaName, tableName, alias string) sessionRevocationsTable {
|
||||
var (
|
||||
RevocationIDColumn = postgres.StringColumn("revocation_id")
|
||||
DeviceSessionIDColumn = postgres.StringColumn("device_session_id")
|
||||
UserIDColumn = postgres.StringColumn("user_id")
|
||||
ActorKindColumn = postgres.StringColumn("actor_kind")
|
||||
ActorUserIDColumn = postgres.StringColumn("actor_user_id")
|
||||
ActorUsernameColumn = postgres.StringColumn("actor_username")
|
||||
ReasonColumn = postgres.StringColumn("reason")
|
||||
RevokedAtColumn = postgres.TimestampzColumn("revoked_at")
|
||||
allColumns = postgres.ColumnList{RevocationIDColumn, DeviceSessionIDColumn, UserIDColumn, ActorKindColumn, ActorUserIDColumn, ActorUsernameColumn, ReasonColumn, RevokedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{DeviceSessionIDColumn, UserIDColumn, ActorKindColumn, ActorUserIDColumn, ActorUsernameColumn, ReasonColumn, RevokedAtColumn}
|
||||
defaultColumns = postgres.ColumnList{ReasonColumn, RevokedAtColumn}
|
||||
)
|
||||
|
||||
return sessionRevocationsTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
RevocationID: RevocationIDColumn,
|
||||
DeviceSessionID: DeviceSessionIDColumn,
|
||||
UserID: UserIDColumn,
|
||||
ActorKind: ActorKindColumn,
|
||||
ActorUserID: ActorUserIDColumn,
|
||||
ActorUsername: ActorUsernameColumn,
|
||||
Reason: ReasonColumn,
|
||||
RevokedAt: RevokedAtColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
DefaultColumns: defaultColumns,
|
||||
}
|
||||
}
|
||||
@@ -40,5 +40,6 @@ func UseSchema(schema string) {
|
||||
RuntimeRecords = RuntimeRecords.FromSchema(schema)
|
||||
SanctionActive = SanctionActive.FromSchema(schema)
|
||||
SanctionRecords = SanctionRecords.FromSchema(schema)
|
||||
SessionRevocations = SessionRevocations.FromSchema(schema)
|
||||
UserCountryCounters = UserCountryCounters.FromSchema(schema)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user