mirror of
https://github.com/openziti/zrok.git
synced 2025-01-08 23:20:04 +01:00
added 'deleted' flags to all store objects (#262)
This commit is contained in:
parent
43d51a8f14
commit
a0e94330c7
@ -12,6 +12,7 @@ type Account struct {
|
|||||||
Password string
|
Password string
|
||||||
Token string
|
Token string
|
||||||
Limitless bool
|
Limitless bool
|
||||||
|
Deleted bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *Store) CreateAccount(a *Account, tx *sqlx.Tx) (int, error) {
|
func (self *Store) CreateAccount(a *Account, tx *sqlx.Tx) (int, error) {
|
||||||
|
@ -14,6 +14,7 @@ type AccountRequest struct {
|
|||||||
Token string
|
Token string
|
||||||
Email string
|
Email string
|
||||||
SourceAddress string
|
SourceAddress string
|
||||||
|
Deleted bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *Store) CreateAccountRequest(ar *AccountRequest, tx *sqlx.Tx) (int, error) {
|
func (self *Store) CreateAccountRequest(ar *AccountRequest, tx *sqlx.Tx) (int, error) {
|
||||||
|
@ -12,6 +12,7 @@ type Environment struct {
|
|||||||
Host string
|
Host string
|
||||||
Address string
|
Address string
|
||||||
ZId string
|
ZId string
|
||||||
|
Deleted bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *Store) CreateEnvironment(accountId int, i *Environment, tx *sqlx.Tx) (int, error) {
|
func (self *Store) CreateEnvironment(accountId int, i *Environment, tx *sqlx.Tx) (int, error) {
|
||||||
|
@ -13,6 +13,7 @@ type Frontend struct {
|
|||||||
PublicName *string
|
PublicName *string
|
||||||
UrlTemplate *string
|
UrlTemplate *string
|
||||||
Reserved bool
|
Reserved bool
|
||||||
|
Deleted bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (str *Store) CreateFrontend(envId int, f *Frontend, tx *sqlx.Tx) (int, error) {
|
func (str *Store) CreateFrontend(envId int, f *Frontend, tx *sqlx.Tx) (int, error) {
|
||||||
|
@ -11,6 +11,7 @@ import (
|
|||||||
type InviteToken struct {
|
type InviteToken struct {
|
||||||
Model
|
Model
|
||||||
Token string
|
Token string
|
||||||
|
Deleted bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (str *Store) CreateInviteTokens(inviteTokens []*InviteToken, tx *sqlx.Tx) error {
|
func (str *Store) CreateInviteTokens(inviteTokens []*InviteToken, tx *sqlx.Tx) error {
|
||||||
|
@ -13,6 +13,7 @@ type PasswordResetRequest struct {
|
|||||||
Model
|
Model
|
||||||
Token string
|
Token string
|
||||||
AccountId int
|
AccountId int
|
||||||
|
Deleted bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *Store) CreatePasswordResetRequest(prr *PasswordResetRequest, tx *sqlx.Tx) (int, error) {
|
func (self *Store) CreatePasswordResetRequest(prr *PasswordResetRequest, tx *sqlx.Tx) (int, error) {
|
||||||
|
@ -16,6 +16,7 @@ type Share struct {
|
|||||||
FrontendEndpoint *string
|
FrontendEndpoint *string
|
||||||
BackendProxyEndpoint *string
|
BackendProxyEndpoint *string
|
||||||
Reserved bool
|
Reserved bool
|
||||||
|
Deleted bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *Store) CreateShare(envId int, shr *Share, tx *sqlx.Tx) (int, error) {
|
func (self *Store) CreateShare(envId int, shr *Share, tx *sqlx.Tx) (int, error) {
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
-- +migrate Up
|
||||||
|
|
||||||
|
alter table account_requests add column deleted boolean not null default(false);
|
||||||
|
alter table accounts add column deleted boolean not null default(false);
|
||||||
|
alter table environments add column deleted boolean not null default(false);
|
||||||
|
alter table frontends add column deleted boolean not null default(false);
|
||||||
|
alter table invite_tokens add column deleted boolean not null default(false);
|
||||||
|
alter table password_reset_requests add column deleted boolean not null default(false);
|
||||||
|
alter table shares add column deleted boolean not null default(false);
|
9
controller/store/sql/sqlite3/008_v0_4_0_soft_deletes.sql
Normal file
9
controller/store/sql/sqlite3/008_v0_4_0_soft_deletes.sql
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
-- +migrate Up
|
||||||
|
|
||||||
|
alter table account_requests add column deleted boolean not null default(false);
|
||||||
|
alter table accounts add column deleted boolean not null default(false);
|
||||||
|
alter table environments add column deleted boolean not null default(false);
|
||||||
|
alter table frontends add column deleted boolean not null default(false);
|
||||||
|
alter table invite_tokens add column deleted boolean not null default(false);
|
||||||
|
alter table password_reset_requests add column deleted boolean not null default(false);
|
||||||
|
alter table shares add column deleted boolean not null default(false);
|
@ -18,6 +18,7 @@ type Model struct {
|
|||||||
Id int
|
Id int
|
||||||
CreatedAt time.Time
|
CreatedAt time.Time
|
||||||
UpdatedAt time.Time
|
UpdatedAt time.Time
|
||||||
|
Deleted bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user