First create solution
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
Folder Description
|
||||
|
||||
The "DatabaseUpdate" project folder is intended for storing code that supplies
|
||||
initial data (default User objects, embedded Reports, etc) and handles a database
|
||||
update when the application version changes.
|
||||
|
||||
|
||||
Relevant Documentation
|
||||
|
||||
Supply Initial Data
|
||||
https://documentation.devexpress.com/eXpressAppFramework/CustomDocument112788.aspx
|
||||
|
||||
Distribute the Created Reports with the Application
|
||||
https://documentation.devexpress.com/eXpressAppFramework/CustomDocument112786.aspx
|
||||
|
||||
How to: Update the Database Structure after the Persistent Class or Property Was Renamed or Removed
|
||||
https://documentation.devexpress.com/eXpressAppFramework/CustomDocument113254.aspx
|
||||
|
||||
ModuleUpdater Class
|
||||
https://documentation.devexpress.com/eXpressAppFramework/clsDevExpressExpressAppUpdatingModuleUpdatertopic.aspx
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using DevExpress.ExpressApp;
|
||||
using DevExpress.Data.Filtering;
|
||||
using DevExpress.Persistent.Base;
|
||||
using DevExpress.ExpressApp.Updating;
|
||||
using DevExpress.Xpo;
|
||||
using DevExpress.ExpressApp.Xpo;
|
||||
using DevExpress.Persistent.BaseImpl;
|
||||
|
||||
namespace Nuvolar.Module.Web.CSharp.DatabaseUpdate {
|
||||
// For more typical usage scenarios, be sure to check out https://documentation.devexpress.com/eXpressAppFramework/clsDevExpressExpressAppUpdatingModuleUpdatertopic.aspx
|
||||
public class Updater : ModuleUpdater {
|
||||
public Updater(IObjectSpace objectSpace, Version currentDBVersion) :
|
||||
base(objectSpace, currentDBVersion) {
|
||||
}
|
||||
public override void UpdateDatabaseAfterUpdateSchema() {
|
||||
base.UpdateDatabaseAfterUpdateSchema();
|
||||
//string name = "MyName";
|
||||
//DomainObject1 theObject = ObjectSpace.FindObject<DomainObject1>(CriteriaOperator.Parse("Name=?", name));
|
||||
//if(theObject == null) {
|
||||
// theObject = ObjectSpace.CreateObject<DomainObject1>();
|
||||
// theObject.Name = name;
|
||||
//}
|
||||
}
|
||||
public override void UpdateDatabaseBeforeUpdateSchema() {
|
||||
base.UpdateDatabaseBeforeUpdateSchema();
|
||||
//if(CurrentDBVersion < new Version("1.1.0.0") && CurrentDBVersion > new Version("0.0.0.0")) {
|
||||
// RenameColumn("DomainObject1Table", "OldColumnName", "NewColumnName");
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user