mirror of
https://github.com/jsiebens/ionscale.git
synced 2026-03-31 15:07:49 +01:00
feat: add support for https certs
This commit is contained in:
@@ -20,7 +20,7 @@ func m202209070900_initial_schema() *gormigrate.Migration {
|
||||
|
||||
type Tailnet struct {
|
||||
ID uint64 `gorm:"primary_key;autoIncrement:false"`
|
||||
Name string `gorm:"type:varchar(64);unique_index"`
|
||||
Name string `gorm:"type:varchar(64);uniqueIndex"`
|
||||
DNSConfig domain.DNSConfig
|
||||
IAMPolicy domain.IAMPolicy
|
||||
ACLPolicy domain.ACLPolicy
|
||||
@@ -44,7 +44,7 @@ func m202209070900_initial_schema() *gormigrate.Migration {
|
||||
|
||||
type SystemApiKey struct {
|
||||
ID uint64 `gorm:"primary_key;autoIncrement:false"`
|
||||
Key string `gorm:"type:varchar(64);unique_index"`
|
||||
Key string `gorm:"type:varchar(64);uniqueIndex"`
|
||||
Hash string
|
||||
|
||||
CreatedAt time.Time
|
||||
@@ -56,7 +56,7 @@ func m202209070900_initial_schema() *gormigrate.Migration {
|
||||
|
||||
type ApiKey struct {
|
||||
ID uint64 `gorm:"primary_key;autoIncrement:false"`
|
||||
Key string `gorm:"type:varchar(64);unique_index"`
|
||||
Key string `gorm:"type:varchar(64);uniqueIndex"`
|
||||
Hash string
|
||||
|
||||
CreatedAt time.Time
|
||||
@@ -71,7 +71,7 @@ func m202209070900_initial_schema() *gormigrate.Migration {
|
||||
|
||||
type AuthKey struct {
|
||||
ID uint64 `gorm:"primary_key;autoIncrement:false"`
|
||||
Key string `gorm:"type:varchar(64);unique_index"`
|
||||
Key string `gorm:"type:varchar(64);uniqueIndex"`
|
||||
Hash string
|
||||
Ephemeral bool
|
||||
Tags domain.Tags
|
||||
@@ -118,7 +118,7 @@ func m202209070900_initial_schema() *gormigrate.Migration {
|
||||
|
||||
type RegistrationRequest struct {
|
||||
MachineKey string `gorm:"primary_key;autoIncrement:false"`
|
||||
Key string `gorm:"type:varchar(64);unique_index"`
|
||||
Key string `gorm:"type:varchar(64);uniqueIndex"`
|
||||
Data domain.RegistrationRequestData
|
||||
CreatedAt time.Time
|
||||
Authenticated bool
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"github.com/go-gormigrate/gormigrate/v2"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func m202229251530_add_alias_column() *gormigrate.Migration {
|
||||
return &gormigrate.Migration{
|
||||
ID: "202229251530a",
|
||||
Migrate: func(db *gorm.DB) error {
|
||||
type Tailnet struct {
|
||||
Alias *string `gorm:"type:varchar(64)"`
|
||||
}
|
||||
|
||||
return db.AutoMigrate(
|
||||
&Tailnet{},
|
||||
)
|
||||
},
|
||||
Rollback: nil,
|
||||
}
|
||||
}
|
||||
|
||||
func m202229251530_add_alias_column_constraint() *gormigrate.Migration {
|
||||
return &gormigrate.Migration{
|
||||
ID: "202229251530b",
|
||||
Migrate: func(db *gorm.DB) error {
|
||||
type Tailnet struct {
|
||||
Name string `gorm:"uniqueIndex"`
|
||||
Alias *string `gorm:"uniqueIndex"`
|
||||
}
|
||||
|
||||
return db.AutoMigrate(
|
||||
&Tailnet{},
|
||||
)
|
||||
},
|
||||
Rollback: nil,
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,8 @@ func Migrations() []*gormigrate.Migration {
|
||||
var migrations = []*gormigrate.Migration{
|
||||
m202209070900_initial_schema(),
|
||||
m202209251530_add_autoallowips_column(),
|
||||
m202229251530_add_alias_column(),
|
||||
m202229251530_add_alias_column_constraint(),
|
||||
}
|
||||
return migrations
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user