- Timestamp:
- 09/25/17 14:45:14 (7 years ago)
- Location:
- branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml
r14748 r15378 1 1 <?xml version="1.0" encoding="utf-8"?><Database Name="HeuristicLab.Hive" Class="HiveDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007"> 2 <Connection Mode="AppSettings" ConnectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Hive-3.3" SettingsObjectName="HeuristicLab.Services.Hive.DataAccess.Settings" SettingsPropertyName="HeuristicLab_Hive_LinqConnectionString" Provider="System.Data.SqlClient" /> 3 <Table Name="dbo.AssignedResources" Member="AssignedResources"> 2 <Table Name="dbo.AssignedResource" Member="AssignedResources"> 4 3 <Type Name="AssignedResource"> 5 4 <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" /> 6 <Column Name=" TaskId" Storage="_JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />5 <Column Name="ProjectId" Storage="_JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" /> 7 6 <Association Name="Resource_AssignedResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" /> 8 <Association Name=" Task_AssignedResource" Member="Task" Storage="_Job" ThisKey="TaskId" OtherKey="TaskId" Type="Task" IsForeignKey="true" DeleteRule="CASCADE" />7 <Association Name="Project_AssignedResource" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" DeleteRule="CASCADE" /> 9 8 </Type> 10 9 </Table> … … 76 75 <Column Name="Command" Type="global::HeuristicLab.Services.Hive.DataAccess.Command?" DbType="VarChar(30)" CanBeNull="true" /> 77 76 <Column Name="JobId" Storage="_HiveExperimentId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" /> 78 <Association Name="Task_AssignedResource" Member="AssignedResources" ThisKey="TaskId" OtherKey="TaskId" Type="AssignedResource" />79 77 <Association Name="Task_RequiredPlugin" Member="RequiredPlugins" ThisKey="TaskId" OtherKey="TaskId" Type="RequiredPlugin" /> 80 78 <Association Name="Task_Task" Member="ChildJobs" Storage="_Jobs" ThisKey="TaskId" OtherKey="ParentTaskId" Type="Task" /> … … 106 104 <Column Name="OwnerUserId" Storage="_UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" /> 107 105 <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="false" /> 106 <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" /> 108 107 <Association Name="Job_Task" Member="Tasks" Storage="_Jobs" ThisKey="JobId" OtherKey="JobId" Type="Task" /> 109 108 <Association Name="Job_JobPermission" Member="JobPermissions" Storage="_HiveExperimentPermissions" ThisKey="JobId" OtherKey="JobId" Type="JobPermission" /> 109 <Association Name="Project_Job" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" /> 110 110 </Type> 111 111 </Table> … … 240 240 <Column Name="ClientId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" /> 241 241 <Column Name="Time" Type="System.DateTime" DbType="DateTime NOT NULL" IsPrimaryKey="true" CanBeNull="false" /> 242 <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier N ULL" IsPrimaryKey="true" CanBeNull="false" />242 <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" /> 243 243 <Column Name="NumUsedCores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" /> 244 244 <Column Name="NumTotalCores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" /> … … 256 256 </Type> 257 257 </Table> 258 <Table Name="dbo.Project" Member="Projects"> 259 <Type Name="Project"> 260 <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" /> 261 <Column Name="ParentProjectId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" /> 262 <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" /> 263 <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" /> 264 <Column Name="Description" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" /> 265 <Column Name="OwnerUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" /> 266 <Column Name="StartDate" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" /> 267 <Column Name="EndDate" Type="System.DateTime" DbType="DateTime" CanBeNull="false" /> 268 <Association Name="Project_AssignedResource" Member="AssignedResources" ThisKey="ProjectId" OtherKey="ProjectId" Type="AssignedResource" /> 269 <Association Name="Project_Job" Member="Jobs" ThisKey="ProjectId" OtherKey="ProjectId" Type="Job" /> 270 <Association Name="Project_Project" Member="ChildProjects" Storage="_Projects" ThisKey="ProjectId" OtherKey="ParentProjectId" Type="Project" /> 271 <Association Name="Project_ProjectPermission" Member="ProjectPermissions" ThisKey="ProjectId" OtherKey="ProjectId" Type="ProjectPermission" /> 272 <Association Name="Project_Project" Member="ParentProject" Storage="_Project1" ThisKey="ParentProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" /> 273 </Type> 274 </Table> 275 <Table Name="dbo.ProjectPermission" Member="ProjectPermissions"> 276 <Type Name="ProjectPermission"> 277 <Column Name="ProjectId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" /> 278 <Column Name="GrantedUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" /> 279 <Column Name="GrantedByUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" /> 280 <Association Name="Project_ProjectPermission" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" /> 281 </Type> 282 </Table> 258 283 </Database> -
branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout
r12926 r15378 1 1 <?xml version="1.0" encoding="utf-8"?> 2 <ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 1 5.75, 17.875" name="HiveDataContext">2 <ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 16.25, 17.875" name="HiveDataContext"> 3 3 <DataContextMoniker Name="/HiveDataContext" /> 4 4 <nestedChildShapes> 5 <classShape Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" absoluteBounds=" 8.875, 4.5, 2, 1.1939925130208327">5 <classShape Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" absoluteBounds="13.875, 8.25, 2, 1.1939925130208327"> 6 6 <DataClassMoniker Name="/HiveDataContext/AssignedResource" /> 7 7 <nestedChildShapes> 8 <elementListCompartment Id="8b005775-f0ee-41b0-ae10-6d1151003708" absoluteBounds=" 8.89, 4.9600000000000009, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />8 <elementListCompartment Id="8b005775-f0ee-41b0-ae10-6d1151003708" absoluteBounds="13.89, 8.71, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 9 9 </nestedChildShapes> 10 10 </classShape> … … 39 39 </nestedChildShapes> 40 40 </classShape> 41 <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.125, 2.625, 2, 1.9631982421874996">41 <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.125, 2.625, 2, 2.1554996744791666"> 42 42 <DataClassMoniker Name="/HiveDataContext/Job" /> 43 43 <nestedChildShapes> 44 <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.1400000000000006, 3.0850000000000009, 1.9700000000000002, 1. 4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />44 <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.1400000000000006, 3.0850000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 45 45 </nestedChildShapes> 46 46 </classShape> … … 69 69 </nodes> 70 70 </inheritanceConnector> 71 <associationConnector edgePoints="[(1 1.8134963640734 : 2.9631982421875); (11.8134963640734 : 3.56770833333333); (11.1119791666667 : 3.56770833333333); (11.1119791666667 : 5.09699625651042); (10.875 : 5.09699625651042)]" manuallyRouted="true" fixedFrom="NotFixed" fixedTo="NotFixed">71 <associationConnector edgePoints="[(13.25 : 2.15469482421875); (15.71875 : 2.15469482421875); (15.71875 : 8.25)]" manuallyRouted="true" fixedFrom="NotFixed" fixedTo="NotFixed"> 72 72 <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedResource" /> 73 73 <nodes> … … 141 141 </nodes> 142 142 </associationConnector> 143 <associationConnector edgePoints="[(8.5 : 4.1170068359375); (8.875 : 4.5)]" fixedFrom="NotFixed" fixedTo="NotFixed">144 <AssociationMoniker Name="/HiveDataContext/Task/Task_AssignedResource" />145 <nodes>146 <classShapeMoniker Id="695bfc39-59f3-4e60-8644-f847964bf62c" />147 <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" />148 </nodes>149 </associationConnector>150 143 <associationConnector edgePoints="[(7.4687475 : 4.1170068359375); (7.4687475 : 5.875)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 151 144 <AssociationMoniker Name="/HiveDataContext/Task/Task_RequiredPlugin" /> … … 183 176 </nodes> 184 177 </associationConnector> 185 <associationConnector edgePoints="[(4.125 : 4. 10659912109375); (3.75 : 4.10659912109375)]" fixedFrom="NotFixed" fixedTo="NotFixed">178 <associationConnector edgePoints="[(4.125 : 4.20274983723958); (3.75 : 4.20274983723958)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 186 179 <AssociationMoniker Name="/HiveDataContext/Job/Job_JobPermission" /> 187 180 <nodes> … … 280 273 </nodes> 281 274 </associationConnector> 275 <classShape Id="30778876-b5f6-4a97-9ec7-792011973d75" absoluteBounds="11.25, 8.25, 2, 2.3478011067708344"> 276 <DataClassMoniker Name="/HiveDataContext/Project" /> 277 <nestedChildShapes> 278 <elementListCompartment Id="2c8b0555-6cea-4cc9-b028-2d066c02401c" absoluteBounds="11.265, 8.71, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 279 </nestedChildShapes> 280 </classShape> 281 <associationConnector edgePoints="[(11.9592307692308 : 10.5978011067708); (11.9592307692308 : 10.8478011067708); (12.5546153846154 : 10.8478011067708); (12.5546153846154 : 10.5978011067708)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 282 <AssociationMoniker Name="/HiveDataContext/Project/Project_Project" /> 283 <nodes> 284 <classShapeMoniker Id="30778876-b5f6-4a97-9ec7-792011973d75" /> 285 <classShapeMoniker Id="30778876-b5f6-4a97-9ec7-792011973d75" /> 286 </nodes> 287 </associationConnector> 288 <classShape Id="1c20ff2a-adeb-4830-9456-9a2a3e11cee3" absoluteBounds="13.875, 9.875, 2, 1.3862939453125005"> 289 <DataClassMoniker Name="/HiveDataContext/ProjectPermission" /> 290 <nestedChildShapes> 291 <elementListCompartment Id="d115744c-dfef-4a5d-9b9a-30efc6ef4423" absoluteBounds="13.89, 10.335, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 292 </nestedChildShapes> 293 </classShape> 294 <associationConnector edgePoints="[(13.25 : 10.2364005533854); (13.875 : 10.2364005533854)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 295 <AssociationMoniker Name="/HiveDataContext/Project/Project_ProjectPermission" /> 296 <nodes> 297 <classShapeMoniker Id="30778876-b5f6-4a97-9ec7-792011973d75" /> 298 <classShapeMoniker Id="1c20ff2a-adeb-4830-9456-9a2a3e11cee3" /> 299 </nodes> 300 </associationConnector> 301 <associationConnector edgePoints="[(13.25 : 8.84699625651042); (13.875 : 8.84699625651042)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 302 <AssociationMoniker Name="/HiveDataContext/Project/Project_AssignedResource" /> 303 <nodes> 304 <classShapeMoniker Id="30778876-b5f6-4a97-9ec7-792011973d75" /> 305 <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" /> 306 </nodes> 307 </associationConnector> 308 <associationConnector edgePoints="[(11.25 : 9.42390055338542); (10.375 : 9.42390055338542); (10.375 : 8); (4 : 8); (4 : 5.15549967447917); (5.125 : 5.15549967447917); (5.125 : 4.78049967447917)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 309 <AssociationMoniker Name="/HiveDataContext/Project/Project_Job" /> 310 <nodes> 311 <classShapeMoniker Id="30778876-b5f6-4a97-9ec7-792011973d75" /> 312 <classShapeMoniker Id="e6f840cc-2968-4be1-b234-eef624ccacbb" /> 313 </nodes> 314 </associationConnector> 282 315 </nestedChildShapes> 283 316 </ordesignerObjectsDiagram> -
branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs
r12926 r15378 3 3 // <auto-generated> 4 4 // This code was generated by a tool. 5 // Runtime Version:4.0.30319. 342095 // Runtime Version:4.0.30319.42000 6 6 // 7 7 // Changes to this file may cause incorrect behavior and will be lost if … … 91 91 partial void UpdateFactClientInfo(FactClientInfo instance); 92 92 partial void DeleteFactClientInfo(FactClientInfo instance); 93 partial void InsertProject(Project instance); 94 partial void UpdateProject(Project instance); 95 partial void DeleteProject(Project instance); 96 partial void InsertProjectPermission(ProjectPermission instance); 97 partial void UpdateProjectPermission(ProjectPermission instance); 98 partial void DeleteProjectPermission(ProjectPermission instance); 93 99 #endregion 94 95 public HiveDataContext() :96 base(global::HeuristicLab.Services.Hive.DataAccess.Settings.Default.HeuristicLab_Hive_LinqConnectionString, mappingSource)97 {98 OnCreated();99 }100 100 101 101 public HiveDataContext(string connection) : … … 282 282 } 283 283 } 284 285 public System.Data.Linq.Table<Project> Projects 286 { 287 get 288 { 289 return this.GetTable<Project>(); 290 } 291 } 292 293 public System.Data.Linq.Table<ProjectPermission> ProjectPermissions 294 { 295 get 296 { 297 return this.GetTable<ProjectPermission>(); 298 } 299 } 284 300 } 285 301 286 [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.AssignedResource s")]302 [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.AssignedResource")] 287 303 public partial class AssignedResource : INotifyPropertyChanging, INotifyPropertyChanged 288 304 { … … 296 312 private EntityRef<Resource> _Resource; 297 313 298 private EntityRef< Task> _Job;314 private EntityRef<Project> _Project; 299 315 300 316 #region Extensibility Method Definitions … … 304 320 partial void OnResourceIdChanging(System.Guid value); 305 321 partial void OnResourceIdChanged(); 306 partial void On TaskIdChanging(System.Guid value);307 partial void On TaskIdChanged();322 partial void OnProjectIdChanging(System.Guid value); 323 partial void OnProjectIdChanged(); 308 324 #endregion 309 325 … … 311 327 { 312 328 this._Resource = default(EntityRef<Resource>); 313 this._ Job = default(EntityRef<Task>);329 this._Project = default(EntityRef<Project>); 314 330 OnCreated(); 315 331 } … … 340 356 341 357 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_JobId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)] 342 public System.Guid TaskId358 public System.Guid ProjectId 343 359 { 344 360 get … … 350 366 if ((this._JobId != value)) 351 367 { 352 if (this._ Job.HasLoadedOrAssignedValue)368 if (this._Project.HasLoadedOrAssignedValue) 353 369 { 354 370 throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); 355 371 } 356 this.On TaskIdChanging(value);372 this.OnProjectIdChanging(value); 357 373 this.SendPropertyChanging(); 358 374 this._JobId = value; 359 this.SendPropertyChanged(" TaskId");360 this.On TaskIdChanged();375 this.SendPropertyChanged("ProjectId"); 376 this.OnProjectIdChanged(); 361 377 } 362 378 } … … 397 413 } 398 414 399 [global::System.Data.Linq.Mapping.AssociationAttribute(Name=" Task_AssignedResource", Storage="_Job", ThisKey="TaskId", OtherKey="TaskId", IsForeignKey=true, DeleteRule="CASCADE")]400 public Task Task401 { 402 get 403 { 404 return this._ Job.Entity;405 } 406 set 407 { 408 Task previousValue = this._Job.Entity;415 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_AssignedResource", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteRule="CASCADE")] 416 public Project Project 417 { 418 get 419 { 420 return this._Project.Entity; 421 } 422 set 423 { 424 Project previousValue = this._Project.Entity; 409 425 if (((previousValue != value) 410 || (this._ Job.HasLoadedOrAssignedValue == false)))426 || (this._Project.HasLoadedOrAssignedValue == false))) 411 427 { 412 428 this.SendPropertyChanging(); 413 429 if ((previousValue != null)) 414 430 { 415 this._ Job.Entity = null;431 this._Project.Entity = null; 416 432 previousValue.AssignedResources.Remove(this); 417 433 } 418 this._ Job.Entity = value;434 this._Project.Entity = value; 419 435 if ((value != null)) 420 436 { 421 437 value.AssignedResources.Add(this); 422 this._JobId = value. TaskId;438 this._JobId = value.ProjectId; 423 439 } 424 440 else … … 426 442 this._JobId = default(System.Guid); 427 443 } 428 this.SendPropertyChanged(" Task");444 this.SendPropertyChanged("Project"); 429 445 } 430 446 } … … 1620 1636 private System.Guid _HiveExperimentId; 1621 1637 1622 private EntitySet<AssignedResource> _AssignedResources;1623 1624 1638 private EntitySet<RequiredPlugin> _RequiredPlugins; 1625 1639 … … 1666 1680 public Task() 1667 1681 { 1668 this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources));1669 1682 this._RequiredPlugins = new EntitySet<RequiredPlugin>(new Action<RequiredPlugin>(this.attach_RequiredPlugins), new Action<RequiredPlugin>(this.detach_RequiredPlugins)); 1670 1683 this._Jobs = new EntitySet<Task>(new Action<Task>(this.attach_Jobs), new Action<Task>(this.detach_Jobs)); … … 1924 1937 } 1925 1938 1926 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Task_AssignedResource", Storage="_AssignedResources", ThisKey="TaskId", OtherKey="TaskId")]1927 public EntitySet<AssignedResource> AssignedResources1928 {1929 get1930 {1931 return this._AssignedResources;1932 }1933 set1934 {1935 this._AssignedResources.Assign(value);1936 }1937 }1938 1939 1939 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Task_RequiredPlugin", Storage="_RequiredPlugins", ThisKey="TaskId", OtherKey="TaskId")] 1940 1940 public EntitySet<RequiredPlugin> RequiredPlugins … … 2091 2091 this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); 2092 2092 } 2093 }2094 2095 private void attach_AssignedResources(AssignedResource entity)2096 {2097 this.SendPropertyChanging();2098 entity.Task = this;2099 }2100 2101 private void detach_AssignedResources(AssignedResource entity)2102 {2103 this.SendPropertyChanging();2104 entity.Task = null;2105 2093 } 2106 2094 … … 2431 2419 private System.DateTime _DateCreated; 2432 2420 2421 private System.Guid _ProjectId; 2422 2433 2423 private EntitySet<Task> _Jobs; 2434 2424 2435 2425 private EntitySet<JobPermission> _HiveExperimentPermissions; 2426 2427 private EntityRef<Project> _Project; 2436 2428 2437 2429 #region Extensibility Method Definitions … … 2451 2443 partial void OnDateCreatedChanging(System.DateTime value); 2452 2444 partial void OnDateCreatedChanged(); 2445 partial void OnProjectIdChanging(System.Guid value); 2446 partial void OnProjectIdChanged(); 2453 2447 #endregion 2454 2448 … … 2457 2451 this._Jobs = new EntitySet<Task>(new Action<Task>(this.attach_Jobs), new Action<Task>(this.detach_Jobs)); 2458 2452 this._HiveExperimentPermissions = new EntitySet<JobPermission>(new Action<JobPermission>(this.attach_HiveExperimentPermissions), new Action<JobPermission>(this.detach_HiveExperimentPermissions)); 2453 this._Project = default(EntityRef<Project>); 2459 2454 OnCreated(); 2460 2455 } … … 2580 2575 } 2581 2576 2577 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="UniqueIdentifier NOT NULL")] 2578 public System.Guid ProjectId 2579 { 2580 get 2581 { 2582 return this._ProjectId; 2583 } 2584 set 2585 { 2586 if ((this._ProjectId != value)) 2587 { 2588 if (this._Project.HasLoadedOrAssignedValue) 2589 { 2590 throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); 2591 } 2592 this.OnProjectIdChanging(value); 2593 this.SendPropertyChanging(); 2594 this._ProjectId = value; 2595 this.SendPropertyChanged("ProjectId"); 2596 this.OnProjectIdChanged(); 2597 } 2598 } 2599 } 2600 2582 2601 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Job_Task", Storage="_Jobs", ThisKey="JobId", OtherKey="JobId")] 2583 2602 public EntitySet<Task> Tasks … … 2603 2622 { 2604 2623 this._HiveExperimentPermissions.Assign(value); 2624 } 2625 } 2626 2627 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_Job", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] 2628 public Project Project 2629 { 2630 get 2631 { 2632 return this._Project.Entity; 2633 } 2634 set 2635 { 2636 Project previousValue = this._Project.Entity; 2637 if (((previousValue != value) 2638 || (this._Project.HasLoadedOrAssignedValue == false))) 2639 { 2640 this.SendPropertyChanging(); 2641 if ((previousValue != null)) 2642 { 2643 this._Project.Entity = null; 2644 previousValue.Jobs.Remove(this); 2645 } 2646 this._Project.Entity = value; 2647 if ((value != null)) 2648 { 2649 value.Jobs.Add(this); 2650 this._ProjectId = value.ProjectId; 2651 } 2652 else 2653 { 2654 this._ProjectId = default(System.Guid); 2655 } 2656 this.SendPropertyChanged("Project"); 2657 } 2605 2658 } 2606 2659 } … … 5261 5314 } 5262 5315 5263 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier N ULL", IsPrimaryKey=true)]5316 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)] 5264 5317 public System.Guid UserId 5265 5318 { … … 5607 5660 } 5608 5661 } 5662 5663 [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Project")] 5664 public partial class Project : INotifyPropertyChanging, INotifyPropertyChanged 5665 { 5666 5667 private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); 5668 5669 private System.Guid _ProjectId; 5670 5671 private System.Nullable<System.Guid> _ParentProjectId; 5672 5673 private System.DateTime _DateCreated; 5674 5675 private string _Name; 5676 5677 private string _Description; 5678 5679 private System.Guid _OwnerUserId; 5680 5681 private System.DateTime _StartDate; 5682 5683 private System.DateTime _EndDate; 5684 5685 private EntitySet<AssignedResource> _AssignedResources; 5686 5687 private EntitySet<Job> _Jobs; 5688 5689 private EntitySet<Project> _Projects; 5690 5691 private EntitySet<ProjectPermission> _ProjectPermissions; 5692 5693 private EntityRef<Project> _Project1; 5694 5695 #region Extensibility Method Definitions 5696 partial void OnLoaded(); 5697 partial void OnValidate(System.Data.Linq.ChangeAction action); 5698 partial void OnCreated(); 5699 partial void OnProjectIdChanging(System.Guid value); 5700 partial void OnProjectIdChanged(); 5701 partial void OnParentProjectIdChanging(System.Nullable<System.Guid> value); 5702 partial void OnParentProjectIdChanged(); 5703 partial void OnDateCreatedChanging(System.DateTime value); 5704 partial void OnDateCreatedChanged(); 5705 partial void OnNameChanging(string value); 5706 partial void OnNameChanged(); 5707 partial void OnDescriptionChanging(string value); 5708 partial void OnDescriptionChanged(); 5709 partial void OnOwnerUserIdChanging(System.Guid value); 5710 partial void OnOwnerUserIdChanged(); 5711 partial void OnStartDateChanging(System.DateTime value); 5712 partial void OnStartDateChanged(); 5713 partial void OnEndDateChanging(System.DateTime value); 5714 partial void OnEndDateChanged(); 5715 #endregion 5716 5717 public Project() 5718 { 5719 this._AssignedResources = new EntitySet<AssignedResource>(new Action<AssignedResource>(this.attach_AssignedResources), new Action<AssignedResource>(this.detach_AssignedResources)); 5720 this._Jobs = new EntitySet<Job>(new Action<Job>(this.attach_Jobs), new Action<Job>(this.detach_Jobs)); 5721 this._Projects = new EntitySet<Project>(new Action<Project>(this.attach_Projects), new Action<Project>(this.detach_Projects)); 5722 this._ProjectPermissions = new EntitySet<ProjectPermission>(new Action<ProjectPermission>(this.attach_ProjectPermissions), new Action<ProjectPermission>(this.detach_ProjectPermissions)); 5723 this._Project1 = default(EntityRef<Project>); 5724 OnCreated(); 5725 } 5726 5727 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)] 5728 public System.Guid ProjectId 5729 { 5730 get 5731 { 5732 return this._ProjectId; 5733 } 5734 set 5735 { 5736 if ((this._ProjectId != value)) 5737 { 5738 this.OnProjectIdChanging(value); 5739 this.SendPropertyChanging(); 5740 this._ProjectId = value; 5741 this.SendPropertyChanged("ProjectId"); 5742 this.OnProjectIdChanged(); 5743 } 5744 } 5745 } 5746 5747 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ParentProjectId", DbType="UniqueIdentifier")] 5748 public System.Nullable<System.Guid> ParentProjectId 5749 { 5750 get 5751 { 5752 return this._ParentProjectId; 5753 } 5754 set 5755 { 5756 if ((this._ParentProjectId != value)) 5757 { 5758 if (this._Project1.HasLoadedOrAssignedValue) 5759 { 5760 throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); 5761 } 5762 this.OnParentProjectIdChanging(value); 5763 this.SendPropertyChanging(); 5764 this._ParentProjectId = value; 5765 this.SendPropertyChanged("ParentProjectId"); 5766 this.OnParentProjectIdChanged(); 5767 } 5768 } 5769 } 5770 5771 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DateCreated", DbType="DateTime NOT NULL")] 5772 public System.DateTime DateCreated 5773 { 5774 get 5775 { 5776 return this._DateCreated; 5777 } 5778 set 5779 { 5780 if ((this._DateCreated != value)) 5781 { 5782 this.OnDateCreatedChanging(value); 5783 this.SendPropertyChanging(); 5784 this._DateCreated = value; 5785 this.SendPropertyChanged("DateCreated"); 5786 this.OnDateCreatedChanged(); 5787 } 5788 } 5789 } 5790 5791 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(MAX)", CanBeNull=false)] 5792 public string Name 5793 { 5794 get 5795 { 5796 return this._Name; 5797 } 5798 set 5799 { 5800 if ((this._Name != value)) 5801 { 5802 this.OnNameChanging(value); 5803 this.SendPropertyChanging(); 5804 this._Name = value; 5805 this.SendPropertyChanged("Name"); 5806 this.OnNameChanged(); 5807 } 5808 } 5809 } 5810 5811 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Description", DbType="VarChar(MAX)", CanBeNull=false)] 5812 public string Description 5813 { 5814 get 5815 { 5816 return this._Description; 5817 } 5818 set 5819 { 5820 if ((this._Description != value)) 5821 { 5822 this.OnDescriptionChanging(value); 5823 this.SendPropertyChanging(); 5824 this._Description = value; 5825 this.SendPropertyChanged("Description"); 5826 this.OnDescriptionChanged(); 5827 } 5828 } 5829 } 5830 5831 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OwnerUserId", DbType="UniqueIdentifier NOT NULL")] 5832 public System.Guid OwnerUserId 5833 { 5834 get 5835 { 5836 return this._OwnerUserId; 5837 } 5838 set 5839 { 5840 if ((this._OwnerUserId != value)) 5841 { 5842 this.OnOwnerUserIdChanging(value); 5843 this.SendPropertyChanging(); 5844 this._OwnerUserId = value; 5845 this.SendPropertyChanged("OwnerUserId"); 5846 this.OnOwnerUserIdChanged(); 5847 } 5848 } 5849 } 5850 5851 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartDate", DbType="DateTime NOT NULL")] 5852 public System.DateTime StartDate 5853 { 5854 get 5855 { 5856 return this._StartDate; 5857 } 5858 set 5859 { 5860 if ((this._StartDate != value)) 5861 { 5862 this.OnStartDateChanging(value); 5863 this.SendPropertyChanging(); 5864 this._StartDate = value; 5865 this.SendPropertyChanged("StartDate"); 5866 this.OnStartDateChanged(); 5867 } 5868 } 5869 } 5870 5871 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EndDate", DbType="DateTime")] 5872 public System.DateTime EndDate 5873 { 5874 get 5875 { 5876 return this._EndDate; 5877 } 5878 set 5879 { 5880 if ((this._EndDate != value)) 5881 { 5882 this.OnEndDateChanging(value); 5883 this.SendPropertyChanging(); 5884 this._EndDate = value; 5885 this.SendPropertyChanged("EndDate"); 5886 this.OnEndDateChanged(); 5887 } 5888 } 5889 } 5890 5891 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_AssignedResource", Storage="_AssignedResources", ThisKey="ProjectId", OtherKey="ProjectId")] 5892 public EntitySet<AssignedResource> AssignedResources 5893 { 5894 get 5895 { 5896 return this._AssignedResources; 5897 } 5898 set 5899 { 5900 this._AssignedResources.Assign(value); 5901 } 5902 } 5903 5904 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_Job", Storage="_Jobs", ThisKey="ProjectId", OtherKey="ProjectId")] 5905 public EntitySet<Job> Jobs 5906 { 5907 get 5908 { 5909 return this._Jobs; 5910 } 5911 set 5912 { 5913 this._Jobs.Assign(value); 5914 } 5915 } 5916 5917 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_Project", Storage="_Projects", ThisKey="ProjectId", OtherKey="ParentProjectId")] 5918 public EntitySet<Project> ChildProjects 5919 { 5920 get 5921 { 5922 return this._Projects; 5923 } 5924 set 5925 { 5926 this._Projects.Assign(value); 5927 } 5928 } 5929 5930 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_ProjectPermission", Storage="_ProjectPermissions", ThisKey="ProjectId", OtherKey="ProjectId")] 5931 public EntitySet<ProjectPermission> ProjectPermissions 5932 { 5933 get 5934 { 5935 return this._ProjectPermissions; 5936 } 5937 set 5938 { 5939 this._ProjectPermissions.Assign(value); 5940 } 5941 } 5942 5943 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_Project", Storage="_Project1", ThisKey="ParentProjectId", OtherKey="ProjectId", IsForeignKey=true)] 5944 public Project ParentProject 5945 { 5946 get 5947 { 5948 return this._Project1.Entity; 5949 } 5950 set 5951 { 5952 Project previousValue = this._Project1.Entity; 5953 if (((previousValue != value) 5954 || (this._Project1.HasLoadedOrAssignedValue == false))) 5955 { 5956 this.SendPropertyChanging(); 5957 if ((previousValue != null)) 5958 { 5959 this._Project1.Entity = null; 5960 previousValue.ChildProjects.Remove(this); 5961 } 5962 this._Project1.Entity = value; 5963 if ((value != null)) 5964 { 5965 value.ChildProjects.Add(this); 5966 this._ParentProjectId = value.ProjectId; 5967 } 5968 else 5969 { 5970 this._ParentProjectId = default(Nullable<System.Guid>); 5971 } 5972 this.SendPropertyChanged("ParentProject"); 5973 } 5974 } 5975 } 5976 5977 public event PropertyChangingEventHandler PropertyChanging; 5978 5979 public event PropertyChangedEventHandler PropertyChanged; 5980 5981 protected virtual void SendPropertyChanging() 5982 { 5983 if ((this.PropertyChanging != null)) 5984 { 5985 this.PropertyChanging(this, emptyChangingEventArgs); 5986 } 5987 } 5988 5989 protected virtual void SendPropertyChanged(String propertyName) 5990 { 5991 if ((this.PropertyChanged != null)) 5992 { 5993 this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); 5994 } 5995 } 5996 5997 private void attach_AssignedResources(AssignedResource entity) 5998 { 5999 this.SendPropertyChanging(); 6000 entity.Project = this; 6001 } 6002 6003 private void detach_AssignedResources(AssignedResource entity) 6004 { 6005 this.SendPropertyChanging(); 6006 entity.Project = null; 6007 } 6008 6009 private void attach_Jobs(Job entity) 6010 { 6011 this.SendPropertyChanging(); 6012 entity.Project = this; 6013 } 6014 6015 private void detach_Jobs(Job entity) 6016 { 6017 this.SendPropertyChanging(); 6018 entity.Project = null; 6019 } 6020 6021 private void attach_Projects(Project entity) 6022 { 6023 this.SendPropertyChanging(); 6024 entity.ParentProject = this; 6025 } 6026 6027 private void detach_Projects(Project entity) 6028 { 6029 this.SendPropertyChanging(); 6030 entity.ParentProject = null; 6031 } 6032 6033 private void attach_ProjectPermissions(ProjectPermission entity) 6034 { 6035 this.SendPropertyChanging(); 6036 entity.Project = this; 6037 } 6038 6039 private void detach_ProjectPermissions(ProjectPermission entity) 6040 { 6041 this.SendPropertyChanging(); 6042 entity.Project = null; 6043 } 6044 } 6045 6046 [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.ProjectPermission")] 6047 public partial class ProjectPermission : INotifyPropertyChanging, INotifyPropertyChanged 6048 { 6049 6050 private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); 6051 6052 private System.Guid _ProjectId; 6053 6054 private System.Guid _GrantedUserId; 6055 6056 private System.Guid _GrantedByUserId; 6057 6058 private EntityRef<Project> _Project; 6059 6060 #region Extensibility Method Definitions 6061 partial void OnLoaded(); 6062 partial void OnValidate(System.Data.Linq.ChangeAction action); 6063 partial void OnCreated(); 6064 partial void OnProjectIdChanging(System.Guid value); 6065 partial void OnProjectIdChanged(); 6066 partial void OnGrantedUserIdChanging(System.Guid value); 6067 partial void OnGrantedUserIdChanged(); 6068 partial void OnGrantedByUserIdChanging(System.Guid value); 6069 partial void OnGrantedByUserIdChanged(); 6070 #endregion 6071 6072 public ProjectPermission() 6073 { 6074 this._Project = default(EntityRef<Project>); 6075 OnCreated(); 6076 } 6077 6078 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)] 6079 public System.Guid ProjectId 6080 { 6081 get 6082 { 6083 return this._ProjectId; 6084 } 6085 set 6086 { 6087 if ((this._ProjectId != value)) 6088 { 6089 if (this._Project.HasLoadedOrAssignedValue) 6090 { 6091 throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); 6092 } 6093 this.OnProjectIdChanging(value); 6094 this.SendPropertyChanging(); 6095 this._ProjectId = value; 6096 this.SendPropertyChanged("ProjectId"); 6097 this.OnProjectIdChanged(); 6098 } 6099 } 6100 } 6101 6102 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedUserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)] 6103 public System.Guid GrantedUserId 6104 { 6105 get 6106 { 6107 return this._GrantedUserId; 6108 } 6109 set 6110 { 6111 if ((this._GrantedUserId != value)) 6112 { 6113 this.OnGrantedUserIdChanging(value); 6114 this.SendPropertyChanging(); 6115 this._GrantedUserId = value; 6116 this.SendPropertyChanged("GrantedUserId"); 6117 this.OnGrantedUserIdChanged(); 6118 } 6119 } 6120 } 6121 6122 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedByUserId", DbType="UniqueIdentifier NOT NULL")] 6123 public System.Guid GrantedByUserId 6124 { 6125 get 6126 { 6127 return this._GrantedByUserId; 6128 } 6129 set 6130 { 6131 if ((this._GrantedByUserId != value)) 6132 { 6133 this.OnGrantedByUserIdChanging(value); 6134 this.SendPropertyChanging(); 6135 this._GrantedByUserId = value; 6136 this.SendPropertyChanged("GrantedByUserId"); 6137 this.OnGrantedByUserIdChanged(); 6138 } 6139 } 6140 } 6141 6142 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_ProjectPermission", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] 6143 public Project Project 6144 { 6145 get 6146 { 6147 return this._Project.Entity; 6148 } 6149 set 6150 { 6151 Project previousValue = this._Project.Entity; 6152 if (((previousValue != value) 6153 || (this._Project.HasLoadedOrAssignedValue == false))) 6154 { 6155 this.SendPropertyChanging(); 6156 if ((previousValue != null)) 6157 { 6158 this._Project.Entity = null; 6159 previousValue.ProjectPermissions.Remove(this); 6160 } 6161 this._Project.Entity = value; 6162 if ((value != null)) 6163 { 6164 value.ProjectPermissions.Add(this); 6165 this._ProjectId = value.ProjectId; 6166 } 6167 else 6168 { 6169 this._ProjectId = default(System.Guid); 6170 } 6171 this.SendPropertyChanged("Project"); 6172 } 6173 } 6174 } 6175 6176 public event PropertyChangingEventHandler PropertyChanging; 6177 6178 public event PropertyChangedEventHandler PropertyChanged; 6179 6180 protected virtual void SendPropertyChanging() 6181 { 6182 if ((this.PropertyChanging != null)) 6183 { 6184 this.PropertyChanging(this, emptyChangingEventArgs); 6185 } 6186 } 6187 6188 protected virtual void SendPropertyChanged(String propertyName) 6189 { 6190 if ((this.PropertyChanged != null)) 6191 { 6192 this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); 6193 } 6194 } 6195 } 5609 6196 } 5610 6197 #pragma warning restore 1591 -
branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql
r14185 r15378 25 25 26 26 SET ARITHABORT ON 27 CREATE TABLE [dbo].[AssignedResources]( 27 28 CREATE TABLE [dbo].[AssignedResource]( 28 29 [ResourceId] UniqueIdentifier NOT NULL, 29 [ TaskId] UniqueIdentifier NOT NULL,30 CONSTRAINT [PK_dbo.ResourceId TaskId] PRIMARY KEY ([ResourceId], [TaskId])30 [ProjectId] UniqueIdentifier NOT NULL, 31 CONSTRAINT [PK_dbo.ResourceIdProjectId] PRIMARY KEY ([ResourceId], [ProjectId]) 31 32 ) 32 33 CREATE TABLE [dbo].[Plugin]( … … 106 107 [OwnerUserId] UniqueIdentifier NOT NULL, 107 108 [DateCreated] DateTime NOT NULL, 109 [ProjectId] UniqueIdentifier NOT NULL, 108 110 CONSTRAINT [PK_dbo.Job] PRIMARY KEY ([JobId]) 109 111 ) … … 148 150 CONSTRAINT [PK_UserPriority] PRIMARY KEY ([UserId]) 149 151 ) 150 ALTER TABLE [dbo].[AssignedResources] 152 CREATE TABLE [dbo].[Project]( 153 [ProjectId] UniqueIdentifier NOT NULL, 154 [ParentProjectId] UniqueIdentifier, 155 [DateCreated] DateTime NOT NULL, 156 [Name] VarChar(MAX) NOT NULL, 157 [Description] VarChar(MAX) NOT NULL, 158 [OwnerUserId] UniqueIdentifier NOT NULL, 159 [StartDate] DateTime NOT NULL, 160 [EndDate] DateTime, 161 CONSTRAINT [PK_dbo.Project] PRIMARY KEY ([ProjectId]) 162 ) 163 CREATE TABLE [dbo].[ProjectPermission]( 164 [ProjectId] UniqueIdentifier NOT NULL, 165 [GrantedUserId] UniqueIdentifier NOT NULL, 166 [GrantedByUserId] UniqueIdentifier NOT NULL, 167 CONSTRAINT [PK_dbo.ProjectPermission] PRIMARY KEY ([ProjectId], [GrantedUserId]) 168 ) 169 170 ALTER TABLE [dbo].[AssignedResource] 151 171 ADD CONSTRAINT [Resource_AssignedResource] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId]) 152 ALTER TABLE [dbo].[AssignedResource s]153 ADD CONSTRAINT [ Task_AssignedResource] FOREIGN KEY ([TaskId]) REFERENCES [dbo].[Task]([TaskId])172 ALTER TABLE [dbo].[AssignedResource] 173 ADD CONSTRAINT [Project_AssignedResource] FOREIGN KEY ([ProjectId]) REFERENCES [dbo].[Project]([ProjectId]) 154 174 ALTER TABLE [dbo].[RequiredPlugins] 155 175 ADD CONSTRAINT [Plugin_RequiredPlugin] FOREIGN KEY ([PluginId]) REFERENCES [dbo].[Plugin]([PluginId]) … … 166 186 ALTER TABLE [dbo].[Downtime] 167 187 ADD CONSTRAINT [Resource_Downtime] FOREIGN KEY ([ResourceId]) REFERENCES [dbo].[Resource]([ResourceId]) 188 ALTER TABLE [dbo].[Job] 189 ADD CONSTRAINT [Project_Job] FOREIGN KEY ([ProjectId]) REFERENCES [dbo].[Project]([ProjectId]) 168 190 ALTER TABLE [dbo].[TaskData] 169 191 ADD CONSTRAINT [Task_TaskData] FOREIGN KEY ([TaskId]) REFERENCES [dbo].[Task]([TaskId]) … … 176 198 ALTER TABLE [dbo].[JobPermission] 177 199 ADD CONSTRAINT [Job_JobPermission] FOREIGN KEY ([JobId]) REFERENCES [dbo].[Job]([JobId]) 200 ALTER TABLE [dbo].[Project] 201 ADD CONSTRAINT [Project_Project] FOREIGN KEY ([ParentProjectId]) REFERENCES [dbo].[Project]([ProjectId]) 202 ALTER TABLE [dbo].[ProjectPermission] 203 ADD CONSTRAINT [Project_ProjectPermission] FOREIGN KEY ([ProjectId]) REFERENCES [dbo].[Project]([ProjectId]) 178 204 179 205 GO -
branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Prepare Hive Database.sql
r14185 r15378 21 21 USE [HeuristicLab.Hive-3.3] 22 22 23 ALTER TABLE [dbo].[AssignedResource s] DROP CONSTRAINT [Task_AssignedResource]24 ALTER TABLE [dbo].[AssignedResource s] WITH CHECK ADD CONSTRAINT [Task_AssignedResource] FOREIGN KEY([TaskId])25 REFERENCES [dbo].[ Task] ([TaskId])23 ALTER TABLE [dbo].[AssignedResource] DROP CONSTRAINT [Project_AssignedResource] 24 ALTER TABLE [dbo].[AssignedResource] WITH CHECK ADD CONSTRAINT [Project_AssignedResource] FOREIGN KEY([ProjectId]) 25 REFERENCES [dbo].[Project] ([ProjectId]) 26 26 ON UPDATE CASCADE 27 27 ON DELETE CASCADE 28 28 GO 29 ALTER TABLE [dbo].[AssignedResource s] DROP CONSTRAINT [Resource_AssignedResource]30 ALTER TABLE [dbo].[AssignedResource s] WITH CHECK ADD CONSTRAINT [Resource_AssignedResource] FOREIGN KEY([ResourceId])29 ALTER TABLE [dbo].[AssignedResource] DROP CONSTRAINT [Resource_AssignedResource] 30 ALTER TABLE [dbo].[AssignedResource] WITH CHECK ADD CONSTRAINT [Resource_AssignedResource] FOREIGN KEY([ResourceId]) 31 31 REFERENCES [dbo].[Resource] ([ResourceId]) 32 32 ON UPDATE CASCADE … … 88 88 ALTER TABLE dbo.Job ALTER COLUMN JobId ADD ROWGUIDCOL; 89 89 ALTER TABLE dbo.Job WITH NOCHECK ADD CONSTRAINT [DF_Job_JobId] DEFAULT (NEWSEQUENTIALID()) FOR JobId; 90 ALTER TABLE [dbo].[Job] DROP CONSTRAINT [Project_Job] 91 ALTER TABLE [dbo].[Job] WITH CHECK ADD CONSTRAINT [Project_Job] FOREIGN KEY([ProjectId]) 92 REFERENCES [dbo].[Project] ([ProjectId]) 93 ON UPDATE CASCADE 94 ON DELETE CASCADE 95 GO 90 96 91 97 ALTER TABLE dbo.StateLog ALTER COLUMN StateLogId ADD ROWGUIDCOL; … … 102 108 ALTER TABLE [dbo].[ResourcePermission] WITH CHECK ADD CONSTRAINT [Resource_ResourcePermission] FOREIGN KEY([ResourceId]) 103 109 REFERENCES [dbo].[Resource] ([ResourceId]) 110 ON UPDATE CASCADE 111 ON DELETE CASCADE 112 GO 113 114 ALTER TABLE dbo.Project ALTER COLUMN ProjectId ADD ROWGUIDCOL; 115 ALTER TABLE dbo.Project WITH NOCHECK ADD CONSTRAINT [DF_Project_ProjectId] DEFAULT (NEWSEQUENTIALID()) FOR ProjectId; 116 117 ALTER TABLE [dbo].[ProjectPermission] DROP CONSTRAINT [Project_ProjectPermission] 118 ALTER TABLE [dbo].[ProjectPermission] WITH CHECK ADD CONSTRAINT [Project_ProjectPermission] FOREIGN KEY([ProjectId]) 119 REFERENCES [dbo].[Project] ([ProjectId]) 104 120 ON UPDATE CASCADE 105 121 ON DELETE CASCADE
Note: See TracChangeset
for help on using the changeset viewer.