Nucleus .Net Core CMS

DataProviderMigration Class

Namespace: Nucleus.Data.Common
Assembly: Nucleus.Data.Common.dll
Provides a migration implementation for the database provider specified by T.
Retrieves a list of embedded data migration scripts.
Identifies the assembly which contains embedded database migration scripts. The default value is the assembly which contains your DataProviderMigration implementation.
Namespace of the embedded schema scripts.
Remarks
The default value for SchemaScriptsNamespace is the namespace of the class which inherits this class, followed by the database type, or 'Migrations' for database-agnostic screens, with a ".Scripts." suffix. Add your scripts to the DataProvider/database-type/scripts folder where database-type is 'Migrations', or the name of the data provider that the script is for (Sqlite, MySql, SqlServer or PostgreSql). Scripts must have a ".sql" extension or a ".json" extension. This value is not case-sensitive.
CheckDatabaseSchema ()
Compare the stored schema version from the database with the versions of the available schema scripts retrieved by .SchemaScripts. If any have not been applied, apply them in order (sorted by version, lowest-to-highest)
DatabaseObjectExists (String name, DatabaseObjectTypes type)
Checks whether the specified database object exists.
GetSchemaVersion (String schemaName)
Retrieve the version number of the latest schema update that has been applied for the specified schema name.
Parameters
Name Type
schemaName String
Remarks
If no schema entry exists for the specified schema name, this function returns version 0.0.0.0.
RunDatabaseScripts (String schemaName, Version currentSchemaVersion, IList<DatabaseSchemaScript> scripts)
Execute all scripts which have a version greater than the current schema version.
Parameters
Name Type
schemaName String
currentSchemaVersion Version
scripts System.Collections.Generic.IList<Nucleus.Data.Common.DatabaseSchemaScript>