public void GenerateDefaultChildren(ServerVersion myDbServerVersion)
        {
            // MyDB database definition

            DatabaseDefinition mydbdd = new DatabaseDefinition(federation)
            {
                Name = Constants.MyDbName,
                System = federation.System,
                LayoutType = DatabaseLayoutType.Monolithic,
                DatabaseInstanceNamePattern = Constants.MyDbInstanceNamePattern,
                DatabaseNamePattern = Constants.MyDbNamePattern,
                SliceCount = 1,
                PartitionCount = 1,
            };
            mydbdd.Save();

            var mydbddi = new DatabaseDefinitionInstaller(mydbdd);
            mydbddi.GenerateDefaultChildren(myDbServerVersion, Constants.MyDbName);

            mydbdd.LoadDatabaseVersions(true);
            federation.MyDBDatabaseVersion = mydbdd.DatabaseVersions[Constants.MyDbName];

            // Job definitions
            var jd = new JobDefinition(federation)
            {
                Name = typeof(Jobs.ExportTable.ExportTableJob).Name,
                System = federation.System,
                WorkflowTypeName = typeof(Jobs.ExportTable.ExportTableJob).AssemblyQualifiedName,
            };
            jd.Save();

            jd = new JobDefinition(federation)
            {
                Name = typeof(Jobs.ExportTable.ExportMaintenanceJob).Name,
                System = federation.System,
                WorkflowTypeName = typeof(Jobs.ExportTable.ExportMaintenanceJob).AssemblyQualifiedName,
            };
            jd.Save();

            var jdi = new SqlQueryJobInstaller(federation);
            jdi.Install();

            federation.Save();
        }
        private void GenerateCodeDBDefinition(ServerVersion nodeServerVersion)
        {
            DatabaseDefinition codedbdd = new DatabaseDefinition(federation)
            {
                Name = Constants.CodeDbName,
                System = federation.System,
                LayoutType = DatabaseLayoutType.Mirrored,
                DatabaseInstanceNamePattern = Constants.CodeDbInstanceNamePattern,
                DatabaseNamePattern = Constants.CodeDbNamePattern,
                SliceCount = 1,
                PartitionCount = 1,
            };
            codedbdd.Save();

            var codedbddi = new DatabaseDefinitionInstaller(codedbdd);
            codedbddi.GenerateDefaultChildren(nodeServerVersion, Constants.CodeDbName);

            codedbdd.LoadDatabaseVersions(true);
            federation.CodeDatabaseVersion = codedbdd.DatabaseVersions[Constants.CodeDbName];
        }
        private void GenerateMyDBDefinition(ServerVersion myDbServerVersion)
        {
            DatabaseDefinition mydbdd = new DatabaseDefinition(federation)
            {
                Name = Constants.MyDbName,
                System = federation.System,
                LayoutType = DatabaseLayoutType.Monolithic,
                DatabaseInstanceNamePattern = Constants.MyDbInstanceNamePattern,
                DatabaseNamePattern = Constants.MyDbNamePattern,
                SliceCount = 1,
                PartitionCount = 1,
            };
            mydbdd.Save();

            var mydbddi = new DatabaseDefinitionInstaller(mydbdd);
            mydbddi.GenerateDefaultChildren(myDbServerVersion, Constants.MyDbName);

            mydbdd.LoadDatabaseVersions(true);
            federation.MyDBDatabaseVersion = mydbdd.DatabaseVersions[Constants.MyDbName];
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            item = new DatabaseDefinition(RegistryContext);
            item.Guid = new Guid(Request.QueryString["guid"]);
            item.Load();

            item.LoadDatabaseVersions(false);
            databaseVersions = new List<DatabaseVersion>(item.DatabaseVersions.Values);
            if (!IsPostBack)
            {
                RefreshDatabaseVersionList();
            }

            // Load currently selected database version
            databaseVersion = new DatabaseVersion(RegistryContext);
            databaseVersion.Guid = new Guid(databaseVersionList.SelectedValue);
            databaseVersion.Load();

            // Load server instances
            EntityFactory ef = new EntityFactory(RegistryContext);
            serverInstances = new List<ServerInstance>(ef.FindAll<ServerInstance>()
                .Where(i => i.ServerVersionReference.Guid == databaseVersion.ServerVersionReference.Guid)
                .OrderBy(i => i.Machine.Number));

            // Load slices
            item.LoadSlices(false);
            slices = new List<Slice>(item.Slices.Values);

            if (!IsPostBack)
            {
                UpdateForm();
            }

            GenerateTable();
        }