migrate

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoesCollectionExist

func DoesCollectionExist(client *mongo.Client, collectionName string) bool

DoesCollectionExist checks if a collection exists in the MongoDB database.

Parameters: - client: The MongoDB client. - collectionName: The name of the collection to check.

Returns: - bool: true if the collection exists, false otherwise.

func DoesTableExist

func DoesTableExist(db *gorm.DB, tableName string) bool

DoesTableExist checks if a table exists in the database.

Parameters: - db: a pointer to a gorm.DB object representing the database connection. - tableName: a string representing the name of the table to check.

Returns: - a boolean value indicating whether the table exists or not.

func GetDbName

func GetDbName() string

GetDbName returns the name of the MongoDB database.

It does not take any parameters. It returns a string representing the name of the database.

func MigrateMongo

func MigrateMongo(client *mongo.Client) error

MigrateMongo migrates the MongoDB collections and creates necessary indexes.

It takes a *mongo.Client as a parameter. It returns an error if any error occurred during the migration process.

func MigrateSql

func MigrateSql(db *gorm.DB) error

MigrateSql migrates the SQL tables.

db: the gorm.DB connection. Returns: an error if there was a problem during migration.

Types

This section is empty.

Jump to

Keyboard shortcuts

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