merge upstream main
This commit is contained in:
@@ -204,6 +204,98 @@ var (
|
||||
},
|
||||
},
|
||||
}
|
||||
// AnnouncementsColumns holds the columns for the "announcements" table.
|
||||
AnnouncementsColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeInt64, Increment: true},
|
||||
{Name: "title", Type: field.TypeString, Size: 200},
|
||||
{Name: "content", Type: field.TypeString, SchemaType: map[string]string{"postgres": "text"}},
|
||||
{Name: "status", Type: field.TypeString, Size: 20, Default: "draft"},
|
||||
{Name: "targeting", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}},
|
||||
{Name: "starts_at", Type: field.TypeTime, Nullable: true, SchemaType: map[string]string{"postgres": "timestamptz"}},
|
||||
{Name: "ends_at", Type: field.TypeTime, Nullable: true, SchemaType: map[string]string{"postgres": "timestamptz"}},
|
||||
{Name: "created_by", Type: field.TypeInt64, Nullable: true},
|
||||
{Name: "updated_by", Type: field.TypeInt64, Nullable: true},
|
||||
{Name: "created_at", Type: field.TypeTime, SchemaType: map[string]string{"postgres": "timestamptz"}},
|
||||
{Name: "updated_at", Type: field.TypeTime, SchemaType: map[string]string{"postgres": "timestamptz"}},
|
||||
}
|
||||
// AnnouncementsTable holds the schema information for the "announcements" table.
|
||||
AnnouncementsTable = &schema.Table{
|
||||
Name: "announcements",
|
||||
Columns: AnnouncementsColumns,
|
||||
PrimaryKey: []*schema.Column{AnnouncementsColumns[0]},
|
||||
Indexes: []*schema.Index{
|
||||
{
|
||||
Name: "announcement_status",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{AnnouncementsColumns[3]},
|
||||
},
|
||||
{
|
||||
Name: "announcement_created_at",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{AnnouncementsColumns[9]},
|
||||
},
|
||||
{
|
||||
Name: "announcement_starts_at",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{AnnouncementsColumns[5]},
|
||||
},
|
||||
{
|
||||
Name: "announcement_ends_at",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{AnnouncementsColumns[6]},
|
||||
},
|
||||
},
|
||||
}
|
||||
// AnnouncementReadsColumns holds the columns for the "announcement_reads" table.
|
||||
AnnouncementReadsColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeInt64, Increment: true},
|
||||
{Name: "read_at", Type: field.TypeTime, SchemaType: map[string]string{"postgres": "timestamptz"}},
|
||||
{Name: "created_at", Type: field.TypeTime, SchemaType: map[string]string{"postgres": "timestamptz"}},
|
||||
{Name: "announcement_id", Type: field.TypeInt64},
|
||||
{Name: "user_id", Type: field.TypeInt64},
|
||||
}
|
||||
// AnnouncementReadsTable holds the schema information for the "announcement_reads" table.
|
||||
AnnouncementReadsTable = &schema.Table{
|
||||
Name: "announcement_reads",
|
||||
Columns: AnnouncementReadsColumns,
|
||||
PrimaryKey: []*schema.Column{AnnouncementReadsColumns[0]},
|
||||
ForeignKeys: []*schema.ForeignKey{
|
||||
{
|
||||
Symbol: "announcement_reads_announcements_reads",
|
||||
Columns: []*schema.Column{AnnouncementReadsColumns[3]},
|
||||
RefColumns: []*schema.Column{AnnouncementsColumns[0]},
|
||||
OnDelete: schema.NoAction,
|
||||
},
|
||||
{
|
||||
Symbol: "announcement_reads_users_announcement_reads",
|
||||
Columns: []*schema.Column{AnnouncementReadsColumns[4]},
|
||||
RefColumns: []*schema.Column{UsersColumns[0]},
|
||||
OnDelete: schema.NoAction,
|
||||
},
|
||||
},
|
||||
Indexes: []*schema.Index{
|
||||
{
|
||||
Name: "announcementread_announcement_id",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{AnnouncementReadsColumns[3]},
|
||||
},
|
||||
{
|
||||
Name: "announcementread_user_id",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{AnnouncementReadsColumns[4]},
|
||||
},
|
||||
{
|
||||
Name: "announcementread_read_at",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{AnnouncementReadsColumns[1]},
|
||||
},
|
||||
{
|
||||
Name: "announcementread_announcement_id_user_id",
|
||||
Unique: true,
|
||||
Columns: []*schema.Column{AnnouncementReadsColumns[3], AnnouncementReadsColumns[4]},
|
||||
},
|
||||
},
|
||||
}
|
||||
// GroupsColumns holds the columns for the "groups" table.
|
||||
GroupsColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeInt64, Increment: true},
|
||||
@@ -436,6 +528,44 @@ var (
|
||||
Columns: SettingsColumns,
|
||||
PrimaryKey: []*schema.Column{SettingsColumns[0]},
|
||||
}
|
||||
// UsageCleanupTasksColumns holds the columns for the "usage_cleanup_tasks" table.
|
||||
UsageCleanupTasksColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeInt64, Increment: true},
|
||||
{Name: "created_at", Type: field.TypeTime, SchemaType: map[string]string{"postgres": "timestamptz"}},
|
||||
{Name: "updated_at", Type: field.TypeTime, SchemaType: map[string]string{"postgres": "timestamptz"}},
|
||||
{Name: "status", Type: field.TypeString, Size: 20},
|
||||
{Name: "filters", Type: field.TypeJSON},
|
||||
{Name: "created_by", Type: field.TypeInt64},
|
||||
{Name: "deleted_rows", Type: field.TypeInt64, Default: 0},
|
||||
{Name: "error_message", Type: field.TypeString, Nullable: true},
|
||||
{Name: "canceled_by", Type: field.TypeInt64, Nullable: true},
|
||||
{Name: "canceled_at", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "started_at", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "finished_at", Type: field.TypeTime, Nullable: true},
|
||||
}
|
||||
// UsageCleanupTasksTable holds the schema information for the "usage_cleanup_tasks" table.
|
||||
UsageCleanupTasksTable = &schema.Table{
|
||||
Name: "usage_cleanup_tasks",
|
||||
Columns: UsageCleanupTasksColumns,
|
||||
PrimaryKey: []*schema.Column{UsageCleanupTasksColumns[0]},
|
||||
Indexes: []*schema.Index{
|
||||
{
|
||||
Name: "usagecleanuptask_status_created_at",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{UsageCleanupTasksColumns[3], UsageCleanupTasksColumns[1]},
|
||||
},
|
||||
{
|
||||
Name: "usagecleanuptask_created_at",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{UsageCleanupTasksColumns[1]},
|
||||
},
|
||||
{
|
||||
Name: "usagecleanuptask_canceled_at",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{UsageCleanupTasksColumns[9]},
|
||||
},
|
||||
},
|
||||
}
|
||||
// UsageLogsColumns holds the columns for the "usage_logs" table.
|
||||
UsageLogsColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeInt64, Increment: true},
|
||||
@@ -574,6 +704,9 @@ var (
|
||||
{Name: "status", Type: field.TypeString, Size: 20, Default: "active"},
|
||||
{Name: "username", Type: field.TypeString, Size: 100, Default: ""},
|
||||
{Name: "notes", Type: field.TypeString, Default: "", SchemaType: map[string]string{"postgres": "text"}},
|
||||
{Name: "totp_secret_encrypted", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "text"}},
|
||||
{Name: "totp_enabled", Type: field.TypeBool, Default: false},
|
||||
{Name: "totp_enabled_at", Type: field.TypeTime, Nullable: true},
|
||||
}
|
||||
// UsersTable holds the schema information for the "users" table.
|
||||
UsersTable = &schema.Table{
|
||||
@@ -801,12 +934,15 @@ var (
|
||||
APIKeysTable,
|
||||
AccountsTable,
|
||||
AccountGroupsTable,
|
||||
AnnouncementsTable,
|
||||
AnnouncementReadsTable,
|
||||
GroupsTable,
|
||||
PromoCodesTable,
|
||||
PromoCodeUsagesTable,
|
||||
ProxiesTable,
|
||||
RedeemCodesTable,
|
||||
SettingsTable,
|
||||
UsageCleanupTasksTable,
|
||||
UsageLogsTable,
|
||||
UsersTable,
|
||||
UserAllowedGroupsTable,
|
||||
@@ -831,6 +967,14 @@ func init() {
|
||||
AccountGroupsTable.Annotation = &entsql.Annotation{
|
||||
Table: "account_groups",
|
||||
}
|
||||
AnnouncementsTable.Annotation = &entsql.Annotation{
|
||||
Table: "announcements",
|
||||
}
|
||||
AnnouncementReadsTable.ForeignKeys[0].RefTable = AnnouncementsTable
|
||||
AnnouncementReadsTable.ForeignKeys[1].RefTable = UsersTable
|
||||
AnnouncementReadsTable.Annotation = &entsql.Annotation{
|
||||
Table: "announcement_reads",
|
||||
}
|
||||
GroupsTable.Annotation = &entsql.Annotation{
|
||||
Table: "groups",
|
||||
}
|
||||
@@ -853,6 +997,9 @@ func init() {
|
||||
SettingsTable.Annotation = &entsql.Annotation{
|
||||
Table: "settings",
|
||||
}
|
||||
UsageCleanupTasksTable.Annotation = &entsql.Annotation{
|
||||
Table: "usage_cleanup_tasks",
|
||||
}
|
||||
UsageLogsTable.ForeignKeys[0].RefTable = APIKeysTable
|
||||
UsageLogsTable.ForeignKeys[1].RefTable = AccountsTable
|
||||
UsageLogsTable.ForeignKeys[2].RefTable = GroupsTable
|
||||
|
||||
Reference in New Issue
Block a user