Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Coscine
backend
libraries
Database
Commits
5a344850
Commit
5a344850
authored
May 30, 2022
by
Petar Hristov
💬
Browse files
Merge branch 'Issue/2072-wormResourceType' into 'master'
New: Added WORM Resource Type See merge request
!163
parents
e074f510
9a971ba6
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/Database/Database.csproj
View file @
5a344850
...
...
@@ -4,7 +4,7 @@
<RootNamespace>Coscine.Database</RootNamespace>
<AssemblyName>Coscine.Database</AssemblyName>
<TargetFrameworks>net6.0;net461</TargetFrameworks>
<Version>2.1
0.1
</Version>
<Version>2.1
1.0-issue-2072-wormr0005
</Version>
</PropertyGroup>
<PropertyGroup>
<Authors>RWTH Aachen University</Authors>
...
...
src/Database/Models/RdsS3WormResourceTypeModel.cs
0 → 100644
View file @
5a344850
using
Coscine.Database.DataModel
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq.Expressions
;
namespace
Coscine.Database.Models
{
public
class
RdsS3WormResourceTypeModel
:
DatabaseModel
<
RdsS3wormResourceType
>
{
public
override
Expression
<
Func
<
RdsS3wormResourceType
,
Guid
>>
GetIdFromObject
()
{
return
(
rdsResourceType
)
=>
rdsResourceType
.
Id
;
}
public
override
Microsoft
.
EntityFrameworkCore
.
DbSet
<
RdsS3wormResourceType
>
GetITableFromDatabase
(
CoscineDB
db
)
{
return
db
.
RdsS3wormResourceTypes
;
}
public
override
void
SetObjectId
(
RdsS3wormResourceType
databaseObject
,
Guid
id
)
{
databaseObject
.
Id
=
id
;
}
public
Dictionary
<
string
,
string
>
GetResourceTypeOptions
(
Guid
id
)
{
var
resourceType
=
GetById
(
id
);
var
dictionary
=
new
Dictionary
<
string
,
string
>
{
{
"accessKey"
,
resourceType
.
AccessKey
},
{
"secretKey"
,
resourceType
.
SecretKey
},
{
"accessKeyRead"
,
resourceType
.
AccessKeyRead
},
{
"secretKeyRead"
,
resourceType
.
SecretKeyRead
},
{
"accessKeyWrite"
,
resourceType
.
AccessKeyWrite
},
{
"secretKeyWrite"
,
resourceType
.
SecretKeyWrite
},
{
"bucketname"
,
resourceType
.
BucketName
},
{
"endpoint"
,
resourceType
.
Endpoint
},
{
"size"
,
$"
{
resourceType
.
Size
}
"
}
};
return
dictionary
;
}
}
}
\ No newline at end of file
src/Database/Models/ResourceModel.cs
View file @
5a344850
...
...
@@ -13,22 +13,6 @@ namespace Coscine.Database.Models
{
public
class
ResourceModel
:
DatabaseModel
<
Resource
>
{
private
readonly
IConfiguration
_configuration
=
new
ConsulConfiguration
();
private
static
readonly
Dictionary
<
string
,
string
>
_configs
=
new
Dictionary
<
string
,
string
>
{
// RDS-Web
{
"rds"
,
"coscine/global/rds/ecs-rwth/rds"
},
{
"rdsude"
,
"coscine/global/rds/ecs-ude/rds"
},
{
"rdsnrw"
,
"coscine/global/rds/ecs-nrw/rds"
},
{
"rdstudo"
,
"coscine/global/rds/ecs-tudo/rds"
},
// RDS-S3
{
"rdss3"
,
"coscine/global/rds/ecs-rwth/rds-s3"
},
{
"rdss3ude"
,
"coscine/global/rds/ecs-ude/rds-s3"
},
{
"rdss3nrw"
,
"coscine/global/rds/ecs-nrw/rds-s3"
},
{
"rdss3tudo"
,
"coscine/global/rds/ecs-tudo/rds-s3"
}
};
public
Resource
StoreFromObject
(
ResourceObject
resourceObject
)
{
if
(!
resourceObject
.
Disciplines
.
Any
()
||
resourceObject
.
ResourceTypeOption
==
null
)
...
...
@@ -59,7 +43,6 @@ namespace Coscine.Database.Models
try
{
SetDisciplines
(
resource
,
resourceObject
.
Disciplines
);
SetResourceTypeObject
(
resource
,
resourceObject
.
ResourceTypeOption
);
}
catch
(
Exception
)
{
...
...
@@ -116,161 +99,34 @@ namespace Coscine.Database.Models
from
jrt
in
joinedRt
.
DefaultIfEmpty
()
where
!
jp
.
Deleted
&&
IsLikeRds
(
jrt
.
DisplayName
)
jrt
.
Type
==
"rds"
group
r
by
jpi
.
OrganizationUrl
into
g
select
new
OrganizationResourceListObject
(
g
.
Key
,
g
.
ToList
())).
ToList
();
});
}
private
void
SetResourceTypeObject
(
Resource
resource
,
JObject
resourceTypeOption
)
{
if
(
IsLikeRds
(
resource
.
Type
.
DisplayName
))
{
RDSResourceTypeObject
rdsResourceTypeObject
=
resourceTypeOption
.
ToObject
<
RDSResourceTypeObject
>();
RDSResourceTypeModel
rdsResourceTypeModel
=
new
RDSResourceTypeModel
();
if
(
resource
.
ResourceTypeOptionId
!=
null
)
{
RdsresourceType
rdsResourceType
=
rdsResourceTypeModel
.
GetById
(
resource
.
ResourceTypeOptionId
.
Value
);
rdsResourceTypeModel
.
Update
(
rdsResourceType
);
}
else
{
var
prefix
=
_configs
[
resource
.
Type
.
DisplayName
];
RdsresourceType
rdsResourceType
=
new
RdsresourceType
()
{
BucketName
=
resource
.
Id
.
ToString
(),
Size
=
rdsResourceTypeObject
.
Size
,
AccessKey
=
_configuration
.
GetString
(
$"
{
prefix
}
/object_user_name"
),
SecretKey
=
_configuration
.
GetString
(
$"
{
prefix
}
/object_user_secretkey"
),
Endpoint
=
_configuration
.
GetString
(
$"
{
prefix
}
/s3_endpoint"
),
};
rdsResourceTypeModel
.
Insert
(
rdsResourceType
);
resource
.
ResourceTypeOptionId
=
rdsResourceType
.
Id
;
Update
(
resource
);
}
}
else
if
(
resource
.
Type
.
DisplayName
==
"s3"
)
{
S3ResourceTypeObject
s3ResourceTypeObject
=
resourceTypeOption
.
ToObject
<
S3ResourceTypeObject
>();
S3ResourceTypeModel
s3ResourceTypeModel
=
new
S3ResourceTypeModel
();
if
(
resource
.
ResourceTypeOptionId
!=
null
)
{
S3resourceType
s3ResourceType
=
s3ResourceTypeModel
.
GetById
(
resource
.
ResourceTypeOptionId
.
Value
);
s3ResourceType
.
BucketName
=
s3ResourceTypeObject
.
BucketName
;
s3ResourceType
.
AccessKey
=
s3ResourceTypeObject
.
AccessKey
??
s3ResourceType
.
AccessKey
;
s3ResourceType
.
SecretKey
=
s3ResourceTypeObject
.
SecretKey
??
s3ResourceType
.
SecretKey
;
s3ResourceTypeModel
.
Update
(
s3ResourceType
);
}
else
{
S3resourceType
s3ResourceType
=
new
S3resourceType
()
{
BucketName
=
s3ResourceTypeObject
.
BucketName
,
AccessKey
=
s3ResourceTypeObject
.
AccessKey
,
SecretKey
=
s3ResourceTypeObject
.
SecretKey
};
s3ResourceTypeModel
.
Insert
(
s3ResourceType
);
resource
.
ResourceTypeOptionId
=
s3ResourceType
.
Id
;
Update
(
resource
);
}
}
else
if
(
resource
.
Type
.
DisplayName
==
"gitlab"
)
{
GitlabResourceTypeObject
gitlabResourceTypeObject
=
resourceTypeOption
.
ToObject
<
GitlabResourceTypeObject
>();
GitlabResourceTypeModel
gitlabResourceTypeModel
=
new
GitlabResourceTypeModel
();
if
(
resource
.
ResourceTypeOptionId
!=
null
)
{
GitlabResourceType
gitlabResourceType
=
gitlabResourceTypeModel
.
GetById
(
resource
.
ResourceTypeOptionId
.
Value
);
gitlabResourceType
.
RepositoryNumber
=
gitlabResourceTypeObject
.
RepositoryNumber
;
gitlabResourceType
.
RepositoryUrl
=
gitlabResourceTypeObject
.
RepositoryUrl
;
gitlabResourceType
.
Token
=
gitlabResourceTypeObject
.
Token
??
gitlabResourceType
.
Token
;
gitlabResourceTypeModel
.
Update
(
gitlabResourceType
);
}
else
{
GitlabResourceType
gitlabResourceType
=
new
GitlabResourceType
()
{
RepositoryNumber
=
gitlabResourceTypeObject
.
RepositoryNumber
,
RepositoryUrl
=
gitlabResourceTypeObject
.
RepositoryUrl
,
Token
=
gitlabResourceTypeObject
.
Token
};
gitlabResourceTypeModel
.
Insert
(
gitlabResourceType
);
resource
.
ResourceTypeOptionId
=
gitlabResourceType
.
Id
;
Update
(
resource
);
}
}
else
if
(
resource
.
Type
.
DisplayName
==
"linked"
)
{
LinkedResourceTypeModel
linkedResourceTypeModel
=
new
LinkedResourceTypeModel
();
if
(
resource
.
ResourceTypeOptionId
==
null
)
{
LinkedResourceType
linkedResourceType
=
new
LinkedResourceType
();
linkedResourceTypeModel
.
Insert
(
linkedResourceType
);
resource
.
ResourceTypeOptionId
=
linkedResourceType
.
Id
;
Update
(
resource
);
}
}
else
if
(
IsLikeRdsS3
(
resource
.
Type
.
DisplayName
))
{
var
rdsS3ResourceTypeObject
=
resourceTypeOption
.
ToObject
<
RdsS3ResourceTypeObject
>();
var
rdsS3ResourceTypeModel
=
new
RdsS3ResourceTypeModel
();
if
(
resource
.
ResourceTypeOptionId
!=
null
)
{
var
rdsS3ResourceType
=
rdsS3ResourceTypeModel
.
GetById
(
resource
.
ResourceTypeOptionId
.
Value
);
rdsS3ResourceTypeModel
.
Update
(
rdsS3ResourceType
);
}
else
{
var
prefix
=
_configs
[
resource
.
Type
.
DisplayName
];
var
rdsS3ResourceType
=
new
RdsS3resourceType
()
{
BucketName
=
resource
.
Id
.
ToString
(),
AccessKey
=
_configuration
.
GetString
(
$"
{
prefix
}
/object_user_name"
),
SecretKey
=
_configuration
.
GetString
(
$"
{
prefix
}
/object_user_secretkey"
),
AccessKeyRead
=
$"read_
{
resource
.
Id
}
"
,
SecretKeyRead
=
RandomHelper
.
GenerateRandomChunk
(
32
),
AccessKeyWrite
=
$"write_
{
resource
.
Id
}
"
,
SecretKeyWrite
=
RandomHelper
.
GenerateRandomChunk
(
32
),
Endpoint
=
_configuration
.
GetString
(
$"
{
prefix
}
/s3_endpoint"
),
Size
=
rdsS3ResourceTypeObject
.
Size
,
};
rdsS3ResourceTypeModel
.
Insert
(
rdsS3ResourceType
);
resource
.
ResourceTypeOptionId
=
rdsS3ResourceType
.
Id
;
Update
(
resource
);
}
}
else
{
throw
new
ArgumentException
(
"Not supported resource type!"
);
}
}
public
Dictionary
<
string
,
string
>
GetResourceTypeOptions
(
Guid
id
)
{
var
resource
=
GetById
(
id
);
var
resourceType
=
new
ResourceTypeModel
().
GetById
(
(
Guid
)
resource
.
TypeId
);
var
resourceType
=
new
ResourceTypeModel
().
GetById
(
resource
.
TypeId
);
var
resourceTypeOptionId
=
(
Guid
)
resource
.
ResourceTypeOptionId
;
if
(
resourceType
.
DisplayNam
e
==
"gitlab"
)
if
(
resourceType
.
Typ
e
==
"gitlab"
)
{
return
new
GitlabResourceTypeModel
().
GetResourceTypeOptions
(
resourceTypeOptionId
);
}
else
if
(
IsLikeRds
(
resourceType
.
DisplayName
)
)
else
if
(
resourceType
.
Type
==
"rds"
)
{
return
new
RDSResourceTypeModel
().
GetResourceTypeOptions
(
resourceTypeOptionId
);
}
else
if
(
resourceType
.
DisplayNam
e
==
"s3"
)
else
if
(
resourceType
.
Typ
e
==
"s3"
)
{
return
new
S3ResourceTypeModel
().
GetResourceTypeOptions
(
resourceTypeOptionId
);
}
else
if
(
resourceType
.
DisplayNam
e
==
"linked"
)
else
if
(
resourceType
.
Typ
e
==
"linked"
)
{
return
new
LinkedResourceTypeModel
().
GetResourceTypeOptions
(
resourceTypeOptionId
);
}
else
if
(
IsLikeRdsS3
(
resourceType
.
DisplayName
)
)
else
if
(
resourceType
.
Type
==
"rdss3"
)
{
return
new
RdsS3ResourceTypeModel
().
GetResourceTypeOptions
(
resourceTypeOptionId
);
}
...
...
@@ -347,12 +203,10 @@ namespace Coscine.Database.Models
// resource.Creator = resourceObject.Creator;
SetDisciplines
(
resource
,
resourceObject
.
Disciplines
);
SetResourceTypeObject
(
resource
,
resourceObject
.
ResourceTypeOption
);
return
Update
(
resource
);
}
// TODO: Find out why resource.Type is not set
public
void
SetType
(
Resource
resource
)
{
if
(
resource
.
Type
==
null
)
...
...
@@ -365,27 +219,27 @@ namespace Coscine.Database.Models
public
void
DeleteResourceTypeObject
(
Resource
resource
)
{
SetType
(
resource
);
if
(
IsLikeRds
(
resource
.
Type
.
DisplayName
)
&&
resource
.
ResourceTypeOptionId
!=
null
)
if
(
resource
.
Type
.
Type
==
"rds"
&&
resource
.
ResourceTypeOptionId
!=
null
)
{
RDSResourceTypeModel
rdsResourceTypeModel
=
new
RDSResourceTypeModel
();
rdsResourceTypeModel
.
Delete
(
rdsResourceTypeModel
.
GetById
(
resource
.
ResourceTypeOptionId
.
Value
));
}
else
if
(
resource
.
Type
.
DisplayNam
e
==
"s3"
&&
resource
.
ResourceTypeOptionId
!=
null
)
else
if
(
resource
.
Type
.
Typ
e
==
"s3"
&&
resource
.
ResourceTypeOptionId
!=
null
)
{
S3ResourceTypeModel
s3ResourceTypeModel
=
new
S3ResourceTypeModel
();
s3ResourceTypeModel
.
Delete
(
s3ResourceTypeModel
.
GetById
(
resource
.
ResourceTypeOptionId
.
Value
));
}
else
if
(
resource
.
Type
.
DisplayNam
e
==
"gitlab"
&&
resource
.
ResourceTypeOptionId
!=
null
)
else
if
(
resource
.
Type
.
Typ
e
==
"gitlab"
&&
resource
.
ResourceTypeOptionId
!=
null
)
{
GitlabResourceTypeModel
gitlabResourceTypeModel
=
new
GitlabResourceTypeModel
();
gitlabResourceTypeModel
.
Delete
(
gitlabResourceTypeModel
.
GetById
(
resource
.
ResourceTypeOptionId
.
Value
));
}
else
if
(
resource
.
Type
.
DisplayNam
e
==
"linked"
&&
resource
.
ResourceTypeOptionId
!=
null
)
else
if
(
resource
.
Type
.
Typ
e
==
"linked"
&&
resource
.
ResourceTypeOptionId
!=
null
)
{
LinkedResourceTypeModel
linkedResourceTypeModel
=
new
LinkedResourceTypeModel
();
linkedResourceTypeModel
.
Delete
(
linkedResourceTypeModel
.
GetById
(
resource
.
ResourceTypeOptionId
.
Value
));
}
else
if
(
IsLikeRdsS3
(
resource
.
Type
.
DisplayName
)
&&
resource
.
ResourceTypeOptionId
!=
null
)
else
if
(
resource
.
Type
.
Type
==
"rdss3"
&&
resource
.
ResourceTypeOptionId
!=
null
)
{
var
rdsS3ResourceTypeModel
=
new
RdsS3ResourceTypeModel
();
rdsS3ResourceTypeModel
.
Delete
(
rdsS3ResourceTypeModel
.
GetById
(
resource
.
ResourceTypeOptionId
.
Value
));
...
...
@@ -396,7 +250,7 @@ namespace Coscine.Database.Models
{
SetType
(
resource
);
DisciplineModel
disciplineModel
=
new
DisciplineModel
();
var
disciplineModel
=
new
DisciplineModel
();
var
disciplines
=
disciplineModel
.
GetAllWhere
((
discipline
)
=>
(
from
relation
in
discipline
.
ResourceDisciplines
//ResourceDisciplineDisciplineIdIds
where
relation
.
ResourceId
==
resource
.
Id
...
...
@@ -416,31 +270,31 @@ namespace Coscine.Database.Models
}
ResourceTypeOptionObject
resourceTypeOptionObject
=
null
;
if
(
IsLikeRds
(
resource
.
Type
.
DisplayName
)
&&
resource
.
ResourceTypeOptionId
!=
null
)
if
(
resource
.
Type
.
Type
==
"rds"
&&
resource
.
ResourceTypeOptionId
!=
null
)
{
RDSResourceTypeModel
rdsResourceTypeModel
=
new
RDSResourceTypeModel
();
var
rdsResourceType
=
rdsResourceTypeModel
.
GetById
(
resource
.
ResourceTypeOptionId
.
Value
);
resourceTypeOptionObject
=
new
RDSResourceTypeObject
(
rdsResourceType
.
Id
,
rdsResourceType
.
BucketName
,
(
int
)
rdsResourceType
.
Size
);
}
else
if
(
resource
.
Type
.
DisplayNam
e
==
"s3"
&&
resource
.
ResourceTypeOptionId
!=
null
)
else
if
(
resource
.
Type
.
Typ
e
==
"s3"
&&
resource
.
ResourceTypeOptionId
!=
null
)
{
S3ResourceTypeModel
s3ResourceTypeModel
=
new
S3ResourceTypeModel
();
var
s3ResourceType
=
s3ResourceTypeModel
.
GetById
(
resource
.
ResourceTypeOptionId
.
Value
);
resourceTypeOptionObject
=
new
S3ResourceTypeObject
(
s3ResourceType
.
Id
,
s3ResourceType
.
BucketName
,
null
,
null
,
s3ResourceType
.
ResourceUrl
);
}
else
if
(
resource
.
Type
.
DisplayNam
e
==
"gitlab"
&&
resource
.
ResourceTypeOptionId
!=
null
)
else
if
(
resource
.
Type
.
Typ
e
==
"gitlab"
&&
resource
.
ResourceTypeOptionId
!=
null
)
{
GitlabResourceTypeModel
gitlabResourceTypeModel
=
new
GitlabResourceTypeModel
();
var
gitlabResourceType
=
gitlabResourceTypeModel
.
GetById
(
resource
.
ResourceTypeOptionId
.
Value
);
resourceTypeOptionObject
=
new
GitlabResourceTypeObject
(
gitlabResourceType
.
Id
,
gitlabResourceType
.
RepositoryNumber
,
gitlabResourceType
.
RepositoryUrl
,
null
);
}
else
if
(
resource
.
Type
.
DisplayNam
e
==
"linked"
&&
resource
.
ResourceTypeOptionId
!=
null
)
else
if
(
resource
.
Type
.
Typ
e
==
"linked"
&&
resource
.
ResourceTypeOptionId
!=
null
)
{
LinkedResourceTypeModel
linkedResourceTypeModel
=
new
LinkedResourceTypeModel
();
var
linkedResourceType
=
linkedResourceTypeModel
.
GetById
(
resource
.
ResourceTypeOptionId
.
Value
);
resourceTypeOptionObject
=
new
LinkedResourceTypeObject
(
linkedResourceType
.
Id
);
}
else
if
(
IsLikeRdsS3
(
resource
.
Type
.
DisplayName
)
&&
resource
.
ResourceTypeOptionId
!=
null
)
else
if
(
resource
.
Type
.
Type
==
"rdss3"
&&
resource
.
ResourceTypeOptionId
!=
null
)
{
var
rdsS3ResourceTypeModel
=
new
RdsS3ResourceTypeModel
();
var
rdsS3ResourceType
=
rdsS3ResourceTypeModel
.
GetById
(
resource
.
ResourceTypeOptionId
.
Value
);
...
...
@@ -464,7 +318,7 @@ namespace Coscine.Database.Models
resource
.
Description
,
resource
.
Keywords
,
resource
.
UsageRights
,
new
ResourceTypeObject
(
resource
.
Type
.
Id
,
resource
.
Type
.
DisplayNam
e
),
new
ResourceTypeObject
(
resource
.
Type
.
Id
,
resource
.
Type
.
SpecificTyp
e
),
disciplines
,
(
resource
.
Visibility
!=
null
)
?
new
VisibilityObject
(
resource
.
Visibility
.
Id
,
resource
.
Visibility
.
DisplayName
)
:
null
,
(
resource
.
License
!=
null
)
?
new
LicenseObject
(
resource
.
License
.
Id
,
resource
.
License
.
DisplayName
)
:
null
,
...
...
@@ -558,15 +412,5 @@ namespace Coscine.Database.Models
return
$"
{
counted
}
/
{
maxCount
}
"
;
}
private
bool
IsLikeRds
(
string
compare
)
{
return
compare
==
"rds"
||
compare
==
"rdsude"
||
compare
==
"rdsnrw"
||
compare
==
"rdstudo"
;
}
private
bool
IsLikeRdsS3
(
string
compare
)
{
return
compare
==
"rdss3"
||
compare
==
"rdss3ude"
||
compare
==
"rdss3nrw"
||
compare
==
"rdss3tudo"
;
}
}
}
}
\ No newline at end of file
src/Scaffolding/DataModel/Model.cs
View file @
5a344850
...
...
@@ -42,6 +42,7 @@ namespace Coscine.Database.DataModel
public
virtual
DbSet
<
ProjectResource
>
ProjectResources
{
get
;
set
;
}
public
virtual
DbSet
<
ProjectRole
>
ProjectRoles
{
get
;
set
;
}
public
virtual
DbSet
<
RdsS3resourceType
>
RdsS3resourceTypes
{
get
;
set
;
}
public
virtual
DbSet
<
RdsS3wormResourceType
>
RdsS3wormResourceTypes
{
get
;
set
;
}
public
virtual
DbSet
<
RdsresourceType
>
RdsresourceTypes
{
get
;
set
;
}
public
virtual
DbSet
<
Resource
>
Resources
{
get
;
set
;
}
public
virtual
DbSet
<
ResourceDiscipline
>
ResourceDisciplines
{
get
;
set
;
}
...
...
@@ -543,6 +544,45 @@ namespace Coscine.Database.DataModel
.
HasMaxLength
(
200
);
});
modelBuilder
.
Entity
<
RdsS3wormResourceType
>(
entity
=>
{
entity
.
ToTable
(
"RdsS3WormResourceType"
);
entity
.
Property
(
e
=>
e
.
Id
).
HasDefaultValueSql
(
"(newid())"
);
entity
.
Property
(
e
=>
e
.
AccessKey
)
.
IsRequired
()
.
HasMaxLength
(
200
);
entity
.
Property
(
e
=>
e
.
AccessKeyRead
)
.
IsRequired
()
.
HasMaxLength
(
200
);
entity
.
Property
(
e
=>
e
.
AccessKeyWrite
)
.
IsRequired
()
.
HasMaxLength
(
200
);
entity
.
Property
(
e
=>
e
.
BucketName
)
.
IsRequired
()
.
HasMaxLength
(
63
);
entity
.
Property
(
e
=>
e
.
Endpoint
)
.
IsRequired
()
.
HasMaxLength
(
200
);
entity
.
Property
(
e
=>
e
.
SecretKey
)
.
IsRequired
()
.
HasMaxLength
(
200
);
entity
.
Property
(
e
=>
e
.
SecretKeyRead
)
.
IsRequired
()
.
HasMaxLength
(
200
);
entity
.
Property
(
e
=>
e
.
SecretKeyWrite
)
.
IsRequired
()
.
HasMaxLength
(
200
);
});
modelBuilder
.
Entity
<
RdsresourceType
>(
entity
=>
{
entity
.
ToTable
(
"RDSResourceType"
);
...
...
@@ -634,6 +674,10 @@ namespace Coscine.Database.DataModel
entity
.
Property
(
e
=>
e
.
Enabled
)
.
IsRequired
()
.
HasDefaultValueSql
(
"((1))"
);
entity
.
Property
(
e
=>
e
.
SpecificType
).
HasMaxLength
(
200
);
entity
.
Property
(
e
=>
e
.
Type
).
HasMaxLength
(
200
);
});
modelBuilder
.
Entity
<
Role
>(
entity
=>
...
...
src/Scaffolding/DataModel/RdsS3wormResourceType.cs
0 → 100644
View file @
5a344850
using
System
;
using
System.Collections.Generic
;
// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
// If you have enabled NRTs for your project, then un-comment the following line:
// #nullable disable
namespace
Coscine.Database.DataModel
{
public
partial
class
RdsS3wormResourceType
{
public
Guid
Id
{
get
;
set
;
}
public
string
BucketName
{
get
;
set
;
}
public
string
AccessKey
{
get
;
set
;
}
public
string
SecretKey
{
get
;
set
;
}
public
string
AccessKeyRead
{
get
;
set
;
}
public
string
SecretKeyRead
{
get
;
set
;
}
public
string
AccessKeyWrite
{
get
;
set
;
}
public
string
SecretKeyWrite
{
get
;
set
;
}
public
string
Endpoint
{
get
;
set
;
}
public
int
Size
{
get
;
set
;
}
}
}
src/Scaffolding/DataModel/ResourceType.cs
View file @
5a344850
...
...
@@ -18,6 +18,8 @@ namespace Coscine.Database.DataModel
public
Guid
Id
{
get
;
set
;
}
public
string
DisplayName
{
get
;
set
;
}
public
bool
?
Enabled
{
get
;
set
;
}
public
string
Type
{
get
;
set
;
}
public
string
SpecificType
{
get
;
set
;
}
public
virtual
ICollection
<
ProjectQuota
>
ProjectQuotas
{
get
;
set
;
}
public
virtual
ICollection
<
Resource
>
Resources
{
get
;
set
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment