db

package
v0.0.0-...-4d10510 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSetUp

func IsSetUp(ctx context.Context, client *ent.Client) (bool, error)

IsSetUp checks if the database has previously been set up.

func PrintMigration

func PrintMigration(ctx context.Context, client *ent.Client) error

PrintMigration prints the upcoming migration to stdout.

func SetUp

func SetUp(ctx context.Context, client *ent.Client, createAdmin bool, initPasswd string) error

SetUp attempts to automatically migrate DB schema and creates the set-up record indicating that the DB has been set up. Optionally and only if the DB has not been set up prior, it creates and admin user with the initPasswd and the default username and email (see ../user/const.go).

Types

type CtxKey

type CtxKey struct{}

CtxKey serves as a key to context values for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL