"Fossies" - the Fresh Open Source Software Archive

Member "nocodb-0.83.5/packages/nc-migrator-archived/README.md" (27 Nov 2021, 10816 Bytes) of package /linux/misc/nocodb-0.83.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

Install & setup

API Reference

Kind: global class
Extends: SqlMigrator

new KnexMigrator()

Class to create an instance of KnexMigrator

knexMigrator.init(args)

Initialises migration project Creates project json file in pwd of where command is run. Creates xmigrator folder in pwd, within which migrations for all dbs will be sored

Kind: instance method of KnexMigrator

Param Type Description
args object
args.type String type of database (mysql
args.title String Name of Project
args.folder String Project Dir

knexMigrator.sync()

Sync is called after init() or any change to config.xc.json file This initialises databases and migration tables within each connection of config.xc.json

Kind: instance method of KnexMigrator

knexMigrator.clean(args)

Kind: instance method of KnexMigrator

Param Type
args Object
args.env Object
args.dbAlias Object
args.json Object

knexMigrator.migrationsCreate(args) ⇒ object | String | String

Creates up and down migration files within migration folders

Kind: instance method of KnexMigrator
Returns: object - filesString - files.upString - files.down

Param Type Description
args object
args.dbAlias String Database alias within environment

knexMigrator.migrationsDelete(args) ⇒ String | String

Creates up and down migration files within migration folders

Kind: instance method of KnexMigrator
Returns: String - files.upString - files.down

Param Type
args object
args.env String
args.dbAlias String

knexMigrator.migrationsUp(args)

migrationsUp

Kind: instance method of KnexMigrator

Param Type Description
args object
args.env String
args.dbAlias String
args.folder String
args.steps Number number of steps to migrate
args.file String till which file to migration
args.sqlContentMigrate Number defaults to 1 , on zero sqlContent is ignored and only filenames are migrated to _evolution table

knexMigrator.migrationsDown(args)

migrationsDown

Kind: instance method of KnexMigrator

Param Type Description
args object
args.env String
args.dbAlias String
args.folder String
args.steps Number number of steps to migrate
args.file String till which file to migration
args.sqlContentMigrate Number defaults to 1 , on zero sqlContent is ignored and only filenames are migrated to _evolution table

knexMigrator.migrationsWrite(args)

Migrations write

Kind: instance method of KnexMigrator

Param Type Description
args *
args.env String
args.dbAlias String
args.folder String
args.upStatement Array.<Object> array of sql statements in obj
args.upStatement[].sql String sql statements without ';'
args.downStatement Array.<Object>
args.downStatement[].sql String sql statements without ';'
args.up String up filename - up filename (only name not entire path)
args.down String down filename - down filename (only name not entire path)

knexMigrator.migrationsList(args) ⇒ Object | Object | Object | String | String

Migrations List

Kind: instance method of KnexMigrator
Returns: Object - ResultObject - Result.dataObject - Result.data.objectString - Result.data.object.listString - Result.data.object.pending

Param Type Description
args object
args.env String
args.dbAlias String
args.steps Number number of steps to migrate
args.file String till which file to migration

knexMigrator.migrationsToSql(args) ⇒ Object | Object | Object | String | String

Migrations to SQL

Kind: instance method of KnexMigrator
Returns: Object - ResultObject - Result.dataObject - Result.data.objectString - Result.data.object.upString - Result.data.object.down

Param Type
args *
args.env String
args.dbAlias String
args.folder String

knexMigrator.migrationsSquash(args)

Migrations Squash

Kind: instance method of KnexMigrator

Param Type
args *
args.env String
args.dbAlias String
args.folder String
args.file String
args.steps String
args.up String
args.down String

knexMigrator.migrationsCreateManually(args)

Migrations Create Manual

Kind: instance method of KnexMigrator

Param Type
args *
args.env String
args.dbAlias String
args.folder String
args.file String
args.steps String
args.up String
args.down String

knexMigrator.migrationsRenameProjectKey(args) ⇒ Result

Kind: instance method of KnexMigrator

Param Type Description
args
args.folder String defaults to process.cwd()
args.key String
args.value String

knexMigrator.migrationsCreateEnv(args) ⇒ Promise.<void>

update json update sqlite project reopen

Kind: instance method of KnexMigrator

Param Type
args
args.folder String
args.env String
args.envValue String

knexMigrator.migrationsDeleteEnv(args) ⇒ Promise.<void>

update json update sqlite project reopen

Kind: instance method of KnexMigrator

Param Type
args
args.folder String
args.env String

knexMigrator.migrationsCreateEnvDb(args) ⇒ Result

Kind: instance method of KnexMigrator

Param Type
args
args.folder String
args.env String
args.db String

KnexMigrator.KnexMigrator

Kind: static class of KnexMigrator

new KnexMigrator()

Creates an instance of KnexMigrator.

test