mirror of
https://github.com/openziti/zrok.git
synced 2025-01-22 05:48:46 +01:00
add reserved column to frontends table (#41)
This commit is contained in:
parent
65d1539182
commit
189ed81718
@ -11,15 +11,16 @@ type Frontend struct {
|
||||
Name string
|
||||
ZId string
|
||||
PublicName *string
|
||||
Reserved bool
|
||||
}
|
||||
|
||||
func (str *Store) CreateFrontend(envId int, f *Frontend, tx *sqlx.Tx) (int, error) {
|
||||
stmt, err := tx.Prepare("insert into frontends (environment_id, name, z_id, public_name) values ($1, $2, $3, $4) returning id")
|
||||
stmt, err := tx.Prepare("insert into frontends (environment_id, name, z_id, public_name, reserved) values ($1, $2, $3, $4, $5) returning id")
|
||||
if err != nil {
|
||||
return 0, errors.Wrap(err, "error preparing frontends insert statement")
|
||||
}
|
||||
var id int
|
||||
if err := stmt.QueryRow(envId, f.Name, f.ZId, f.PublicName).Scan(&id); err != nil {
|
||||
if err := stmt.QueryRow(envId, f.Name, f.ZId, f.PublicName, f.Reserved).Scan(&id); err != nil {
|
||||
return 0, errors.Wrap(err, "error executing frontends insert statement")
|
||||
}
|
||||
return id, nil
|
||||
|
@ -6,6 +6,7 @@ create table frontends (
|
||||
name varchar(32) not null unique,
|
||||
z_id varchar(32) not null unique,
|
||||
public_name varchar(64) unique,
|
||||
reserved boolean not null default(false),
|
||||
created_at timestamptz not null default(current_timestamp),
|
||||
updated_at timestamptz not null default(current_timestamp)
|
||||
);
|
||||
|
@ -23,6 +23,7 @@ create table frontends (
|
||||
name varchar(32) not null unique,
|
||||
z_id varchar(32) not null unique,
|
||||
public_name varchar(64) unique,
|
||||
reserved boolean not null default(false),
|
||||
created_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')),
|
||||
updated_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now'))
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user