mirror of
https://github.com/openziti/zrok.git
synced 2024-12-22 14:50:55 +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
|
||||
Token string
|
||||
Limitless bool
|
||||
Deleted bool
|
||||
}
|
||||
|
||||
func (self *Store) CreateAccount(a *Account, tx *sqlx.Tx) (int, error) {
|
||||
|
@ -14,6 +14,7 @@ type AccountRequest struct {
|
||||
Token string
|
||||
Email string
|
||||
SourceAddress string
|
||||
Deleted bool
|
||||
}
|
||||
|
||||
func (self *Store) CreateAccountRequest(ar *AccountRequest, tx *sqlx.Tx) (int, error) {
|
||||
|
@ -12,6 +12,7 @@ type Environment struct {
|
||||
Host string
|
||||
Address string
|
||||
ZId string
|
||||
Deleted bool
|
||||
}
|
||||
|
||||
func (self *Store) CreateEnvironment(accountId int, i *Environment, tx *sqlx.Tx) (int, error) {
|
||||
|
@ -13,6 +13,7 @@ type Frontend struct {
|
||||
PublicName *string
|
||||
UrlTemplate *string
|
||||
Reserved bool
|
||||
Deleted bool
|
||||
}
|
||||
|
||||
func (str *Store) CreateFrontend(envId int, f *Frontend, tx *sqlx.Tx) (int, error) {
|
||||
|
@ -11,6 +11,7 @@ import (
|
||||
type InviteToken struct {
|
||||
Model
|
||||
Token string
|
||||
Deleted bool
|
||||
}
|
||||
|
||||
func (str *Store) CreateInviteTokens(inviteTokens []*InviteToken, tx *sqlx.Tx) error {
|
||||
|
@ -13,6 +13,7 @@ type PasswordResetRequest struct {
|
||||
Model
|
||||
Token string
|
||||
AccountId int
|
||||
Deleted bool
|
||||
}
|
||||
|
||||
func (self *Store) CreatePasswordResetRequest(prr *PasswordResetRequest, tx *sqlx.Tx) (int, error) {
|
||||
|
@ -16,6 +16,7 @@ type Share struct {
|
||||
FrontendEndpoint *string
|
||||
BackendProxyEndpoint *string
|
||||
Reserved bool
|
||||
Deleted bool
|
||||
}
|
||||
|
||||
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
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
Deleted bool
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
|
Loading…
Reference in New Issue
Block a user