Nucleus .Net Core CMS

DatabaseSchemaScript Class

Namespace: Nucleus.Data.Common
Assembly: Nucleus.Data.Common.dll
The DatabaseSchemaScript class represents database upgrade script meta-data and content.

Constructor

Nucleus.Data.Common.DatabaseSchemaScript Constructor

Nucleus.Data.Common.DatabaseSchemaScript (String fullName, Version version, String content)
Represents a database schema update script.
Parameters
Name Type
fullName String

Script file name

version Version
content String

Properties

FullName Property

Script name (resource/file name)

Content Property

Script contents (sql commands)

Version Property

Script schema version. This is extracted from the filename.
Remarks
Script file names should consist of a three-part version number, with Major.Minor.Build separated by dots.

Methods

BuildManifestSchemaScript (Assembly,String,String) Method

BuildManifestSchemaScript (Assembly scriptsAssembly, String scriptNamespace, String resourceName)
Create a DatabaseSchemaScript object representing an embedded database script.
Parameters
Name Type
scriptsAssembly System.Reflection.Assembly
scriptNamespace String
resourceName String

Relative name of an embedded database script within the scripts namespace.

Returns
A DatabaseSchemaScript object

CanParseVersion (String,String) Method

CanParseVersion (String scriptNamespace, String resourceName)
Determine whether the filename of an embedded resource file is a version number.
Parameters
Name Type
scriptNamespace String
resourceName String

Name of an embedded database script.

ParseVersion (String) Method

ParseVersion (String resourceName)
Parse the filename of an embedded resource file and return its version number.
Parameters
Name Type
resourceName String

Name of an embedded database script.

Returns
System.Version containing the embedded script file version. The version is the file name without the file extension.